@neelegirl/baileys 1.5.3 → 1.5.5

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 (224) hide show
  1. package/README.md +16 -195
  2. package/index.js +38 -0
  3. package/package.json +16 -96
  4. package/LICENSE +0 -21
  5. package/WAProto/WAProto.proto +0 -5308
  6. package/WAProto/index.d.ts +0 -61295
  7. package/WAProto/index.js +0 -189754
  8. package/lib/Defaults/baileys-version.json +0 -3
  9. package/lib/Defaults/index.d.ts +0 -78
  10. package/lib/Defaults/index.js +0 -149
  11. package/lib/Defaults/phonenumber-mcc.json +0 -223
  12. package/lib/Signal/WASignalGroup/GroupProtocol.js +0 -1909
  13. package/lib/Signal/WASignalGroup/ciphertext-message.d.ts +0 -9
  14. package/lib/Signal/WASignalGroup/ciphertext-message.js +0 -19
  15. package/lib/Signal/WASignalGroup/ciphertext_message.js +0 -16
  16. package/lib/Signal/WASignalGroup/generate-proto.sh +0 -1
  17. package/lib/Signal/WASignalGroup/group-session-builder.d.ts +0 -17
  18. package/lib/Signal/WASignalGroup/group-session-builder.js +0 -72
  19. package/lib/Signal/WASignalGroup/group.proto +0 -42
  20. package/lib/Signal/WASignalGroup/group_cipher.d.ts +0 -19
  21. package/lib/Signal/WASignalGroup/group_cipher.js +0 -111
  22. package/lib/Signal/WASignalGroup/group_session_builder.js +0 -46
  23. package/lib/Signal/WASignalGroup/index.d.ts +0 -11
  24. package/lib/Signal/WASignalGroup/index.js +0 -61
  25. package/lib/Signal/WASignalGroup/keyhelper.d.ts +0 -16
  26. package/lib/Signal/WASignalGroup/keyhelper.js +0 -66
  27. package/lib/Signal/WASignalGroup/protobufs.js +0 -3
  28. package/lib/Signal/WASignalGroup/queue_job.js +0 -69
  29. package/lib/Signal/WASignalGroup/readme.md +0 -6
  30. package/lib/Signal/WASignalGroup/sender-chain-key.d.ts +0 -14
  31. package/lib/Signal/WASignalGroup/sender-chain-key.js +0 -47
  32. package/lib/Signal/WASignalGroup/sender-key-distribution-message.d.ts +0 -17
  33. package/lib/Signal/WASignalGroup/sender-key-distribution-message.js +0 -71
  34. package/lib/Signal/WASignalGroup/sender-key-message.d.ts +0 -19
  35. package/lib/Signal/WASignalGroup/sender-key-message.js +0 -73
  36. package/lib/Signal/WASignalGroup/sender-key-name.d.ts +0 -19
  37. package/lib/Signal/WASignalGroup/sender-key-name.js +0 -59
  38. package/lib/Signal/WASignalGroup/sender-key-record.d.ts +0 -32
  39. package/lib/Signal/WASignalGroup/sender-key-record.js +0 -58
  40. package/lib/Signal/WASignalGroup/sender-key-state.d.ts +0 -44
  41. package/lib/Signal/WASignalGroup/sender-key-state.js +0 -147
  42. package/lib/Signal/WASignalGroup/sender-message-key.d.ts +0 -11
  43. package/lib/Signal/WASignalGroup/sender-message-key.js +0 -33
  44. package/lib/Signal/WASignalGroup/sender_chain_key.js +0 -50
  45. package/lib/Signal/WASignalGroup/sender_key_distribution_message.js +0 -78
  46. package/lib/Signal/WASignalGroup/sender_key_message.js +0 -92
  47. package/lib/Signal/WASignalGroup/sender_key_name.js +0 -70
  48. package/lib/Signal/WASignalGroup/sender_key_record.js +0 -56
  49. package/lib/Signal/WASignalGroup/sender_key_state.js +0 -129
  50. package/lib/Signal/WASignalGroup/sender_message_key.js +0 -39
  51. package/lib/Signal/libsignal.d.ts +0 -8
  52. package/lib/Signal/libsignal.js +0 -391
  53. package/lib/Signal/lid-mapping.d.ts +0 -28
  54. package/lib/Signal/lid-mapping.js +0 -184
  55. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -15
  56. package/lib/Socket/Client/abstract-socket-client.js +0 -13
  57. package/lib/Socket/Client/index.d.ts +0 -2
  58. package/lib/Socket/Client/index.js +0 -22
  59. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -12
  60. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  61. package/lib/Socket/Client/types.d.ts +0 -16
  62. package/lib/Socket/Client/types.js +0 -18
  63. package/lib/Socket/Client/websocket.d.ts +0 -13
  64. package/lib/Socket/Client/websocket.js +0 -62
  65. package/lib/Socket/business.d.ts +0 -187
  66. package/lib/Socket/business.js +0 -415
  67. package/lib/Socket/chats.d.ts +0 -97
  68. package/lib/Socket/chats.js +0 -1118
  69. package/lib/Socket/communities.d.ts +0 -223
  70. package/lib/Socket/communities.js +0 -433
  71. package/lib/Socket/groups.d.ts +0 -129
  72. package/lib/Socket/groups.js +0 -360
  73. package/lib/Socket/index.d.ts +0 -191
  74. package/lib/Socket/index.js +0 -24
  75. package/lib/Socket/messages-recv.d.ts +0 -174
  76. package/lib/Socket/messages-recv.js +0 -1506
  77. package/lib/Socket/messages-send.d.ts +0 -165
  78. package/lib/Socket/messages-send.js +0 -1785
  79. package/lib/Socket/mex.d.ts +0 -2
  80. package/lib/Socket/mex.js +0 -47
  81. package/lib/Socket/newsletter.d.ts +0 -145
  82. package/lib/Socket/newsletter.js +0 -295
  83. package/lib/Socket/socket.d.ts +0 -45
  84. package/lib/Socket/socket.js +0 -934
  85. package/lib/Socket/usync.d.ts +0 -37
  86. package/lib/Socket/usync.js +0 -83
  87. package/lib/Store/index.d.ts +0 -4
  88. package/lib/Store/index.js +0 -24
  89. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  90. package/lib/Store/make-cache-manager-store.js +0 -90
  91. package/lib/Store/make-in-memory-store.d.ts +0 -123
  92. package/lib/Store/make-in-memory-store.js +0 -429
  93. package/lib/Store/make-ordered-dictionary.d.ts +0 -12
  94. package/lib/Store/make-ordered-dictionary.js +0 -86
  95. package/lib/Store/object-repository.d.ts +0 -10
  96. package/lib/Store/object-repository.js +0 -31
  97. package/lib/Types/Auth.d.ts +0 -121
  98. package/lib/Types/Auth.js +0 -3
  99. package/lib/Types/Bussines.js +0 -3
  100. package/lib/Types/Bussiness.d.ts +0 -28
  101. package/lib/Types/Call.d.ts +0 -14
  102. package/lib/Types/Call.js +0 -3
  103. package/lib/Types/Chat.d.ts +0 -143
  104. package/lib/Types/Chat.js +0 -9
  105. package/lib/Types/Contact.d.ts +0 -23
  106. package/lib/Types/Contact.js +0 -3
  107. package/lib/Types/Events.d.ts +0 -226
  108. package/lib/Types/Events.js +0 -3
  109. package/lib/Types/GroupMetadata.d.ts +0 -66
  110. package/lib/Types/GroupMetadata.js +0 -3
  111. package/lib/Types/Label.d.ts +0 -48
  112. package/lib/Types/Label.js +0 -31
  113. package/lib/Types/LabelAssociation.d.ts +0 -35
  114. package/lib/Types/LabelAssociation.js +0 -13
  115. package/lib/Types/Message.d.ts +0 -484
  116. package/lib/Types/Message.js +0 -19
  117. package/lib/Types/MexUpdates.d.ts +0 -9
  118. package/lib/Types/MexUpdates.js +0 -18
  119. package/lib/Types/Newsletter.d.ts +0 -109
  120. package/lib/Types/Newsletter.js +0 -40
  121. package/lib/Types/Product.d.ts +0 -92
  122. package/lib/Types/Product.js +0 -3
  123. package/lib/Types/Signal.d.ts +0 -98
  124. package/lib/Types/Signal.js +0 -3
  125. package/lib/Types/Socket.d.ts +0 -141
  126. package/lib/Types/Socket.js +0 -3
  127. package/lib/Types/State.d.ts +0 -41
  128. package/lib/Types/State.js +0 -14
  129. package/lib/Types/USync.d.ts +0 -26
  130. package/lib/Types/USync.js +0 -3
  131. package/lib/Types/index.d.ts +0 -80
  132. package/lib/Types/index.js +0 -50
  133. package/lib/Utils/auth-utils.d.ts +0 -21
  134. package/lib/Utils/auth-utils.js +0 -528
  135. package/lib/Utils/baileys-event-stream.d.ts +0 -18
  136. package/lib/Utils/baileys-event-stream.js +0 -70
  137. package/lib/Utils/business.d.ts +0 -29
  138. package/lib/Utils/business.js +0 -255
  139. package/lib/Utils/chat-utils.d.ts +0 -82
  140. package/lib/Utils/chat-utils.js +0 -809
  141. package/lib/Utils/crypto.d.ts +0 -56
  142. package/lib/Utils/crypto.js +0 -189
  143. package/lib/Utils/decode-wa-message.d.ts +0 -53
  144. package/lib/Utils/decode-wa-message.js +0 -323
  145. package/lib/Utils/event-buffer.d.ts +0 -39
  146. package/lib/Utils/event-buffer.js +0 -595
  147. package/lib/Utils/generics.d.ts +0 -131
  148. package/lib/Utils/generics.js +0 -630
  149. package/lib/Utils/history.d.ts +0 -23
  150. package/lib/Utils/history.js +0 -104
  151. package/lib/Utils/index.d.ts +0 -20
  152. package/lib/Utils/index.js +0 -40
  153. package/lib/Utils/link-preview.d.ts +0 -23
  154. package/lib/Utils/link-preview.js +0 -120
  155. package/lib/Utils/logger.d.ts +0 -13
  156. package/lib/Utils/logger.js +0 -7
  157. package/lib/Utils/lt-hash.d.ts +0 -14
  158. package/lib/Utils/lt-hash.js +0 -58
  159. package/lib/Utils/make-mutex.d.ts +0 -9
  160. package/lib/Utils/make-mutex.js +0 -49
  161. package/lib/Utils/message-retry-manager.d.ts +0 -88
  162. package/lib/Utils/message-retry-manager.js +0 -160
  163. package/lib/Utils/messages-media.d.ts +0 -135
  164. package/lib/Utils/messages-media.js +0 -869
  165. package/lib/Utils/messages.d.ts +0 -105
  166. package/lib/Utils/messages.js +0 -1745
  167. package/lib/Utils/noise-handler.d.ts +0 -21
  168. package/lib/Utils/noise-handler.js +0 -165
  169. package/lib/Utils/process-message.d.ts +0 -49
  170. package/lib/Utils/process-message.js +0 -427
  171. package/lib/Utils/signal.d.ts +0 -42
  172. package/lib/Utils/signal.js +0 -166
  173. package/lib/Utils/use-mongo-file-auth-state.d.ts +0 -6
  174. package/lib/Utils/use-mongo-file-auth-state.js +0 -84
  175. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -18
  176. package/lib/Utils/use-multi-file-auth-state.js +0 -238
  177. package/lib/Utils/use-single-file-auth-state.d.ts +0 -13
  178. package/lib/Utils/use-single-file-auth-state.js +0 -80
  179. package/lib/Utils/validate-connection.d.ts +0 -13
  180. package/lib/Utils/validate-connection.js +0 -220
  181. package/lib/WABinary/constants.d.ts +0 -30
  182. package/lib/WABinary/constants.js +0 -1316
  183. package/lib/WABinary/decode.d.ts +0 -9
  184. package/lib/WABinary/decode.js +0 -288
  185. package/lib/WABinary/encode.d.ts +0 -3
  186. package/lib/WABinary/encode.js +0 -265
  187. package/lib/WABinary/generic-utils.d.ts +0 -28
  188. package/lib/WABinary/generic-utils.js +0 -142
  189. package/lib/WABinary/index.d.ts +0 -5
  190. package/lib/WABinary/index.js +0 -25
  191. package/lib/WABinary/jid-utils.d.ts +0 -58
  192. package/lib/WABinary/jid-utils.js +0 -104
  193. package/lib/WABinary/types.d.ts +0 -22
  194. package/lib/WABinary/types.js +0 -3
  195. package/lib/WAM/BinaryInfo.d.ts +0 -16
  196. package/lib/WAM/BinaryInfo.js +0 -17
  197. package/lib/WAM/constants.d.ts +0 -47
  198. package/lib/WAM/constants.js +0 -15371
  199. package/lib/WAM/encode.d.ts +0 -3
  200. package/lib/WAM/encode.js +0 -164
  201. package/lib/WAM/index.d.ts +0 -3
  202. package/lib/WAM/index.js +0 -23
  203. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +0 -28
  204. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +0 -69
  205. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  206. package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -36
  207. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -26
  208. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -62
  209. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -14
  210. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -35
  211. package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +0 -10
  212. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +0 -38
  213. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -14
  214. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -46
  215. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  216. package/lib/WAUSync/Protocols/index.js +0 -26
  217. package/lib/WAUSync/USyncQuery.d.ts +0 -31
  218. package/lib/WAUSync/USyncQuery.js +0 -92
  219. package/lib/WAUSync/USyncUser.d.ts +0 -12
  220. package/lib/WAUSync/USyncUser.js +0 -30
  221. package/lib/WAUSync/index.d.ts +0 -3
  222. package/lib/WAUSync/index.js +0 -23
  223. package/lib/index.d.ts +0 -13
  224. package/lib/index.js +0 -33
