nexus-fca 1.0.0

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 (180) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/DOCS.md +2047 -0
  3. package/Fca_Database/database.sqlite +0 -0
  4. package/LICENSE-MIT +21 -0
  5. package/README.md +240 -0
  6. package/docs/README.md +9 -0
  7. package/docs/addExternalModule.md +15 -0
  8. package/docs/addUserToGroup.md +20 -0
  9. package/docs/changeAdminStatus.md +21 -0
  10. package/docs/changeArchivedStatus.md +19 -0
  11. package/docs/changeAvatar.md +21 -0
  12. package/docs/changeAvatarV2.md +18 -0
  13. package/docs/changeBio.md +15 -0
  14. package/docs/changeBlockedStatus.md +16 -0
  15. package/docs/changeBlockedStatusMqtt.md +16 -0
  16. package/docs/changeCover.md +15 -0
  17. package/docs/changeGroupImage.md +16 -0
  18. package/docs/changeName.md +18 -0
  19. package/docs/changeNickname.md +17 -0
  20. package/docs/changeThreadColor.md +16 -0
  21. package/docs/changeThreadEmoji.md +16 -0
  22. package/docs/changeUsername.md +15 -0
  23. package/docs/createCommentPost.md +16 -0
  24. package/docs/createNewGroup.md +16 -0
  25. package/docs/createPoll.md +17 -0
  26. package/docs/createPost.md +15 -0
  27. package/docs/deleteMessage.md +15 -0
  28. package/docs/deleteThread.md +15 -0
  29. package/docs/editMessage.md +16 -0
  30. package/docs/follow.md +15 -0
  31. package/docs/forwardAttachment.md +16 -0
  32. package/docs/getAccess.md +17 -0
  33. package/docs/getAvatarUser.md +15 -0
  34. package/docs/getBotInitialData.md +14 -0
  35. package/docs/getCtx.md +14 -0
  36. package/docs/getCurrentUserID.md +12 -0
  37. package/docs/getEmojiUrl.md +17 -0
  38. package/docs/getFriendsList.md +14 -0
  39. package/docs/getMessage.md +15 -0
  40. package/docs/getOptions.md +14 -0
  41. package/docs/getRegion.md +14 -0
  42. package/docs/getThreadHistory.md +17 -0
  43. package/docs/getThreadHistoryDeprecated.md +17 -0
  44. package/docs/getThreadInfo.md +15 -0
  45. package/docs/getThreadInfoDeprecated.md +17 -0
  46. package/docs/getThreadList.md +17 -0
  47. package/docs/getThreadListDeprecated.md +17 -0
  48. package/docs/getThreadPictures.md +17 -0
  49. package/docs/getUID.md +15 -0
  50. package/docs/getUserID.md +15 -0
  51. package/docs/getUserInfo.md +15 -0
  52. package/docs/handleFriendRequest.md +16 -0
  53. package/docs/handleMessageRequest.md +16 -0
  54. package/docs/httpGet.md +15 -0
  55. package/docs/httpPost.md +16 -0
  56. package/docs/httpPostFormData.md +16 -0
  57. package/docs/listenMqtt.md +17 -0
  58. package/docs/listenNotification.md +14 -0
  59. package/docs/logout.md +14 -0
  60. package/docs/markAsDelivered.md +16 -0
  61. package/docs/markAsRead.md +16 -0
  62. package/docs/markAsReadAll.md +14 -0
  63. package/docs/markAsSeen.md +15 -0
  64. package/docs/muteThread.md +16 -0
  65. package/docs/pinMessage.md +17 -0
  66. package/docs/postFormData.md +16 -0
  67. package/docs/refreshFb_dtsg.md +14 -0
  68. package/docs/removeUserFromGroup.md +16 -0
  69. package/docs/resolvePhotoUrl.md +15 -0
  70. package/docs/searchForThread.md +15 -0
  71. package/docs/searchStickers.md +15 -0
  72. package/docs/sendComment.md +16 -0
  73. package/docs/sendMessage.md +16 -0
  74. package/docs/sendMessageMqtt.md +16 -0
  75. package/docs/sendTypingIndicator.md +15 -0
  76. package/docs/setMessageReaction.md +17 -0
  77. package/docs/setMessageReactionMqtt.md +16 -0
  78. package/docs/setPostReaction.md +16 -0
  79. package/docs/setProfileGuard.md +15 -0
  80. package/docs/setStoryReaction.md +16 -0
  81. package/docs/setTitle.md +16 -0
  82. package/docs/shareContact.md +16 -0
  83. package/docs/shareLink.md +16 -0
  84. package/docs/stopListenMqtt.md +8 -0
  85. package/docs/threadColors.md +11 -0
  86. package/docs/unfriend.md +15 -0
  87. package/docs/unsendMessage.md +15 -0
  88. package/docs/uploadAttachment.md +15 -0
  89. package/fca-config.json +7 -0
  90. package/index.d.ts +618 -0
  91. package/index.js +361 -0
  92. package/lib/database/models/index.js +47 -0
  93. package/lib/database/models/thread.js +31 -0
  94. package/lib/database/threadData.js +93 -0
  95. package/lib/logger.js +24 -0
  96. package/lib/login.js +0 -0
  97. package/package.json +90 -0
  98. package/src/addExternalModule.js +19 -0
  99. package/src/addUserToGroup.js +113 -0
  100. package/src/changeAdminStatus.js +79 -0
  101. package/src/changeArchivedStatus.js +55 -0
  102. package/src/changeAvatar.js +126 -0
  103. package/src/changeAvatarV2.js +77 -0
  104. package/src/changeBio.js +77 -0
  105. package/src/changeBlockedStatus.js +47 -0
  106. package/src/changeBlockedStatusMqtt.js +71 -0
  107. package/src/changeCover.js +72 -0
  108. package/src/changeGroupImage.js +132 -0
  109. package/src/changeName.js +79 -0
  110. package/src/changeNickname.js +59 -0
  111. package/src/changeThreadColor.js +65 -0
  112. package/src/changeThreadEmoji.js +55 -0
  113. package/src/changeUsername.js +58 -0
  114. package/src/createCommentPost.js +225 -0
  115. package/src/createNewGroup.js +86 -0
  116. package/src/createPoll.js +71 -0
  117. package/src/createPost.js +276 -0
  118. package/src/deleteMessage.js +56 -0
  119. package/src/deleteThread.js +56 -0
  120. package/src/editMessage.js +57 -0
  121. package/src/follow.js +54 -0
  122. package/src/forwardAttachment.js +60 -0
  123. package/src/getAccess.js +67 -0
  124. package/src/getAvatarUser.js +56 -0
  125. package/src/getBotInitialData.js +37 -0
  126. package/src/getCtx.js +6 -0
  127. package/src/getCurrentUserID.js +7 -0
  128. package/src/getEmojiUrl.js +29 -0
  129. package/src/getFriendsList.js +83 -0
  130. package/src/getMessage.js +796 -0
  131. package/src/getOptions.js +6 -0
  132. package/src/getRegion.js +8 -0
  133. package/src/getThreadHistory.js +666 -0
  134. package/src/getThreadHistoryDeprecated.js +55 -0
  135. package/src/getThreadInfo.js +535 -0
  136. package/src/getThreadInfoDeprecated.js +49 -0
  137. package/src/getThreadList.js +192 -0
  138. package/src/getThreadListDeprecated.js +54 -0
  139. package/src/getThreadPictures.js +79 -0
  140. package/src/getUID.js +67 -0
  141. package/src/getUserID.js +66 -0
  142. package/src/getUserInfo.js +80 -0
  143. package/src/handleFriendRequest.js +61 -0
  144. package/src/handleMessageRequest.js +65 -0
  145. package/src/httpGet.js +57 -0
  146. package/src/httpPost.js +57 -0
  147. package/src/httpPostFormData.js +63 -0
  148. package/src/listenMqtt.js +1039 -0
  149. package/src/listenNotification.js +65 -0
  150. package/src/logout.js +75 -0
  151. package/src/markAsDelivered.js +58 -0
  152. package/src/markAsRead.js +80 -0
  153. package/src/markAsReadAll.js +50 -0
  154. package/src/markAsSeen.js +59 -0
  155. package/src/muteThread.js +52 -0
  156. package/src/pinMessage.js +59 -0
  157. package/src/postFormData.js +46 -0
  158. package/src/refreshFb_dtsg.js +66 -0
  159. package/src/removeUserFromGroup.js +79 -0
  160. package/src/resolvePhotoUrl.js +45 -0
  161. package/src/searchForThread.js +53 -0
  162. package/src/searchStickers.js +51 -0
  163. package/src/sendComment.js +63 -0
  164. package/src/sendMessage.js +328 -0
  165. package/src/sendMessageMqtt.js +316 -0
  166. package/src/sendTypingIndicator.js +103 -0
  167. package/src/setMessageReaction.js +119 -0
  168. package/src/setMessageReactionMqtt.js +61 -0
  169. package/src/setPostReaction.js +109 -0
  170. package/src/setProfileGuard.js +45 -0
  171. package/src/setStoryReaction.js +62 -0
  172. package/src/setTitle.js +86 -0
  173. package/src/shareContact.js +49 -0
  174. package/src/shareLink.js +59 -0
  175. package/src/stopListenMqtt.js +21 -0
  176. package/src/threadColors.js +131 -0
  177. package/src/unfriend.js +52 -0
  178. package/src/unsendMessage.js +49 -0
  179. package/src/uploadAttachment.js +95 -0
  180. package/utils.js +1432 -0
