sanka-baileyss 2.3.2 → 2.3.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.
Files changed (158) hide show
  1. package/WAProto/BotMetadata/BotMetadata.d.ts +594 -1
  2. package/WAProto/BotMetadata/BotMetadata.js +1910 -148
  3. package/WAProto/BotMetadata/BotMetadata.proto +36 -0
  4. package/WAProto/E2E/E2E.d.ts +570 -6
  5. package/WAProto/E2E/E2E.js +1591 -26
  6. package/WAProto/E2E/E2E.proto +10 -1
  7. package/WAProto/HistorySync/HistorySync.d.ts +806 -6
  8. package/WAProto/HistorySync/HistorySync.js +2193 -29
  9. package/WAProto/HistorySync/HistorySync.proto +2 -1
  10. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
  11. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
  12. package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
  13. package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
  14. package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
  15. package/WAProto/SyncAction/SyncAction.d.ts +230 -0
  16. package/WAProto/SyncAction/SyncAction.js +578 -2
  17. package/WAProto/SyncAction/SyncAction.proto +13 -1
  18. package/WAProto/Web/Web.d.ts +570 -6
  19. package/WAProto/Web/Web.js +1591 -26
  20. package/lib/Defaults/baileys-version.json +2 -2
  21. package/lib/Defaults/index.d.ts +42 -25
  22. package/lib/Defaults/index.js +6 -2
  23. package/lib/Signal/libsignal.d.ts +1 -0
  24. package/lib/Socket/Client/index.js +13 -9
  25. package/lib/Socket/Client/types.d.ts +11 -10
  26. package/lib/Socket/Client/types.js +11 -7
  27. package/lib/Socket/Client/websocket.d.ts +9 -8
  28. package/lib/Socket/Client/websocket.js +52 -47
  29. package/lib/Socket/business.d.ts +185 -182
  30. package/lib/Socket/business.js +258 -249
  31. package/lib/Socket/chats.d.ts +90 -87
  32. package/lib/Socket/chats.js +1095 -888
  33. package/lib/Socket/community.d.ts +131 -0
  34. package/lib/Socket/community.js +369 -0
  35. package/lib/Socket/groups.d.ts +50 -41
  36. package/lib/Socket/groups.js +10 -3
  37. package/lib/Socket/index.d.ts +5 -1
  38. package/lib/Socket/index.js +19 -5
  39. package/lib/Socket/messages-recv.d.ts +6 -2
  40. package/lib/Socket/messages-recv.js +31 -8
  41. package/lib/Socket/messages-send.d.ts +5 -1
  42. package/lib/Socket/messages-send.js +1293 -1351
  43. package/lib/Socket/newsletter.d.ts +142 -135
  44. package/lib/Socket/newsletter.js +274 -230
  45. package/lib/Socket/socket.d.ts +37 -35
  46. package/lib/Socket/usync.d.ts +31 -30
  47. package/lib/Socket/usync.js +74 -62
  48. package/lib/Types/Auth.d.ts +89 -72
  49. package/lib/Types/Auth.js +1 -0
  50. package/lib/Types/Call.d.ts +11 -10
  51. package/lib/Types/Call.js +1 -0
  52. package/lib/Types/Chat.d.ts +85 -62
  53. package/lib/Types/Chat.js +4 -1
  54. package/lib/Types/Contact.js +1 -0
  55. package/lib/Types/Events.d.ts +209 -191
  56. package/lib/Types/Events.js +1 -0
  57. package/lib/Types/GroupMetadata.d.ts +12 -27
  58. package/lib/Types/GroupMetadata.js +1 -0
  59. package/lib/Types/Label.d.ts +41 -39
  60. package/lib/Types/Label.js +24 -21
  61. package/lib/Types/LabelAssociation.d.ts +18 -12
  62. package/lib/Types/LabelAssociation.js +6 -3
  63. package/lib/Types/Message.d.ts +3 -2
  64. package/lib/Types/Message.js +7 -3
  65. package/lib/Types/MexUpdates.d.ts +9 -0
  66. package/lib/Types/MexUpdates.js +18 -0
  67. package/lib/Types/Newsletter.d.ts +84 -67
  68. package/lib/Types/Newsletter.js +30 -23
  69. package/lib/Types/Product.d.ts +70 -56
  70. package/lib/Types/Product.js +1 -0
  71. package/lib/Types/Signal.d.ts +46 -35
  72. package/lib/Types/Signal.js +1 -0
  73. package/lib/Types/Socket.d.ts +105 -101
  74. package/lib/Types/Socket.js +1 -0
  75. package/lib/Types/State.d.ts +37 -23
  76. package/lib/Types/State.js +13 -1
  77. package/lib/Types/USync.d.ts +21 -20
  78. package/lib/Types/USync.js +1 -0
  79. package/lib/Types/index.d.ts +51 -42
  80. package/lib/Types/index.js +25 -19
  81. package/lib/Utils/auth-utils.d.ts +14 -11
  82. package/lib/Utils/auth-utils.js +189 -182
  83. package/lib/Utils/baileys-event-stream.d.ts +12 -10
  84. package/lib/Utils/baileys-event-stream.js +52 -46
  85. package/lib/Utils/business.d.ts +15 -8
  86. package/lib/Utils/business.js +229 -217
  87. package/lib/Utils/chat-utils.d.ts +22 -12
  88. package/lib/Utils/chat-utils.js +57 -27
  89. package/lib/Utils/crypto.d.ts +31 -15
  90. package/lib/Utils/crypto.js +136 -107
  91. package/lib/Utils/decode-wa-message.d.ts +34 -245
  92. package/lib/Utils/decode-wa-message.js +205 -217
  93. package/lib/Utils/event-buffer.d.ts +30 -26
  94. package/lib/Utils/event-buffer.js +519 -515
  95. package/lib/Utils/history.d.ts +2 -8
  96. package/lib/Utils/index.js +13 -9
  97. package/lib/Utils/link-preview.d.ts +16 -14
  98. package/lib/Utils/link-preview.js +100 -92
  99. package/lib/Utils/logger.d.ts +9 -7
  100. package/lib/Utils/logger.js +1 -1
  101. package/lib/Utils/lt-hash.d.ts +10 -8
  102. package/lib/Utils/lt-hash.js +49 -44
  103. package/lib/Utils/make-mutex.d.ts +4 -2
  104. package/lib/Utils/make-mutex.js +43 -39
  105. package/lib/Utils/messages-media.d.ts +75 -50
  106. package/lib/Utils/messages.d.ts +60 -35
  107. package/lib/Utils/messages.js +87 -8
  108. package/lib/Utils/noise-handler.d.ts +13 -12
  109. package/lib/Utils/noise-handler.js +143 -138
  110. package/lib/Utils/process-message.d.ts +32 -24
  111. package/lib/Utils/process-message.js +387 -367
  112. package/lib/Utils/signal.d.ts +24 -15
  113. package/lib/Utils/signal.js +143 -131
  114. package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
  115. package/lib/Utils/use-mongo-file-auth-state.js +72 -63
  116. package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
  117. package/lib/Utils/use-multi-file-auth-state.js +110 -102
  118. package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
  119. package/lib/Utils/use-single-file-auth-state.js +66 -61
  120. package/lib/Utils/validate-connection.d.ts +5 -2
  121. package/lib/Utils/validate-connection.js +7 -6
  122. package/lib/WABinary/constants.d.ts +24 -21
  123. package/lib/WABinary/constants.js +1302 -31
  124. package/lib/WABinary/decode.d.ts +4 -1
  125. package/lib/WABinary/decode.js +267 -234
  126. package/lib/WABinary/encode.d.ts +1 -0
  127. package/lib/WABinary/encode.js +248 -226
  128. package/lib/WABinary/generic-utils.d.ts +13 -1
  129. package/lib/WABinary/generic-utils.js +113 -96
  130. package/lib/WABinary/index.js +13 -9
  131. package/lib/WABinary/jid-utils.d.ts +23 -4
  132. package/lib/WABinary/jid-utils.js +58 -39
  133. package/lib/WABinary/types.d.ts +15 -11
  134. package/lib/WABinary/types.js +1 -0
  135. package/lib/WAM/BinaryInfo.d.ts +14 -14
  136. package/lib/WAM/BinaryInfo.js +11 -8
  137. package/lib/WAM/constants.d.ts +34 -26
  138. package/lib/WAM/constants.js +15358 -15349
  139. package/lib/WAM/encode.d.ts +1 -0
  140. package/lib/WAM/encode.js +153 -144
  141. package/lib/WAM/index.js +13 -9
  142. package/lib/index.js +11 -11
  143. package/package.json +1 -2
  144. package/WASignalGroup/GroupProtocol.js +0 -1771
  145. package/WASignalGroup/ciphertext_message.js +0 -10
  146. package/WASignalGroup/group_cipher.js +0 -103
  147. package/WASignalGroup/group_session_builder.js +0 -39
  148. package/WASignalGroup/index.js +0 -5
  149. package/WASignalGroup/keyhelper.js +0 -17
  150. package/WASignalGroup/protobufs.js +0 -2
  151. package/WASignalGroup/queue_job.js +0 -64
  152. package/WASignalGroup/sender_chain_key.js +0 -38
  153. package/WASignalGroup/sender_key_distribution_message.js +0 -68
  154. package/WASignalGroup/sender_key_message.js +0 -79
  155. package/WASignalGroup/sender_key_name.js +0 -59
  156. package/WASignalGroup/sender_key_record.js +0 -47
  157. package/WASignalGroup/sender_key_state.js +0 -110
  158. package/WASignalGroup/sender_message_key.js +0 -30