@@ -1,92 +0,0 @@
1
- import { WAMediaUpload } from '@neelegirl/baileys/lib/Types/Message'
2
-
3
- export type CatalogResult = {
4
- data: {
5
- paging: {
6
- cursors: {
7
- before: string
8
- after: string
9
- }
10
- }
11
- data: any[]
12
- }
13
- }
14
-
15
- export type ProductCreateResult = {
16
- data: {
17
- product: {}
18
- }
19
- }
20
-
21
- export type CatalogStatus = {
22
- status: string
23
- canAppeal: boolean
24
- }
25
-
26
- export type CatalogCollection = {
27
- id: string
28
- name: string
29
- products: Product[]
30
- status: CatalogStatus
31
- }
32
-
33
- export type ProductAvailability = 'in stock'
34
-
35
- export type ProductBase = {
36
- name: string
37
- retailerId?: string
38
- url?: string
39
- description: string
40
- price: number
41
- currency: string
42
- isHidden?: boolean
43
- }
44
-
45
- export type ProductCreate = ProductBase & {
46
- /** ISO country code for product origin. Set to undefined for no country */
47
- originCountryCode: string | undefined
48
- /** images of the product */
49
- images: WAMediaUpload[]
50
- }
51
-
52
- export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>
53
-
54
- export type Product = ProductBase & {
55
- id: string
56
- imageUrls: {
57
- [_: string]: string
58
- }
59
- reviewStatus: {
60
- [_: string]: string
61
- }
62
- availability: ProductAvailability
63
- }
64
-
65
- export type OrderPrice = {
66
- currency: string
67
- total: number
68
- }
69
-
70
- export type OrderProduct = {
71
- id: string
72
- imageUrl: string
73
- name: string
74
- quantity: number
75
- currency: string
76
- price: number
77
- }
78
-
79
- export type OrderDetails = {
80
- price: OrderPrice
81
- products: OrderProduct[]
82
- }
83
-
84
- export type CatalogCursor = string
85
-
86
- export type GetCatalogOptions = {
87
- /** cursor to start from */
88
- cursor?: CatalogCursor
89
- /** number of products to fetch */
90
- limit?: number
91
- jid?: string
92
- }
@@ -1,3 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,98 +0,0 @@
1
- import { proto } from '@neelegirl/baileys/WAProto'
2
- import { LIDMappingStore } from '@neelegirl/baileys/lib/Signal/lid-mapping'
3
-
4
- type DecryptGroupSignalOpts = {
5
- group: string
6
- authorJid: string
7
- msg: Uint8Array
8
- }
9
-
10
- type EncryptMessageWithWireOpts = {
11
- encryptionJid: string
12
- wireJid: string
13
- data: Uint8Array
14
- }
15
-
16
- type ProcessSenderKeyDistributionMessageOpts = {
17
- item: proto.Message.ISenderKeyDistributionMessage
18
- authorJid: string
19
- }
20
-
21
- type DecryptSignalProtoOpts = {
22
- jid: string
23
- type: 'pkmsg' | 'msg'
24
- ciphertext: Uint8Array
25
- }
26
-
27
- type EncryptMessageOpts = {
28
- jid: string
29
- data: Uint8Array
30
- }
31
-
32
- type EncryptGroupMessageOpts = {
33
- group: string
34
- data: Uint8Array
35
- meId: string
36
- }
37
-
38
- type PreKey = {
39
- keyId: number
40
- publicKey: Uint8Array
41
- }
42
-
43
- type SignedPreKey = PreKey & {
44
- signature: Uint8Array
45
- }
46
-
47
- type E2ESession = {
48
- registrationId: number
49
- identityKey: Uint8Array
50
- signedPreKey: SignedPreKey
51
- preKey: PreKey
52
- }
53
-
54
- type E2ESessionOpts = {
55
- jid: string
56
- session: E2ESession
57
- }
58
-
59
- export type SignalRepository = {
60
- decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>
61
- processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>
62
- decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>
63
- encryptMessage(opts: EncryptMessageOpts): Promise<{
64
- type: 'pkmsg' | 'msg'
65
- ciphertext: Uint8Array
66
- }>
67
- encryptMessageWithWire(opts: EncryptMessageWithWireOpts): Promise<{
68
- type: 'pkmsg' | 'msg'
69
- ciphertext: Uint8Array
70
- wireJid: string
71
- }>
72
- encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
73
- senderKeyDistributionMessage: Uint8Array
74
- ciphertext: Uint8Array
75
- }>
76
- injectE2ESession(opts: E2ESessionOpts): Promise<void>
77
- validateSession(jid: string): Promise<{
78
- exists: boolean
79
- reason?: string
80
- }>
81
- jidToSignalProtocolAddress(jid: string): string
82
- migrateSession(fromJids: string[], toJid: string): Promise<{
83
- migrated: number
84
- skipped: number
85
- total: number
86
- }>
87
- validateSession(jid: string): Promise<{
88
- exists: boolean
89
- reason?: string
90
- }>
91
- deleteSession(jids: string[]): Promise<void>
92
- }
93
-
94
- export interface SignalRepositoryWithLIDStore extends SignalRepository {
95
- lidMapping: LIDMappingStore
96
- }
97
-
98
- export {}
@@ -1,3 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,141 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios'
2
- import type { Agent } from 'https'
3
- import { ILogger } from '@neelegirl/baileys/lib/Utils/logger'
4
- import type { URL } from 'url'
5
- import { proto } from '@neelegirl/baileys/WAProto'
6
- import { AuthenticationState, SignalAuthState, TransactionCapabilityOptions } from '@neelegirl/baileys/lib/Types/Auth'
7
- import { GroupMetadata } from '@neelegirl/baileys/lib/Types/GroupMetadata'
8
- import { MediaConnInfo } from '@neelegirl/baileys/lib/Types/Message'
9
- import { SignalRepositoryWithLIDStore } from '@neelegirl/baileys/lib/Types/Signal'
10
-
11
- export type WAVersion = [number, number, number]
12
-
13
- export type WABrowserDescription = [string, string, string]
14
-
15
- export type CacheStore = {
16
- /** get a cached key and change the stats */
17
- get<T>(key: string): Promise<T> | T | undefined
18
- /** set a key in the cache */
19
- set<T>(key: string, value: T): Promise<void> | void | number | boolean
20
- /** delete a key from the cache */
21
- del(key: string): void | Promise<void> | number | boolean
22
- /** flush all data */
23
- flushAll(): void | Promise<void>
24
- }
25
-
26
- export type PossiblyExtendedCacheStore = CacheStore & {
27
- mget?: <T>(keys: string[]) => Promise<Record<string, T | undefined>>
28
- mset?: <T>(entries: {
29
- key: string
30
- value: T
31
- }[]) => Promise<void> | void | number | boolean
32
- mdel?: (keys: string[]) => void | Promise<void> | number | boolean
33
- }
34
-
35
- export type PatchedMessageWithRecipientJID = proto.IMessage & {
36
- recipientJid?: string
37
- }
38
-
39
- export type SocketConfig = {
40
- /** the WS url to connect to WA */
41
- waWebSocketUrl: string | URL
42
- /** Fails the connection if the socket times out in this interval */
43
- connectTimeoutMs: number
44
- /** Default timeout for queries, undefined for no timeout */
45
- defaultQueryTimeoutMs: number | undefined
46
- /** ping-pong interval for WS connection */
47
- keepAliveIntervalMs: number
48
- /** should baileys use the mobile api instead of the multi device api
49
- * @deprecated This feature has been removed
50
- */
51
- mobile?: boolean
52
- /** proxy agent */
53
- agent?: Agent
54
- /** logger */
55
- logger: ILogger
56
- /** version to connect with */
57
- version: WAVersion
58
- /** override browser config */
59
- browser: WABrowserDescription
60
- /** agent used for fetch requests -- uploading/downloading media */
61
- fetchAgent?: Agent
62
- /** should the QR be printed in the terminal */
63
- printQRInTerminal: boolean
64
- /** should events be emitted for actions done by this socket connection */
65
- emitOwnEvents: boolean
66
- /** custom upload hosts to upload media to */
67
- customUploadHosts: MediaConnInfo['hosts']
68
- /** time to wait between sending new retry requests */
69
- retryRequestDelayMs: number
70
- /** max retry count */
71
- maxMsgRetryCount: number
72
- /** time to wait for the generation of the next QR in ms */
73
- qrTimeout?: number
74
- /** provide an auth state object to maintain the auth state */
75
- auth: AuthenticationState
76
- /** manage history processing with this control by default will sync up everything */
77
- shouldSyncHistoryMessage: (msg: proto.Message.IHistorySyncNotification) => boolean
78
- /** transaction capability options for SignalKeyStore */
79
- transactionOpts: TransactionCapabilityOptions
80
- /** marks the client as online whenever the socket successfully connects */
81
- markOnlineOnConnect: boolean
82
- /** alphanumeric country code (USA -> US) for the number used */
83
- countryCode: string
84
- /** provide a cache to store media, so does not have to be re-uploaded */
85
- mediaCache?: CacheStore
86
- /**
87
- * map to store the retry counts for failed messages
88
- * used to determine whether to retry a message or not */
89
- msgRetryCounterCache?: CacheStore
90
- /** provide a cache to store a user's device list */
91
- userDevicesCache?: PossiblyExtendedCacheStore
92
- /** cache to store call offers */
93
- callOfferCache?: CacheStore
94
- /** cache to track placeholder resends */
95
- placeholderResendCache?: CacheStore
96
- /** width for link preview images */
97
- linkPreviewImageThumbnailWidth: number
98
- /** Should Baileys ask the phone for full history, will be received async */
99
- syncFullHistory: boolean
100
- /** Should baileys fire init queries automatically, default true */
101
- fireInitQueries: boolean
102
- /**
103
- * generate a high quality link preview,
104
- * entails uploading the jpegThumbnail to WA
105
- * */
106
- generateHighQualityLinkPreview: boolean
107
- /** Enable automatic session recreation for failed messages */
108
- enableAutoSessionRecreation: boolean
109
- /** Enable recent message caching for retry handling */
110
- enableRecentMessageCache: boolean
111
- /**
112
- * Returns if a jid should be ignored,
113
- * no event for that jid will be triggered.
114
- * Messages from that jid will also not be decrypted
115
- * */
116
- shouldIgnoreJid: (jid: string) => boolean | undefined
117
- /**
118
- * Optionally patch the message before sending out
119
- * */
120
- patchMessageBeforeSending: (msg: proto.IMessage, recipientJids?: string[]) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID
121
- /** verify app state MACs */
122
- appStateMacVerification: {
123
- patch: boolean
124
- snapshot: boolean
125
- }
126
- /** options for axios */
127
- options: AxiosRequestConfig<{}>
128
- /**
129
- * fetch a message from your store
130
- * implement this so that messages failed to send
131
- * (solves the "this message can take a while" issue) can be retried
132
- * */
133
- getMessage: (key: proto.IMessageKey) => Promise<proto.IMessage | undefined>
134
- /** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
135
- cachedGroupMetadata: (jid: string) => Promise<GroupMetadata | undefined>
136
- makeSignalRepository: (auth: SignalAuthState, onWhatsAppFunc?: (...jids: string[]) => Promise<{
137
- jid: string
138
- exists: boolean
139
- lid: string
140
- }[] | undefined>) => SignalRepositoryWithLIDStore
141
- }
@@ -1,3 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,41 +0,0 @@
1
- import { Boom } from '@hapi/boom'
2
- import { Contact } from '@neelegirl/baileys/lib/Types/Contact'
3
-
4
- export declare const enum SyncState {
5
- /** The socket is connecting, but we haven't received pending notifications yet. */
6
- Connecting = 0,
7
- /** Pending notifications received. Buffering events until we decide whether to sync or not. */
8
- AwaitingInitialSync = 1,
9
- /** The initial app state sync (history, etc.) is in progress. Buffering continues. */
10
- Syncing = 2,
11
- /** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
12
- Online = 3
13
- }
14
-
15
- export type WAConnectionState = 'open' | 'connecting' | 'close'
16
-
17
- export type ConnectionState = {
18
- /** connection is now open, connecting or closed */
19
- connection: WAConnectionState
20
- /** the error that caused the connection to close */
21
- lastDisconnect?: {
22
- error: Boom | Error | undefined
23
- date: Date
24
- }
25
- /** is this a new login */
26
- isNewLogin?: boolean
27
- /** the current QR code */
28
- qr?: string
29
- /** has the device received all pending notifications while it was offline */
30
- receivedPendingNotifications?: boolean
31
- /** legacy connection options */
32
- legacy?: {
33
- phoneConnected: boolean
34
- user?: Contact
35
- }
36
- /**
37
- * if the client is shown as an active, online client.
38
- * If this is false, the primary phone and other devices will receive notifs
39
- * */
40
- isOnline?: boolean
41
- }
@@ -1,14 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
4
-
5
- const SyncState = {
6
- Connecting: 0,
7
- AwaitingInitialSync: 1,
8
- Syncing: 2,
9
- Online: 3
10
- }
11
-
12
- module.exports = {
13
- SyncState
14
- }
@@ -1,26 +0,0 @@
1
- import { BinaryNode } from '@neelegirl/baileys/lib/WABinary'
2
- import { USyncUser } from '@neelegirl/baileys/lib/WAUSync'
3
-
4
- /**
5
- * Defines the interface for a USyncQuery protocol
6
- */
7
- export interface USyncQueryProtocol {
8
- /**
9
- * The name of the protocol
10
- */
11
- name: string
12
- /**
13
- * Defines what goes inside the query part of a USyncQuery
14
- */
15
- getQueryElement: () => BinaryNode
16
- /**
17
- * Defines what goes inside the user part of a USyncQuery
18
- */
19
- getUserElement: (user: USyncUser) => BinaryNode | null
20
- /**
21
- * Parse the result of the query
22
- * @param data Data from the result
23
- * @returns Whatever the protocol is supposed to return
24
- */
25
- parser: (data: BinaryNode) => unknown
26
- }
@@ -1,3 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,80 +0,0 @@
1
- export * from '@neelegirl/baileys/lib/Types/Auth'
2
- export * from '@neelegirl/baileys/lib/Types/Bussines'
3
- export * from '@neelegirl/baileys/lib/Types/Chat'
4
- export * from '@neelegirl/baileys/lib/Types/Contact'
5
- export * from '@neelegirl/baileys/lib/Types/GroupMetadata'
6
- export * from '@neelegirl/baileys/lib/Types/State'
7
- export * from '@neelegirl/baileys/lib/Types/MexUpdates'
8
- export * from '@neelegirl/baileys/lib/Types/Message'
9
- export * from '@neelegirl/baileys/lib/Types/Newsletter'
10
- export * from '@neelegirl/baileys/lib/Types/Socket'
11
- export * from '@neelegirl/baileys/lib/Types/Events'
12
- export * from '@neelegirl/baileys/lib/Types/Product'
13
- export * from '@neelegirl/baileys/lib/Types/Call'
14
- export * from '@neelegirl/baileys/lib/Types/Signal'
15
-
16
- import { AuthenticationState } from '@neelegirl/baileys/lib/Types/Auth'
17
- import { SocketConfig } from '@neelegirl/baileys/lib/Types/Socket'
18
-
19
- export type UserFacingSocketConfig = Partial<SocketConfig> & {
20
- auth: AuthenticationState
21
- }
22
-
23
- export type BrowsersMap = {
24
- ubuntu(browser: string): [string, string, string]
25
- macOS(browser: string): [string, string, string]
26
- windows(browser: string): [string, string, string]
27
- linux(browser: string): [string, string, string]
28
- android(browser: string): [string, string, string]
29
- iOS(browser: string): [string, string, string]
30
- baileys(browser: string): [string, string, string]
31
- kaiOS(browser: string): [string, string, string]
32
- chromeOS(browser: string): [string, string, string]
33
- appropriate(browser: string): [string, string, string]
34
- custom(platform: string, browser: string, version: string): [string, string, string]
35
- }
36
-
37
- export declare const enum DisconnectReason {
38
- connectionClosed = 428,
39
- connectionLost = 408,
40
- connectionReplaced = 440,
41
- timedOut = 408,
42
- loggedOut = 401,
43
- badSession = 500,
44
- restartRequired = 515,
45
- multideviceMismatch = 411,
46
- forbidden = 403,
47
- unavailableService = 503
48
- }
49
-
50
- export type WAInitResponse = {
51
- ref: string
52
- ttl: number
53
- status: 200
54
- }
55
-
56
- export type WABusinessHoursConfig = {
57
- day_of_week: string
58
- mode: string
59
- open_time?: number
60
- close_time?: number
61
- }
62
-
63
- export type WABusinessProfile = {
64
- description: string
65
- email: string | undefined
66
- business_hours: {
67
- timezone?: string
68
- config?: WABusinessHoursConfig[]
69
- business_config?: WABusinessHoursConfig[]
70
- }
71
- website: string[]
72
- category?: string
73
- wid?: string
74
- address?: string
75
- }
76
-
77
- export type CurveKeyPair = {
78
- private: Uint8Array
79
- public: Uint8Array
80
- }
@@ -1,50 +0,0 @@
1
- "use strict"
2
-
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k
5
- var desc = Object.getOwnPropertyDescriptor(m, k)
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k] } }
8
- }
9
- Object.defineProperty(o, k2, desc)
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k
12
- o[k2] = m[k]
13
- }))
14
-
15
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
17
- }
18
-
19
- Object.defineProperty(exports, "__esModule", { value: true })
20
-
21
- exports.DisconnectReason = void 0
22
- __exportStar(require("./Auth"), exports)
23
- __exportStar(require("./Bussines"), exports)
24
- __exportStar(require("./Chat"), exports)
25
- __exportStar(require("./Contact"), exports)
26
- __exportStar(require("./GroupMetadata"), exports)
27
- __exportStar(require("./State"), exports)
28
- __exportStar(require("./MexUpdates"), exports)
29
- __exportStar(require("./Message"), exports)
30
- __exportStar(require("./Newsletter"), exports)
31
- __exportStar(require("./Socket"), exports)
32
- __exportStar(require("./Events"), exports)
33
- __exportStar(require("./Product"), exports)
34
- __exportStar(require("./Call"), exports)
35
- __exportStar(require("./Signal"), exports)
36
-
37
- const DisconnectReason = {
38
- connectionClosed: 428,
39
- connectionLost: 408,
40
- connectionReplaced: 440,
41
- timedOut: 408,
42
- loggedOut: 401,
43
- badSession: 500,
44
- restartRequired: 515,
45
- multideviceMismatch: 411,
46
- forbidden: 403,
47
- unavailableService: 503
48
- }
49
-
50
- exports.DisconnectReason = DisconnectReason
@@ -1,21 +0,0 @@
1
- import type { AuthenticationCreds, CacheStore, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '@neelegirl/baileys/lib/Types'
2
- import { ILogger } from '@neelegirl/baileys/lib/Utils/logger'
3
-
4
- /**
5
- * Adds caching capability to a SignalKeyStore
6
- * @param store the store to add caching to
7
- * @param logger to log trace events
8
- * @param _cache cache store to use
9
- */
10
- export declare function makeCacheableSignalKeyStore(store: SignalKeyStore, logger?: ILogger, _cache?: CacheStore): SignalKeyStore
11
-
12
- /**
13
- * Adds DB like transaction capability (https://en.wikipedia.org/wiki/Database_transaction) to the SignalKeyStore,
14
- * this allows batch read & write operations & improves the performance of the lib
15
- * @param state the key store to apply this capability to
16
- * @param logger logger to log events
17
- * @returns SignalKeyStore with transaction capability
18
- */
19
- export declare const addTransactionCapability: (state: SignalKeyStore, logger?: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions) => SignalKeyStoreWithTransaction
20
-
21
- export declare const initAuthCreds: () => AuthenticationCreds