package/index.d.ts ADDED
@@ -0,0 +1,618 @@
1
+ // Origin: NOCOM-BOT/mod_fbmsg_legacy
2
+
3
+ declare module '@dongdev/fca-unofficial' {
4
+ import type { Readable, Duplex, Transform } from "stream";
5
+ import type EventEmitter from "events";
6
+
7
+ type ReadableStream = Readable | Duplex | Transform;
8
+ function login(credentials: Partial<{
9
+ email: string,
10
+ password: string,
11
+ appState: AppstateData
12
+ }>, options: Partial<IFCAU_Options>, callback: (err: Error | null, api: IFCAU_API) => void): void;
13
+ function login(credentials: Partial<{
14
+ email: string,
15
+ password: string,
16
+ appState: AppstateData
17
+ }>, options: Partial<IFCAU_Options>): Promise<IFCAU_API>;
18
+ function login(credentials: Partial<{
19
+ email: string,
20
+ password: string,
21
+ appState: AppstateData
22
+ }>, callback: (err: Error | null, api: IFCAU_API) => void): void;
23
+ function login(credentials: Partial<{
24
+ email: string,
25
+ password: string,
26
+ appState: AppstateData
27
+ }>): Promise<IFCAU_API>;
28
+
29
+ export default login;
30
+
31
+ export type Cookie = {
32
+ key: string,
33
+ value: string,
34
+ domain: string,
35
+ path?: string,
36
+ hostOnly?: boolean,
37
+ creation?: string,
38
+ lastAccessed?: string
39
+ }
40
+
41
+ export type AppstateData = {
42
+ appState: Cookie[]
43
+ }
44
+
45
+ export type MessageObject = {
46
+ body: string,
47
+ sticker?: string,
48
+ attachment?: ReadableStream | ReadableStream[],
49
+ url?: string,
50
+ emoji?: string,
51
+ emojiSize?: string,
52
+ mentions?: {
53
+ tag: string,
54
+ id: string,
55
+ fromIndex?: number
56
+ }[],
57
+ location?: {
58
+ latitude: number,
59
+ longitude: number,
60
+ current?: boolean
61
+ }
62
+ }
63
+
64
+ function sendMessage(
65
+ message: string | MessageObject,
66
+ threadID: string | string[],
67
+ callback?: (err?: Error, data?: { threadID: string, messageID: string, timestamp: number }) => void,
68
+ replyMessageID?: string,
69
+ isGroup?: boolean
70
+ ): Promise<{ threadID: string, messageID: string, timestamp: number }>;
71
+ function sendMessage(
72
+ message: string | MessageObject,
73
+ threadID: string | string[],
74
+ replyMessageID?: string,
75
+ isGroup?: boolean
76
+ ): Promise<{ threadID: string, messageID: string, timestamp: number }>;
77
+
78
+ export type IFCAU_API = {
79
+ addUserToGroup: (userID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
80
+ changeAdminStatus: (threadID: string, adminIDs: string | string[], adminStatus: boolean, callback?: (err?: Error) => void) => Promise<void>,
81
+ changeApprovalMode: (approvalMode: 0 | 1, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
82
+ changeArchivedStatus: (threadOrThreads: string | string[], archive: boolean, callback?: (err?: Error) => void) => Promise<void>,
83
+ changeBlockedStatus: (userID: string, blocked: boolean, callback?: (err?: Error) => void) => Promise<void>,
84
+ changeBlockedStatusMqtt: (userID: string, status: boolean, type: string?, callback?: (err?: Error) => void) => Promise<void>,
85
+ changeGroupImage: (image: ReadableStream, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
86
+ changeNickname: (nickname: string, threadID: string, pariticipantID: string, callback?: (err?: Error) => void) => Promise<void>,
87
+ changeThreadColor: (color: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
88
+ changeThreadEmoji: (emoji: string | null, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
89
+ createNewGroup: (participantIDs: string[], groupTitle?: string, callback?: (err: Error, threadID: string) => void) => Promise<string>,
90
+ createPoll: (title: string, threadID: string, options?: { [item: string]: boolean }, callback?: (err?: Error) => void) => Promise<void>,
91
+ createPollMqtt: (title: string, options?: { [item: string]: boolean }, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
92
+ deleteMessage: (messageOrMessages: string | string[], callback?: (err?: Error) => void) => Promise<void>,
93
+ deleteThread: (threadOrThreads: string | string[], callback?: (err?: Error) => void) => Promise<void>,
94
+ editMessage: (text: string, messageID: string, callback?: (err?: Error) => void) => Promise<void>,
95
+ forwardAttachment: (attachmentID: string, userOrUsers: string | string[], callback?: (err?: Error) => void) => Promise<void>,
96
+ forwardMessage: (messageID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
97
+ getAppState: () => any,
98
+ getCurrentUserID: () => string,
99
+ getEmojiUrl: (c: string, size: number, pixelRatio: number) => string,
100
+ getFriendsList: (callback?: (err: Error | null, friends: IFCAU_Friend[]) => void) => Promise<IFCAU_Friend[]>,
101
+ getThreadHistory: (threadID: string, amount: number, time?: number, callback?: (err: Error | null, messages: any[]) => void) => Promise<any[]>,
102
+ getThreadInfo: (threadID: string, callback?: (err: Error | null, thread: IFCAU_Thread) => void) => Promise<IFCAU_Thread>,
103
+ getThreadList: (limit: number, timestamp: number | null, tags: string[], callback?: (err: Error | null, threads: IFCAU_ThreadList) => void) => Promise<IFCAU_ThreadList>,
104
+ getThreadPictures: (threadID: string, offset: number, limit: number, callback?: (err: Error | null, pictures: string[]) => void) => Promise<string[]>,
105
+ getUserID: (name: string, callback?: (err: Error | null, obj: IFCAU_UserIDResponse) => void) => Promise<IFCAU_UserIDResponse>,
106
+ getUserInfo: (userOrUsers: string | string[], callback?: (err: Error | null, users: { [id: string]: IFCAU_User }) => void) => Promise<{ [id: string]: IFCAU_User }>,
107
+ threadColors: {
108
+ [color: string]: string
109
+ },
110
+ handleMessageRequest(threadOrThreads: string | string[], accept: boolean, callback: (err?: Error) => void): Promise<void>;
111
+ listen(callback?: (err: Error | null, message: IFCAU_ListenMessage) => void): EventEmitter;
112
+ listenMqtt(callback?: (err: Error | null, message: IFCAU_ListenMessage) => void): EventEmitter & { stopListening: (callback?: () => void) => void };
113
+ logout: (callback?: (err?: Error) => void) => Promise<void>,
114
+ markAsDelivered(threadID: string, messageID: string, callback?: (err?: Error) => void): Promise<void>,
115
+ markAsRead(threadID: string, read?: boolean, callback?: (err?: Error) => void): Promise<void>,
116
+ markAsReadAll: (callback?: (err?: Error) => void) => Promise<void>,
117
+ markAsSeen(seenTimestamp?: number, callback?: (err?: Error) => void): Promise<void>,
118
+ muteThread: (threadID: string, muteSeconds: number, callback?: (err?: Error) => void) => Promise<void>,
119
+ pinMessage: (pinMode: boolean, messageID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
120
+ removeUserFromGroup: (userID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
121
+ resolvePhotoUrl: (photoID: string, callback?: (err: Error | null, url: string) => void) => Promise<string>,
122
+ sendMessage: typeof sendMessage,
123
+ sendTypingIndicator: (threadID: string, callback?: (err?: Error) => void) => Promise<void>,
124
+ sendTypingIndicatorMqtt: (isTyping: boolean, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
125
+ setMessageReaction: (reaction: string, messageID: string, callback?: (err?: Error) => void, forceCustomReaction?: boolean) => Promise<void>,
126
+ setMessageReactionMqtt: (reaction: string, messageID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
127
+ setOptions: (options: Partial<IFCAU_Options>) => void,
128
+ setTitle: (newTitle: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
129
+ setTheme: (themeID?: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
130
+ unsendMessage: (messageID: string, callback?: (err?: Error) => void) => Promise<void>,
131
+ unsendMessageMqtt: (messageID: string, threadID: string, callback?: (err?: Error) => void) => Promise<void>,
132
+ }
133
+
134
+ export type IFCAU_ListenMessage =
135
+ {
136
+ type: "message",
137
+ attachments: IFCAU_Attachment[],
138
+ args: string[],
139
+ body: string,
140
+ isGroup: boolean,
141
+ mentions: { [id: string]: string },
142
+ messageID: string,
143
+ senderID: string,
144
+ threadID: string,
145
+ isUnread: boolean,
146
+ participantIDs: string[]
147
+ } |
148
+ {
149
+ type: "event",
150
+ author: string,
151
+ logMessageBody: string,
152
+ logMessageData: {
153
+ image: {
154
+ attachmentID: string,
155
+ width: number,
156
+ height: number,
157
+ url: string
158
+ }
159
+ },
160
+ logMessageType: "log:thread-image",
161
+ threadID: string
162
+ } |
163
+ {
164
+ type: "event",
165
+ author: string,
166
+ logMessageBody: string,
167
+ logMessageData: {
168
+ addedParticipants: {
169
+ fanoutPolicy: string,
170
+ firstName: string,
171
+ fullName: string,
172
+ groupJoinStatus: string,
173
+ initialFolder: string,
174
+ initialFolderId: {
175
+ systemFolderId: string,
176
+ },
177
+ lastUnsubscribeTimestampMs: string,
178
+ userFbId: string,
179
+ isMessengerUser: boolean
180
+ }[],
181
+ },
182
+ logMessageType: "log:subscribe",
183
+ threadID: string,
184
+ participantIDs: string[]
185
+ } |
186
+ {
187
+ type: "event",
188
+ author: string,
189
+ logMessageBody: string,
190
+ logMessageData: { leftParticipantFbId: string },
191
+ logMessageType: "log:unsubscribe",
192
+ threadID: string,
193
+ participantIDs: string[]
194
+ } |
195
+ {
196
+ type: "event",
197
+ author: string,
198
+ logMessageBody: string,
199
+ logMessageData: { name: string },
200
+ logMessageType: "log:thread-name",
201
+ threadID: string,
202
+ participantIDs: string[]
203
+ } |
204
+ {
205
+ type: "event",
206
+ author: string,
207
+ logMessageBody: string,
208
+ logMessageData: {
209
+ theme_color: string,
210
+ gradient?: string,
211
+ should_show_icon: string,
212
+ theme_id: string,
213
+ accessibility_label: string,
214
+ theme_name_with_subtitle: string,
215
+ theme_emoji?: string
216
+ },
217
+ logMessageType: "log:thread-color",
218
+ threadID: string,
219
+ participantIDs: string[]
220
+ } |
221
+ {
222
+ type: "event",
223
+ author: string,
224
+ logMessageBody: string,
225
+ logMessageData: {
226
+ thread_quick_reaction_instruction_key_id: string,
227
+ thread_quick_reaction_emoji: string,
228
+ thread_quick_reaction_emoji_url: string
229
+ },
230
+ logMessageType: "log:thread-icon",
231
+ threadID: string,
232
+ participantIDs: string[]
233
+ } |
234
+ {
235
+ type: "event",
236
+ author: string,
237
+ logMessageBody: string,
238
+ logMessageData: {
239
+ nickname: string,
240
+ participant_id: string
241
+ },
242
+ logMessageType: "log:user-nickname",
243
+ threadID: string,
244
+ participantIDs: string[]
245
+ } |
246
+ {
247
+ type: "event",
248
+ author: string,
249
+ logMessageBody: string,
250
+ logMessageData: {
251
+ THREAD_CATEGORY: string,
252
+ TARGET_ID: string,
253
+ ADMIN_TYPE: string,
254
+ ADMIN_EVENT: 'add_admin' | 'remove_admin'
255
+ },
256
+ logMessageType: "log:thread-admins",
257
+ threadID: string,
258
+ participantIDs: string[]
259
+ } |
260
+ {
261
+ type: "event",
262
+ author: string,
263
+ logMessageBody: string,
264
+ logMessageData: {
265
+ removed_option_ids: string,
266
+ question_json: string,
267
+ event_type: 'question_creation' | 'update_vote' | 'add_unvoted_option' | 'multiple_updates',
268
+ added_option_ids: string,
269
+ new_option_texts: string,
270
+ new_option_ids: string,
271
+ question_id: string,
272
+ },
273
+ logMessageType: "log:thread-poll",
274
+ threadID: string,
275
+ participantIDs: string[]
276
+ } |
277
+ {
278
+ type: "event",
279
+ author: string,
280
+ logMessageBody: string,
281
+ logMessageData: { APPROVAL_MODE: '0' | '1', THREAD_CATEGORY: string },
282
+ logMessageType: "log:thread-approval-mode",
283
+ threadID: string,
284
+ participantIDs: string[]
285
+ } |
286
+ {
287
+ type: "event",
288
+ author: string,
289
+ logMessageBody: string,
290
+ logMessageData: any,
291
+ logMessageType: "log:thread-call",
292
+ threadID: string,
293
+ participantIDs: string[]
294
+ } |
295
+ {
296
+ type: "typ",
297
+ from: string,
298
+ fromMobile: boolean,
299
+ isTyping: boolean,
300
+ threadID: string
301
+ } |
302
+ {
303
+ type: "read",
304
+ threadID: string,
305
+ time: number,
306
+ } |
307
+ {
308
+ type: "read_receipt",
309
+ reader: string,
310
+ threadID: string,
311
+ time: number
312
+ } | {
313
+ type: "message_reaction",
314
+ threadID: string,
315
+ messageID: string,
316
+ reaction: string,
317
+ senderID: string,
318
+ userID: string,
319
+ reactionTimestamp: number
320
+ } | {
321
+ type: "presence",
322
+ statuses: number,
323
+ timestamp: number,
324
+ userID: string
325
+ } | {
326
+ type: "message_unsend",
327
+ threadID: string,
328
+ senderID: string,
329
+ messageID: string,
330
+ deletionnTimestamp: number
331
+ } | {
332
+ type: "message_reply"
333
+ attachments: IFCAU_Attachment[],
334
+ args: string[],
335
+ body: string,
336
+ isGroup: boolean,
337
+ mentions: { [id: string]: string },
338
+ messageID: string,
339
+ senderID: string,
340
+ threadID: string,
341
+ isUnread: boolean,
342
+ participantIDs: string[],
343
+ messageReply: {
344
+ attachments: IFCAU_Attachment[],
345
+ body: string,
346
+ isGroup: boolean,
347
+ mentions: { [id: string]: string },
348
+ messageID: string,
349
+ senderID: string,
350
+ threadID: string,
351
+ isUnread: boolean
352
+ }
353
+ };
354
+
355
+ export type IFCAU_Attachment =
356
+ {
357
+ type: "sticker",
358
+ ID: string,
359
+ url: string,
360
+ packID: string,
361
+ spriteUrl: string,
362
+ spriteUrl2x: string,
363
+ width: number,
364
+ height: number,
365
+ caption: string,
366
+ description: string,
367
+ frameCount: number,
368
+ frameRate: number,
369
+ framesPerRow: number,
370
+ framesPerCol: number
371
+ } |
372
+ {
373
+ type: "file",
374
+ ID: string,
375
+ filename: string,
376
+ url: string,
377
+ isMalicious: boolean,
378
+ contentType: string
379
+ } |
380
+ {
381
+ type: "photo",
382
+ ID: string,
383
+ filename: string,
384
+ thumbnailUrl: string,
385
+ previewUrl: string,
386
+ previewWidth: number,
387
+ previewHeight: number,
388
+ largePreviewUrl: string,
389
+ largePreviewWidth: number,
390
+ largePreviewHeight: number,
391
+ url: string,
392
+ width: number,
393
+ height: number
394
+ } |
395
+ {
396
+ type: "animated_image",
397
+ ID: string,
398
+ filename: string,
399
+ previewUrl: string,
400
+ previewWidth: number,
401
+ previewHeight: number,
402
+ url: string,
403
+ width: number,
404
+ height: number
405
+ } |
406
+ {
407
+ type: "video",
408
+ ID: string,
409
+ filename: string,
410
+ previewUrl: string,
411
+ previewWidth: number,
412
+ previewHeight: number,
413
+ url: string,
414
+ width: number,
415
+ height: number
416
+ duration: number,
417
+ videoType: string
418
+ } |
419
+ {
420
+ type: "audio",
421
+ ID: string,
422
+ filename: string,
423
+ audioType: string,
424
+ duration: number,
425
+ url: string,
426
+ isVoiceMail: boolean
427
+ } |
428
+ {
429
+ type: "location",
430
+ ID: string,
431
+ latitude: number,
432
+ longitude: number,
433
+ image: string,
434
+ width: number,
435
+ height: number,
436
+ url: string,
437
+ address: string
438
+ } |
439
+ {
440
+ type: "share",
441
+ ID: string,
442
+ url: string,
443
+ title: string,
444
+ description: string,
445
+ source: string,
446
+ image: string,
447
+ width: number,
448
+ height: number,
449
+ playable: boolean,
450
+ duration: number,
451
+ playableUrl: string,
452
+ subattachments: any,
453
+ properties: any
454
+ }
455
+
456
+ export type IFCAU_User = {
457
+ name: string,
458
+ firstName?: string,
459
+ vanity?: string,
460
+ thumbSrc: string,
461
+ profileUrl: string | null,
462
+ gender?: number,
463
+ type: string,
464
+ isFriend?: boolean,
465
+ isBirthday: boolean,
466
+ searchToken: any,
467
+ alternateName?: string
468
+ }
469
+
470
+ export type IFCAU_UserIDResponse = {
471
+ userID: string,
472
+ photoUrl: string,
473
+ indexRank: number,
474
+ name: string,
475
+ isVerified: boolean,
476
+ profileUrl: string,
477
+ category: string,
478
+ score: number,
479
+ type: string
480
+ }[];
481
+
482
+ export type IFCAU_Options = {
483
+ pauseLog: boolean,
484
+ logLevel: "silly" | "verbose" | "info" | "http" | "warn" | "error" | "silent",
485
+ selfListen: boolean,
486
+ listenEvents: boolean,
487
+ pageID: string,
488
+ updatePresence: boolean,
489
+ forceLogin: boolean,
490
+ userAgent: string,
491
+ autoMarkDelivery: boolean,
492
+ autoMarkRead: boolean,
493
+ proxy: string,
494
+ online: boolean
495
+ }
496
+
497
+ export type IFCAU_Friend = {
498
+ alternativeName: string,
499
+ firstName: string,
500
+ gender: string,
501
+ userID: string,
502
+ isFriend: boolean,
503
+ fullName: string,
504
+ profilePicture: string,
505
+ type: string,
506
+ profileUrl: string,
507
+ vanity: string,
508
+ isBirthday: boolean
509
+ }
510
+
511
+ export type IFCAU_Thread = {
512
+ threadID: string,
513
+ participantIDs: string[],
514
+ threadName: string,
515
+ userInfo: (IFCAU_User & { id: string })[],
516
+ nicknames: { [id: string]: string } | null,
517
+ unreadCount: number,
518
+ messageCount: number,
519
+ imageSrc: string,
520
+ timestamp: number,
521
+ muteUntil: number | null,
522
+ isGroup: boolean,
523
+ isSubscribed: boolean,
524
+ folder: 'INBOX' | 'ARCHIVE' | string,
525
+ isArchived: boolean,
526
+ cannotReplyReason: string | null,
527
+ lastReadTimestamp: number,
528
+ emoji: string | null,
529
+ color: string | null,
530
+ adminIDs: string[],
531
+ approvalMode: boolean,
532
+ approvalQueue: { inviterID: string, requesterID: string, timestamp: string }[]
533
+ }
534
+
535
+ export type IFCAU_ThreadList = {
536
+ threadID: string,
537
+ name: string,
538
+ unreadCount: number,
539
+ messageCount: number,
540
+ imageSrc: string,
541
+ emoji: string | null,
542
+ color: string | null,
543
+ nicknames: { userid: string, nickname: string }[],
544
+ muteUntil: number | null,
545
+ participants: IFCAU_ThreadList_Participants[],
546
+ adminIDs: string[],
547
+ folder: "INBOX" | "ARCHIVED" | "PENNDING" | "OTHER" | string,
548
+ isGroup: boolean,
549
+ customizationEnabled: boolean,
550
+ participantAddMode: string,
551
+ reactionMuteMode: string,
552
+ isArchived: boolean,
553
+ isSubscribed: boolean,
554
+ timestamp: number,
555
+ snippet: string,
556
+ snippetAttachments: string
557
+ snippetSender: string,
558
+ lastMessageTimestamp: number,
559
+ listReadTimestamp: number | null,
560
+ cannotReplyReason: string | null,
561
+ approvalMode: string
562
+ }[]
563
+
564
+ export type IFCAU_ThreadList_Participants =
565
+ {
566
+ accountType: "User",
567
+ userID: string,
568
+ name: string,
569
+ shortName: string,
570
+ gender: string,
571
+ url: string,
572
+ profilePicture: string,
573
+ username: string | null,
574
+ isViewerFriend: boolean,
575
+ isMessengerUser: boolean,
576
+ isVerified: boolean,
577
+ isMessageBlockedByViewer: boolean,
578
+ isViewerCoworker: boolean
579
+ } |
580
+ {
581
+ accountType: "Page",
582
+ userID: string,
583
+ name: string,
584
+ url: string,
585
+ profilePicture: string,
586
+ username: string | null,
587
+ acceptMessengerUserFeedback: boolean,
588
+ isMessengerUser: boolean,
589
+ isVerified: boolean,
590
+ isMessengerPlatformBot: boolean,
591
+ isMessageBlockedByViewer: boolean,
592
+ } |
593
+ {
594
+ accountType: "ReducedMessagingActor",
595
+ userID: string,
596
+ name: string,
597
+ url: string,
598
+ profilePicture: string,
599
+ username: string | null,
600
+ acceptMessengerUserFeedback: boolean,
601
+ isMessageBlockedByViewer: boolean
602
+ } |
603
+ {
604
+ accountType: "UnavailableMessagingActor",
605
+ userID: string,
606
+ name: string,
607
+ url: null,
608
+ profilePicture: string,
609
+ username: null,
610
+ acceptMessengerUserFeedback: boolean,
611
+ isMessageBlockedByViewer: boolean
612
+ } |
613
+ {
614
+ accountType: string,
615
+ userID: string,
616
+ name: string
617
+ };
618
+ }