@@ -1,8 +1,11 @@
1
1
  "use strict"
2
+
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod }
4
+ return (mod && mod.__esModule) ? mod : { "default": mod }
4
5
  }
6
+
5
7
  Object.defineProperty(exports, "__esModule", { value: true })
8
+
6
9
  const async_mutex_1 = __importDefault(require("async-mutex"))
7
10
  const promises_1 = require("fs/promises")
8
11
  const path_1 = require("path")
@@ -14,110 +17,115 @@ const generics_1 = require("./generics")
14
17
  // https://github.com/nodejs/node/issues/26338
15
18
  // Use a Map to store mutexes for each file path
16
19
  const fileLocks = new Map()
20
+
17
21
  // Get or create a mutex for a specific file path
18
22
  const getFileLock = (path) => {
19
- let mutex = fileLocks.get(path)
20
- if (!mutex) {
21
- mutex = new async_mutex_1.Mutex()
22
- fileLocks.set(path, mutex)
23
- }
24
- return mutex
25
- }
23
+ let mutex = fileLocks.get(path)
24
+ if (!mutex) {
25
+ mutex = new async_mutex_1.Mutex()
26
+ fileLocks.set(path, mutex)
27
+ }
28
+
29
+ return mutex
30
+ }
31
+
26
32
  /**
27
- * stores the full authentication state in a single folder.
28
- * Far more efficient than singlefileauthstate
29
- *
30
- * Again, I wouldn't endorse this for any production level use other than perhaps a bot.
31
- * Would recommend writing an auth state for use with a proper SQL or No-SQL DB
32
- * */
33
+ * stores the full authentication state in a single folder.
34
+ * Far more efficient than singlefileauthstate
35
+ *
36
+ * Again, I wouldn't endorse this for any production level use other than perhaps a bot.
37
+ * Would recommend writing an auth state for use with a proper SQL or No-SQL DB
38
+ * */
33
39
  const useMultiFileAuthState = async (folder) => {
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- const writeData = async (data, file) => {
36
- const filePath = path_1.join(folder, fixFileName(file))
37
- const mutex = getFileLock(filePath)
38
- return mutex.acquire().then(async (release) => {
39
- try {
40
- await promises_1.writeFile(filePath, JSON.stringify(data, generics_1.BufferJSON.replacer))
41
- } finally {
42
- release()
43
- }
44
- })
45
- }
46
- const readData = async (file) => {
47
- try {
48
- const filePath = path_1.join(folder, fixFileName(file))
49
- const mutex = getFileLock(filePath)
50
- const data = await mutex.acquire().then(async (release) => {
51
- try {
52
- return await promises_1.readFile(filePath, { encoding: 'utf-8' })
53
- } finally {
54
- release()
55
- }
56
- })
57
- return JSON.parse(data, generics_1.BufferJSON.reviver)
58
- } catch (error) {
59
- return null
60
- }
61
- }
62
- const removeData = async (file) => {
63
- try {
64
- const filePath = path_1.join(folder, fixFileName(file))
65
- const mutex = getFileLock(filePath)
66
- await mutex.acquire().then(async (release) => {
67
- try {
68
- await promises_1.unlink(filePath)
69
- } finally {
70
- release()
71
- }
72
- })
73
- } catch {}
74
- }
75
- const folderInfo = await promises_1.stat(folder).catch(() => { })
76
- if (folderInfo) {
77
- if (!folderInfo.isDirectory()) {
78
- throw new Error(`found something that is not a directory at ${folder}, either delete it or specify a different location`)
79
- }
80
- }
81
- else {
82
- await promises_1.mkdir(folder, { recursive: true })
83
- }
84
- const fixFileName = (file) => {
85
- return file?.replace(/\//g, '__')?.replace(/:/g, '-')
86
- }
87
- const creds = await readData('creds.json') || auth_utils_1.initAuthCreds()
88
- return {
89
- state: {
90
- creds,
91
- keys: {
92
- get: async (type, ids) => {
93
- const data = {}
94
- await Promise.all(ids.map(async (id) => {
95
- let value = await readData(`${type}-${id}.json`)
96
- if (type === 'app-state-sync-key' && value) {
97
- value = WAProto_1.proto.Message.AppStateSyncKeyData.fromObject(value)
98
- }
99
- data[id] = value
100
- }))
101
- return data
102
- },
103
- set: async (data) => {
104
- const tasks = []
105
- for (const category in data) {
106
- for (const id in data[category]) {
107
- const value = data[category][id]
108
- const file = `${category}-${id}.json`
109
- tasks.push(value ? writeData(value, file) : removeData(file))
110
- }
111
- }
112
- await Promise.all(tasks)
113
- }
114
- }
115
- },
116
- saveCreds: async () => {
117
- return writeData(creds, 'creds.json')
118
- }
119
- }
120
- }
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ const writeData = async (data, file) => {
42
+ const filePath = path_1.join(folder, fixFileName(file))
43
+ const mutex = getFileLock(filePath)
44
+ return mutex.acquire().then(async (release) => {
45
+ try {
46
+ await promises_1.writeFile(filePath, JSON.stringify(data, generics_1.BufferJSON.replacer))
47
+ } finally {
48
+ release()
49
+ }
50
+ })
51
+ }
52
+ const readData = async (file) => {
53
+ try {
54
+ const filePath = path_1.join(folder, fixFileName(file))
55
+ const mutex = getFileLock(filePath)
56
+ const data = await mutex.acquire().then(async (release) => {
57
+ try {
58
+ return await promises_1.readFile(filePath, { encoding: 'utf-8' })
59
+ } finally {
60
+ release()
61
+ }
62
+ })
63
+
64
+ return JSON.parse(data, generics_1.BufferJSON.reviver)
65
+ } catch (error) {
66
+ return null
67
+ }
68
+ }
69
+ const removeData = async (file) => {
70
+ try {
71
+ const filePath = path_1.join(folder, fixFileName(file))
72
+ const mutex = getFileLock(filePath)
73
+ await mutex.acquire().then(async (release) => {
74
+ try {
75
+ await promises_1.unlink(filePath)
76
+ } finally {
77
+ release()
78
+ }
79
+ })
80
+ } catch {}
81
+ }
82
+ const folderInfo = await promises_1.stat(folder).catch(() => { })
83
+ if (folderInfo) {
84
+ if (!folderInfo.isDirectory()) {
85
+ throw new Error(`found something that is not a directory at ${folder}, either delete it or specify a different location`)
86
+ }
87
+ }
88
+ else {
89
+ await promises_1.mkdir(folder, { recursive: true })
90
+ }
91
+ const fixFileName = (file) => {
92
+ return file?.replace(/\//g, '__')?.replace(/:/g, '-')
93
+ }
94
+ const creds = await readData('creds.json') || auth_utils_1.initAuthCreds()
95
+ return {
96
+ state: {
97
+ creds,
98
+ keys: {
99
+ get: async (type, ids) => {
100
+ const data = {}
101
+ await Promise.all(ids.map(async (id) => {
102
+ let value = await readData(`${type}-${id}.json`)
103
+ if (type === 'app-state-sync-key' && value) {
104
+ value = WAProto_1.proto.Message.AppStateSyncKeyData.fromObject(value)
105
+ }
106
+ data[id] = value
107
+ }))
108
+ return data
109
+ },
110
+ set: async (data) => {
111
+ const tasks = []
112
+ for (const category in data) {
113
+ for (const id in data[category]) {
114
+ const value = data[category][id]
115
+ const file = `${category}-${id}.json`
116
+ tasks.push(value ? writeData(value, file) : removeData(file))
117
+ }
118
+ }
119
+ await Promise.all(tasks)
120
+ }
121
+ }
122
+ },
123
+ saveCreds: async () => {
124
+ return writeData(creds, 'creds.json')
125
+ }
126
+ }
127
+ }
128
+
121
129
  module.exports = {
122
- useMultiFileAuthState
130
+ useMultiFileAuthState
123
131
  }
@@ -1,12 +1,13 @@
1
1
  import { ILogger } from './logger'
2
2
  import type { AuthenticationState } from '../Types'
3
+
3
4
  /**
4
- * @deprecated use multi file auth state instead please
5
- * stores the full authentication state in a single JSON file
6
- *
7
- * DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
8
- * */
5
+ * @deprecated use multi file auth state instead please
6
+ * stores the full authentication state in a single JSON file
7
+ *
8
+ * DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
9
+ * */
9
10
  export declare const useSingleFileAuthState: (filename: string, logger?: ILogger) => {
10
- state: AuthenticationState
11
- saveState: () => void
11
+ state: AuthenticationState
12
+ saveState: () => void
12
13
  }
@@ -1,75 +1,80 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
4
+
3
5
  const WAProto_1 = require("../../WAProto")
4
6
  const auth_utils_1 = require("./auth-utils")
5
7
  const generics_1 = require("./generics")
8
+
6
9
  // useless key map only there to maintain backwards compatibility
7
10
  // do not use in your own systems please
8
11
  const KEY_MAP = {
9
- 'pre-key': 'preKeys',
10
- 'session': 'sessions',
11
- 'sender-key': 'senderKeys',
12
- 'app-state-sync-key': 'appStateSyncKeys',
13
- 'app-state-sync-version': 'appStateVersions',
14
- 'sender-key-memory': 'senderKeyMemory'
12
+ 'pre-key': 'preKeys',
13
+ 'session': 'sessions',
14
+ 'sender-key': 'senderKeys',
15
+ 'app-state-sync-key': 'appStateSyncKeys',
16
+ 'app-state-sync-version': 'appStateVersions',
17
+ 'sender-key-memory': 'senderKeyMemory'
15
18
  }
19
+
16
20
  /**
17
- * @deprecated use multi file auth state instead please
18
- * stores the full authentication state in a single JSON file
19
- *
20
- * DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
21
- * */
21
+ * @deprecated use multi file auth state instead please
22
+ * stores the full authentication state in a single JSON file
23
+ *
24
+ * DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
25
+ * */
22
26
  const useSingleFileAuthState = (filename, logger) => {
23
- // require fs here so that in case "fs" is not available -- the app does not crash
24
- const { readFileSync, writeFileSync, existsSync } = require('fs')
25
- let creds
26
- let keys = {}
27
- // save the authentication state to a file
28
- const saveState = () => {
29
- logger && logger.trace('saving auth state')
30
- writeFileSync(filename,
31
- // BufferJSON replacer utility saves buffers nicely
32
- JSON.stringify({ creds, keys }, generics_1.BufferJSON.replacer, 2))
33
- }
34
- if (existsSync(filename)) {
35
- const result = JSON.parse(readFileSync(filename, { encoding: 'utf-8' }), generics_1.BufferJSON.reviver)
36
- creds = result.creds
37
- keys = result.keys
38
- }
39
- else {
40
- creds = auth_utils_1.initAuthCreds()
41
- keys = {}
42
- }
43
- return {
44
- state: {
45
- creds,
46
- keys: {
47
- get: (type, ids) => {
48
- const key = KEY_MAP[type]
49
- return ids.reduce((dict, id) => {
50
- let value = keys[key]?.[id]
51
- if (value) {
52
- if (type === 'app-state-sync-key') {
53
- value = WAProto_1.proto.Message.AppStateSyncKeyData.fromObject(value)
54
- }
55
- dict[id] = value
56
- }
57
- return dict
58
- }, {})
59
- },
60
- set: (data) => {
61
- for (const _key in data) {
62
- const key = KEY_MAP[_key]
63
- keys[key] = keys[key] || {}
64
- Object.assign(keys[key], data[_key])
65
- }
66
- saveState()
67
- }
68
- }
69
- },
70
- saveState
71
- }
27
+ // require fs here so that in case "fs" is not available -- the app does not crash
28
+ const { readFileSync, writeFileSync, existsSync } = require('fs')
29
+ let creds
30
+ let keys = {}
31
+ // save the authentication state to a file
32
+ const saveState = () => {
33
+ logger && logger.trace('saving auth state')
34
+ writeFileSync(filename,
35
+ // BufferJSON replacer utility saves buffers nicely
36
+ JSON.stringify({ creds, keys }, generics_1.BufferJSON.replacer, 2))
37
+ }
38
+ if (existsSync(filename)) {
39
+ const result = JSON.parse(readFileSync(filename, { encoding: 'utf-8' }), generics_1.BufferJSON.reviver)
40
+ creds = result.creds
41
+ keys = result.keys
42
+ }
43
+ else {
44
+ creds = auth_utils_1.initAuthCreds()
45
+ keys = {}
46
+ }
47
+ return {
48
+ state: {
49
+ creds,
50
+ keys: {
51
+ get: (type, ids) => {
52
+ const key = KEY_MAP[type]
53
+ return ids.reduce((dict, id) => {
54
+ let value = keys[key]?.[id]
55
+ if (value) {
56
+ if (type === 'app-state-sync-key') {
57
+ value = WAProto_1.proto.Message.AppStateSyncKeyData.fromObject(value)
58
+ }
59
+ dict[id] = value
60
+ }
61
+ return dict
62
+ }, {})
63
+ },
64
+ set: (data) => {
65
+ for (const _key in data) {
66
+ const key = KEY_MAP[_key]
67
+ keys[key] = keys[key] || {}
68
+ Object.assign(keys[key], data[_key])
69
+ }
70
+ saveState()
71
+ }
72
+ }
73
+ },
74
+ saveState
75
+ }
72
76
  }
77
+
73
78
  module.exports = {
74
- useSingleFileAuthState
79
+ useSingleFileAuthState
75
80
  }
@@ -1,10 +1,13 @@
1
1
  import { proto } from '../../WAProto'
2
2
  import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'
3
3
  import { BinaryNode } from '../WABinary'
4
+
4
5
  export declare const generateLoginNode: (userJid: string, config: SocketConfig) => proto.IClientPayload
6
+
5
7
  export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: SocketConfig) => proto.ClientPayload
8
+
6
9
  export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick<AuthenticationCreds, 'advSecretKey' | 'signedIdentityKey' | 'signalIdentities'>) => {
7
- creds: Partial<AuthenticationCreds>
8
- reply: BinaryNode
10
+ creds: Partial<AuthenticationCreds>
11
+ reply: BinaryNode
9
12
  }
10
13
  export declare const encodeSignedDeviceIdentity: (account: proto.IADVSignedDeviceIdentity, includeSignatureKey: boolean) => Uint8Array
@@ -19,13 +19,14 @@ const getUserAgent = (config) => {
19
19
  tertiary: config.version[2],
20
20
  },
21
21
  platform: WAProto_1.proto.ClientPayload.UserAgent.Platform.WEB,
22
- releaseChannel: WAProto_1.proto.ClientPayload.UserAgent.ReleaseChannel.ALPHA,
23
- osVersion: '10.0',
22
+ releaseChannel: WAProto_1.proto.ClientPayload.UserAgent.ReleaseChannel.RELEASE,
23
+ osVersion: '0.1',
24
24
  device: 'Desktop',
25
- deviceType: WAProto_1.proto.ClientPayload.UserAgent.DeviceType.DESKTOP,
26
- osBuildNumber: '19045',
27
- localeLanguageIso6391: 'id',
28
- localeCountryIso31661Alpha2: config.countryCode,
25
+ osBuildNumber: '0.1',
26
+ localeLanguageIso6391: 'en',
27
+ mnc: '000',
28
+ mcc: '000',
29
+ localeCountryIso31661Alpha2: config.countryCode
29
30
  }
30
31
  }
31
32
 
@@ -1,27 +1,30 @@
1
1
  export declare const TAGS: {
2
- LIST_EMPTY: number
3
- DICTIONARY_0: number
4
- DICTIONARY_1: number
5
- DICTIONARY_2: number
6
- DICTIONARY_3: number
7
- AD_JID: number
8
- LIST_8: number
9
- LIST_16: number
10
- JID_PAIR: number
11
- HEX_8: number
12
- BINARY_8: number
13
- BINARY_20: number
14
- BINARY_32: number
15
- NIBBLE_8: number
16
- PACKED_MAX: number
17
- SINGLE_BYTE_MAX: number
18
- STREAM_END: number
2
+ LIST_EMPTY: number
3
+ DICTIONARY_0: number
4
+ DICTIONARY_1: number
5
+ DICTIONARY_2: number
6
+ DICTIONARY_3: number
7
+ INTEROP_JID: number
8
+ FB_JID: number
9
+ AD_JID: number
10
+ LIST_8: number
11
+ LIST_16: number
12
+ JID_PAIR: number
13
+ HEX_8: number
14
+ BINARY_8: number
15
+ BINARY_20: number
16
+ BINARY_32: number
17
+ NIBBLE_8: number
18
+ PACKED_MAX: number
19
19
  }
20
+
20
21
  export declare const DOUBLE_BYTE_TOKENS: string[][]
22
+
21
23
  export declare const SINGLE_BYTE_TOKENS: (string | null)[]
24
+
22
25
  export declare const TOKEN_MAP: {
23
- [token: string]: {
24
- dict?: number
25
- index: number
26
- }
26
+ [token: string]: {
27
+ dict?: number
28
+ index: number
29
+ }
27
30
  }