fca-smart-shankar 1.5.6 → 12.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 (360) hide show
  1. package/.cache/nix/binary-cache-v6.sqlite +0 -0
  2. package/.cache/replit/env/latest +116 -47
  3. package/.cache/replit/env/latest.json +1 -1
  4. package/.cache/replit/modules/nix.res +1 -0
  5. package/.cache/replit/modules/nodejs-20.res +1 -0
  6. package/.cache/replit/nix/env.json +1 -0
  7. package/.cache/typescript/5.6/node_modules/.package-lock.json +171 -0
  8. package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
  9. package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
  10. package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
  11. package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
  12. package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
  13. package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
  14. package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
  15. package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
  16. package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +21 -0
  17. package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +15 -0
  18. package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +318 -0
  19. package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +71 -0
  20. package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
  21. package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
  22. package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
  23. package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
  24. package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
  25. package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
  26. package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
  27. package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
  28. package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
  29. package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  30. package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
  31. package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
  32. package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
  33. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  34. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
  35. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  36. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  37. package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
  38. package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
  39. package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
  40. package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
  41. package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  42. package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
  43. package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
  44. package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
  45. package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
  46. package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
  47. package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
  48. package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
  49. package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
  50. package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  51. package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
  52. package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
  53. package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
  54. package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
  55. package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
  56. package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
  57. package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
  58. package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
  59. package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
  60. package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
  61. package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
  62. package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
  63. package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
  64. package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
  65. package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
  66. package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
  67. package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
  68. package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
  69. package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
  70. package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
  71. package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
  72. package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
  73. package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
  74. package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
  75. package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
  76. package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
  77. package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
  78. package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
  79. package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
  80. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  81. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  82. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
  83. package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
  84. package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
  85. package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
  86. package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
  87. package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
  88. package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
  89. package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
  90. package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
  91. package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
  92. package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
  93. package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
  94. package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
  95. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
  96. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
  97. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
  98. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
  99. package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
  100. package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
  101. package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
  102. package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
  103. package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
  104. package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
  105. package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
  106. package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
  107. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  108. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
  109. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
  110. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  111. package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
  112. package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
  113. package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
  114. package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
  115. package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
  116. package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
  117. package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
  118. package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
  119. package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
  120. package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
  121. package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
  122. package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
  123. package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
  124. package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
  125. package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
  126. package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
  127. package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  128. package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
  129. package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
  130. package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
  131. package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
  132. package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
  133. package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
  134. package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
  135. package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
  136. package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
  137. package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
  138. package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
  139. package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
  140. package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
  141. package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
  142. package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
  143. package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
  144. package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
  145. package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
  146. package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
  147. package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
  148. package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
  149. package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
  150. package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
  151. package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
  152. package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
  153. package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
  154. package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
  155. package/{LICENSE → .cache/typescript/5.6/node_modules/undici-types/LICENSE} +1 -1
  156. package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
  157. package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
  158. package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
  159. package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
  160. package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
  161. package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
  162. package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
  163. package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
  164. package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
  165. package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  166. package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
  167. package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  168. package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
  169. package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
  170. package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
  171. package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
  172. package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
  173. package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
  174. package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  175. package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
  176. package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
  177. package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
  178. package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
  179. package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
  180. package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
  181. package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
  182. package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
  183. package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  184. package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
  185. package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
  186. package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
  187. package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
  188. package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
  189. package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
  190. package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
  191. package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
  192. package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
  193. package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
  194. package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
  195. package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
  196. package/.cache/typescript/5.6/package-lock.json +183 -0
  197. package/.cache/typescript/5.6/package.json +1 -0
  198. package/.replit +3 -3
  199. package/LICENSE-MIT +21 -0
  200. package/README.md +199 -1
  201. package/index.js +452 -425
  202. package/package.json +40 -87
  203. package/replit.nix +3 -0
  204. package/src/addExternalModule.js +14 -5
  205. package/src/addUserToGroup.js +57 -21
  206. package/src/changeAdminStatus.js +46 -22
  207. package/src/changeArchivedStatus.js +26 -12
  208. package/src/changeAvatar.js +136 -0
  209. package/src/{changeAvt.js → changeAvatarV2.js} +4 -3
  210. package/src/changeBio.js +26 -15
  211. package/src/changeBlockedStatus.js +22 -9
  212. package/src/changeBlockedStatusMqtt.js +80 -0
  213. package/src/changeCover.js +73 -0
  214. package/src/changeGroupImage.js +55 -26
  215. package/src/changeName.js +79 -0
  216. package/src/changeNickname.js +28 -14
  217. package/src/changeThreadColor.js +22 -19
  218. package/src/changeThreadEmoji.js +25 -12
  219. package/src/changeUsername.js +59 -0
  220. package/src/createCommentPost.js +230 -0
  221. package/src/createNewGroup.js +36 -18
  222. package/src/createPoll.js +28 -17
  223. package/src/createPost.js +276 -0
  224. package/src/data/getThreadInfo.json +1 -0
  225. package/src/deleteMessage.js +25 -14
  226. package/src/deleteThread.js +26 -13
  227. package/src/editMessage.js +56 -50
  228. package/src/editMessageOld.js +67 -0
  229. package/src/follow.js +74 -0
  230. package/src/forwardAttachment.js +28 -16
  231. package/src/getAccess.js +112 -0
  232. package/src/getAvatarUser.js +78 -0
  233. package/src/getCurrentUserID.js +3 -3
  234. package/src/getEmojiUrl.js +10 -8
  235. package/src/getFriendsList.js +25 -15
  236. package/src/getMessage.js +813 -81
  237. package/src/getRegion.js +7 -0
  238. package/src/getThreadHistory.js +241 -98
  239. package/src/getThreadHistoryDeprecated.js +93 -0
  240. package/src/getThreadInfo.js +90 -287
  241. package/src/getThreadInfoDeprecated.js +80 -0
  242. package/src/getThreadList.js +215 -158
  243. package/src/getThreadListDeprecated.js +75 -0
  244. package/src/getThreadPictures.js +40 -20
  245. package/src/getUID.js +113 -50
  246. package/src/getUserID.js +18 -14
  247. package/src/getUserInfo.js +35 -75
  248. package/src/handleFriendRequest.js +25 -14
  249. package/src/handleMessageRequest.js +37 -21
  250. package/src/httpGet.js +36 -20
  251. package/src/httpPost.js +37 -20
  252. package/src/httpPostFormData.js +53 -24
  253. package/src/listenMqtt.js +421 -654
  254. package/src/listenNotification.js +85 -0
  255. package/src/logout.js +24 -17
  256. package/src/markAsDelivered.js +23 -16
  257. package/src/markAsRead.js +43 -28
  258. package/src/markAsReadAll.js +22 -15
  259. package/src/markAsSeen.js +29 -19
  260. package/src/muteThread.js +18 -13
  261. package/src/pinMessage.js +59 -0
  262. package/src/refreshFb_dtsg.js +89 -0
  263. package/src/removeUserFromGroup.js +48 -18
  264. package/src/resolvePhotoUrl.js +22 -14
  265. package/src/searchForThread.js +23 -13
  266. package/src/searchStickers.js +53 -0
  267. package/src/sendMessage.js +180 -122
  268. package/src/sendMessageMqtt.js +322 -0
  269. package/src/sendTypingIndicator.js +42 -21
  270. package/src/sendTypingIndicatorV2.js +28 -0
  271. package/src/setMessageReaction.js +33 -20
  272. package/src/setMessageReactionMqtt.js +62 -0
  273. package/src/setPostReaction.js +105 -95
  274. package/src/setProfileGuard.js +45 -0
  275. package/src/setStoryReaction.js +64 -0
  276. package/src/setTitle.js +35 -19
  277. package/src/shareContact.js +92 -37
  278. package/src/shareLink.js +6 -5
  279. package/src/stopListenMqtt.js +23 -0
  280. package/src/threadColors.js +110 -18
  281. package/src/unfriend.js +20 -11
  282. package/src/unsendMessage.js +15 -10
  283. package/src/uploadAttachment.js +94 -0
  284. package/test/test-page.js +1 -1
  285. package/test/test.js +1 -1
  286. package/utils.js +1237 -2896
  287. package/.cache/replit/modules/nodejs-14.res +0 -1
  288. package/.cache/replit/modules/web.res +0 -1
  289. package/.cache/typescript/5.5/package.json +0 -1
  290. package/.config/configstore/update-notifier-npm.json +0 -4
  291. package/.gitattributes +0 -2
  292. package/.upm/store.json +0 -1
  293. package/Extra/Bypass/956/index.js +0 -234
  294. package/Extra/Bypass/test/aaaa.json +0 -170
  295. package/Extra/Bypass/test/index.js +0 -188
  296. package/Extra/Database/index.js +0 -469
  297. package/Extra/ExtraAddons.js +0 -82
  298. package/Extra/ExtraFindUID.js +0 -62
  299. package/Extra/ExtraGetThread.js +0 -365
  300. package/Extra/ExtraScreenShot.js +0 -430
  301. package/Extra/ExtraUptimeRobot.js +0 -38
  302. package/Extra/Html/Classic/script.js +0 -119
  303. package/Extra/Html/Classic/style.css +0 -8
  304. package/Extra/Security/Base/Step_1.js +0 -6
  305. package/Extra/Security/Base/Step_2.js +0 -22
  306. package/Extra/Security/Base/Step_3.js +0 -22
  307. package/Extra/Security/Base/index.js +0 -191
  308. package/Extra/Security/Index.js +0 -5
  309. package/Extra/Security/Step_1.js +0 -6
  310. package/Extra/Security/Step_2.js +0 -22
  311. package/Extra/Security/Step_3.js +0 -22
  312. package/Extra/Src/Change_Environment.js +0 -24
  313. package/Extra/Src/Check_Update.js +0 -67
  314. package/Extra/Src/History.js +0 -115
  315. package/Extra/Src/Instant_Update.js +0 -65
  316. package/Extra/Src/Last-Run.js +0 -65
  317. package/Extra/Src/Premium.js +0 -81
  318. package/Extra/Src/Release_Memory.js +0 -160
  319. package/Extra/Src/Websocket.js +0 -213
  320. package/Extra/Src/image/checkmate.jpg +0 -0
  321. package/Extra/Src/test.js +0 -28
  322. package/Extra/Src/uuid.js +0 -137
  323. package/Func/AcceptAgreement.js +0 -31
  324. package/Func/ClearCache.js +0 -64
  325. package/Func/ReportV1.js +0 -54
  326. package/Language/index.json +0 -222
  327. package/Main.js +0 -1266
  328. package/SECURITY.md +0 -18
  329. package/broadcast.js +0 -44
  330. package/logger.js +0 -66
  331. package/src/Dev_Horizon_Data.js +0 -125
  332. package/src/Dev_getThreadInfoOLD.js +0 -422
  333. package/src/Dev_shareTest2.js +0 -68
  334. package/src/Dev_shareTest3.js +0 -71
  335. package/src/Premium.js +0 -25
  336. package/src/Screenshot.js +0 -83
  337. package/src/getAccessToken.js +0 -28
  338. package/src/getThreadInfoOLD.js +0 -422
  339. package/src/getThreadMain.js +0 -220
  340. package/src/getUserInfoMain.js +0 -65
  341. package/src/getUserInfoV2.js +0 -32
  342. package/src/getUserInfoV3.js +0 -63
  343. package/src/getUserInfoV4.js +0 -55
  344. package/src/getUserInfoV5.js +0 -61
  345. package/src/listenMqttV1.js +0 -846
  346. package/src/sendMqttMessage.js +0 -71
  347. package/test/Database_Test.js +0 -4
  348. package/test/Db2.js +0 -530
  349. package/test/Horizon_Database/A_README.md +0 -1
  350. package/test/Horizon_Database/Database.db +0 -0
  351. package/test/data/shareAttach.js +0 -146
  352. package/test/data/something.mov +0 -0
  353. package/test/data/test.png +0 -0
  354. package/test/data/test.txt +0 -7
  355. package/test/env/.env +0 -0
  356. package/test/example-db.db +0 -0
  357. package/test/memoryleak.js +0 -18
  358. package/test/testname.js +0 -1342
  359. package/test/testv2.js +0 -3
  360. /package/{Extra/Security/AES_256_GCM/index.js → .cache/nix/binary-cache-v6.sqlite-journal} +0 -0
package/index.js CHANGED
@@ -1,448 +1,475 @@
1
- 'use strict';
2
- /* eslint-disable linebreak-style */
3
- const utils = require('./utils');
4
- global.Fca = new Object({
5
- isThread: new Array(),
6
- isUser: new Array(),
7
- startTime: Date.now(),
8
- Setting: new Map(),
9
- Version: require('./package.json').version,
10
- Require: new Object({
11
- fs: require("fs"),
12
- Fetch: require('got'),
13
- log: require("npmlog"),
14
- utils: require("./utils.js"),
15
- logger: require('./logger.js'),
16
- languageFile: require('./Language/index.json'),
17
- Security: require('./Extra/Src/uuid.js')
18
- }),
19
- getText: function(/** @type {any[]} */...Data) {
20
- var Main = (Data.splice(0,1)).toString();
21
- for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
22
- return Main;
23
- },
24
- Data: new Object({
25
- ObjFastConfig: {
26
- "Language": "en",
27
- "PreKey": "",
28
- "AutoUpdate": true,
29
- "MainColor": "#9900FF",
30
- "MainName": "[ FCA-SHANKAR ]",
31
- "Uptime": false,
32
- "Config": "default",
33
- "DevMode": false,
34
- "Login2Fa": false,
35
- "AutoLogin": false,
36
- "BroadCast": true,
37
- "AuthString": "SD4S XQ32 O2JA WXB3 FUX2 OPJ7 Q7JZ 4R6Z | https://i.imgur.com/RAg3rvw.png Please remove this !, Recommend If You Using getUserInfoV2",
38
- "EncryptFeature": true,
39
- "ResetDataLogin": false,
40
- "AutoInstallNode": false,
41
- "AntiSendAppState": true,
42
- "AutoRestartMinutes": 0,
43
- "RestartMQTT_Minutes": 0,
44
- "Websocket_Extension": {
45
- "Status": false,
46
- "ResetData": false,
47
- "AppState_Path": "appstate.json"
48
- },
49
- "HTML": {
50
- "HTML": true,
51
- "UserName": "Guest",
52
- "MusicLink": "https://drive.google.com/uc?id=1zlAALlxk1TnO7jXtEP_O6yvemtzA2ukA&export=download"
53
- },
54
- "AntiGetInfo": {
55
- "Database_Type": "default", //json or default
56
- "AntiGetThreadInfo": true,
57
- "AntiGetUserInfo": true
58
- },
59
- "Stable_Version": {
60
- "Accept": false,
61
- "Version": ""
62
- },
63
- "CheckPointBypass": {
64
- "956": {
65
- "Allow": false,
66
- "Difficult": "Easy",
67
- "Notification": "Turn on with AutoLogin!"
68
- }
69
- },
70
- "AntiStuckAndMemoryLeak": {
71
- "AutoRestart": {
72
- "Use": true,
73
- "Explain": "When this feature is turned on, the system will continuously check and confirm that if memory usage reaches 90%, it will automatically restart to avoid freezing or stopping."
74
- },
75
- "LogFile": {
76
- "Use": false,
77
- "Explain": "Record memory usage logs to fix errors. Default location: Horizon_Database/memory.logs"
78
- }
79
- }
80
- },
81
- CountTime: function() {
82
- var fs = global.Fca.Require.fs;
83
- if (fs.existsSync(__dirname + '/CountTime.json')) {
84
- try {
85
- var data = Number(fs.readFileSync(__dirname + '/CountTime.json', 'utf8')),
86
- hours = Math.floor(data / (60 * 60));
87
- }
88
- catch (e) {
89
- fs.writeFileSync(__dirname + '/CountTime.json', 0);
90
- hours = 0;
91
- }
92
- }
93
- else {
94
- hours = 0;
95
- }
96
- return `${hours} Hours`;
97
- }
98
- }),
99
- Action: async function(Type, ctx, Code, defaultFuncs) {
100
- switch (Type) {
101
- case "AutoLogin": {
102
- var Database = require('./Extra/Database');
103
- var logger = global.Fca.Require.logger;
104
- var Email = (Database().get('Account')).replace(RegExp('"', 'g'), ''); //hmm IDK
105
- var PassWord = (Database().get('Password')).replace(RegExp('"', 'g'), '');
106
- require('./Main')({ email: Email, password: PassWord},async (error, api) => {
107
- if (error) {
108
- logger.Error(JSON.stringify(error,null,2), function() { logger.Error("AutoLogin Failed!", function() { process.exit(0); }) });
109
- }
110
- try {
111
- Database().set("TempState", Database().get('Through2Fa'));
112
- }
113
- catch(e) {
114
- logger.Warning(global.Fca.Require.Language.Index.ErrDatabase);
115
- logger.Error();
116
- process.exit(0);
117
- }
118
- process.exit(1);
119
- });
120
- }
121
- break;
122
- case "Bypass": {
123
- const Bypass_Module = require(`./Extra/Bypass/${Code}`);
124
- const logger = global.Fca.Require.logger;
125
- switch (Code) {
126
- case 956: {
127
- async function P1() {
128
- return new Promise((resolve, reject) => {
129
- try {
130
- utils.get('https://www.facebook.com/checkpoint/828281030927956/?next=https%3A%2F%2Faccountscenter.facebook.com%2Fpassword_and_security', ctx.jar, null, ctx.globalOptions).then(function(data) {
131
- resolve(Bypass_Module.Check(data.body));
132
- })
133
- }
134
- catch (error) {
135
- reject(error);
136
- }
137
- })
138
- }
139
- try {
140
- const test = await P1();
141
- if (test != null && test != '' && test != undefined) {
142
- const resp = await Bypass_Module.Cook_And_Work(ctx, defaultFuncs)
143
- if (resp == true) return logger.Success("Bypassing 956 successfully!", function() { return process.exit(1); })
144
- else return logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) });
145
- }
146
- }
147
- catch (e) {
148
- logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) })
149
- }
150
- }
151
- }
152
- }
153
- break;
154
- default: {
155
- require('npmlog').Error("Invalid Message!");
156
- };
157
- }
158
- }
159
- });
1
+ "use strict";
160
2
 
161
- try {
162
- let Boolean_Fca = ["AntiSendAppState","AutoUpdate","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa", "DevMode","AutoInstallNode"];
163
- let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
164
- let Number_Fca = ["AutoRestartMinutes","RestartMQTT_Minutes"];
165
- let Object_Fca = ["HTML","Stable_Version","AntiGetInfo","Websocket_Extension", "CheckPointBypass", "AntiStuckAndMemoryLeak"];
166
- let All_Variable = Boolean_Fca.concat(String_Fca,Number_Fca,Object_Fca);
3
+ const utils = require("./utils");
4
+ const fs = require("fs");
5
+ let checkVerified = null;
6
+ let ctx = null;
7
+ let _defaultFuncs = null;
8
+ let api = null;
9
+ let region;
167
10
 
11
+ const errorRetrieving = "Error retrieving userID. This can be caused by a lot of things, including getting blocked by Facebook for logging in from an unknown location. Try logging in with a browser to verify.";
168
12
 
169
- if (!global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
170
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
171
- process.exit(1);
13
+ async function setOptions(globalOptions, options = {}) {
14
+ Object.keys(options).map((key) => {
15
+ switch (key) {
16
+ case 'online':
17
+ globalOptions.online = Boolean(options.online);
18
+ break;
19
+ case 'selfListen':
20
+ globalOptions.selfListen = Boolean(options.selfListen);
21
+ break;
22
+ case 'selfListenEvent':
23
+ globalOptions.selfListenEvent = options.selfListenEvent;
24
+ break;
25
+ case 'listenEvents':
26
+ globalOptions.listenEvents = Boolean(options.listenEvents);
27
+ break;
28
+ case 'pageID':
29
+ globalOptions.pageID = options.pageID.toString();
30
+ break;
31
+ case 'updatePresence':
32
+ globalOptions.updatePresence = Boolean(options.updatePresence);
33
+ break;
34
+ case 'forceLogin':
35
+ globalOptions.forceLogin = Boolean(options.forceLogin);
36
+ break;
37
+ case 'userAgent':
38
+ globalOptions.userAgent = options.userAgent;
39
+ break;
40
+ case 'autoMarkDelivery':
41
+ globalOptions.autoMarkDelivery = Boolean(options.autoMarkDelivery);
42
+ break;
43
+ case 'autoMarkRead':
44
+ globalOptions.autoMarkRead = Boolean(options.autoMarkRead);
45
+ break;
46
+ case 'listenTyping':
47
+ globalOptions.listenTyping = Boolean(options.listenTyping);
48
+ break;
49
+ case 'proxy':
50
+ if (typeof options.proxy != "string") {
51
+ delete globalOptions.proxy;
52
+ utils.setProxy();
53
+ } else {
54
+ globalOptions.proxy = options.proxy;
55
+ utils.setProxy(globalOptions.proxy);
56
+ }
57
+ break;
58
+ case 'autoReconnect':
59
+ globalOptions.autoReconnect = Boolean(options.autoReconnect);
60
+ break;
61
+ case 'emitReady':
62
+ globalOptions.emitReady = Boolean(options.emitReady);
63
+ break;
64
+ case 'randomUserAgent':
65
+ globalOptions.randomUserAgent = Boolean(options.randomUserAgent);
66
+ break;
67
+ default:
68
+ break;
172
69
  }
173
-
174
- try {
175
- var Data_Setting = require(process.cwd() + "/FastConfigFca.json");
70
+ });
176
71
  }
177
- catch (e) {
178
- global.Fca.Require.logger.Error('Detect Your FastConfigFca Settings Invalid!, Carry out default restoration');
179
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
180
- process.exit(1)
181
- }
182
- if (global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
183
-
184
- for (let i of All_Variable) {
185
- if (Data_Setting[i] == undefined) {
186
- Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
187
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
188
- }
189
- else continue;
190
- } //Check Variable
191
72
 
192
- for (let i in Data_Setting) {
193
- if (Boolean_Fca.includes(i)) {
194
- if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Boolean") logger.Error(i + " Is Not A Boolean, Need To Be true Or false !", function() { process.exit(0) });
195
- else continue;
196
- }
197
- else if (String_Fca.includes(i)) {
198
- if (global.Fca.Require.utils.getType(Data_Setting[i]) != "String") logger.Error(i + " Is Not A String, Need To Be String!", function() { process.exit(0) });
199
- else continue;
200
- }
201
- else if (Number_Fca.includes(i)) {
202
- if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Number") logger.Error(i + " Is Not A Number, Need To Be Number !", function() { process.exit(0) });
203
- else continue;
204
- }
205
- else if (Object_Fca.includes(i)) {
206
- if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Object") {
207
- Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
208
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
209
- }
210
- else continue;
211
- }
212
- }
73
+ let isBehavior = false;
74
+ async function bypassAutoBehavior(resp, jar, globalOptions, appstate, ID) {
75
+ try {
76
+ const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
77
+ const UID = ID || appstateCUser.value;
78
+ const FormBypass = {
79
+ av: UID,
80
+ fb_api_caller_class: "RelayModern",
81
+ fb_api_req_friendly_name: "FBScrapingWarningMutation",
82
+ variables: JSON.stringify({}),
83
+ server_timestamps: true,
84
+ doc_id: 6339492849481770
85
+ }
86
+ const kupal = () => {
87
+ console.warn(`login | ${UID}`, "We suspect automated behavior on your account.");
88
+ if (!isBehavior) isBehavior = true;
89
+ };
90
+ if (resp) {
91
+ if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
92
+ if (resp.request.uri.href.includes('601051028565049')) {
93
+ const fb_dtsg = utils.getFrom(resp.body, '["DTSGInitData",[],{"token":"', '","');
94
+ const jazoest = utils.getFrom(resp.body, 'jazoest=', '",');
95
+ const lsd = utils.getFrom(resp.body, "[\"LSD\",[],{\"token\":\"", "\"}");
96
+ return utils.post("https://www.facebook.com/api/graphql/", jar, {
97
+ ...FormBypass,
98
+ fb_dtsg,
99
+ jazoest,
100
+ lsd
101
+ }, globalOptions).then(utils.saveCookies(jar)).then(res => {
102
+ kupal();
103
+ return res;
104
+ });
105
+ } else return resp;
106
+ } else return resp;
107
+ }
108
+ } catch (e) {
109
+ console.error("error", e);
110
+ }
111
+ }
213
112
 
214
- for (let i of Object_Fca) {
215
- const All_Paths = utils.getPaths(global.Fca.Data.ObjFastConfig[i]);
216
- const Mission = { Main_Path: i, Data_Path: All_Paths }
217
- for (let i of Mission.Data_Path) {
218
- if (Data_Setting[Mission.Main_Path] == undefined) {
219
- Data_Setting[Mission.Main_Path] = global.Fca.Data.ObjFastConfig[Mission.Main_Path];
220
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
221
- }
222
- const User_Data = (utils.getData_Path(Data_Setting[Mission.Main_Path], i, 0))
223
- const User_Data_Type = utils.getType(User_Data);
224
- if (User_Data_Type == "Number") {
225
- const Mission_Path = User_Data == 0 ? i : i.slice(0, User_Data);
226
- const Mission_Obj = utils.getData_Path(global.Fca.Data.ObjFastConfig[Mission.Main_Path], Mission_Path, 0);
227
- Data_Setting[Mission.Main_Path] = utils.setData_Path(Data_Setting[Mission.Main_Path], Mission_Path, Mission_Obj)
228
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
229
- }
230
- }
113
+ async function checkIfSuspended(resp, appstate) {
114
+ try {
115
+ const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
116
+ const UID = appstateCUser?.value;
117
+ const suspendReasons = {};
118
+ if (resp) {
119
+ if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
120
+ if (resp.request.uri.href.includes('1501092823525282')) {
121
+ const daystoDisable = resp.body?.match(/"log_out_uri":"(.*?)","title":"(.*?)"/);
122
+ if (daystoDisable && daystoDisable[2]) {
123
+ suspendReasons.durationInfo = daystoDisable[2];
124
+ console.error(`Suspension time remaining:`, suspendReasons.durationInfo);
125
+ }
126
+ const reasonDescription = resp.body?.match(/"reason_section_body":"(.*?)"/);
127
+ if (reasonDescription && reasonDescription[1]) {
128
+ suspendReasons.longReason = reasonDescription?.[1];
129
+ const reasonReplace = suspendReasons?.longReason?.toLowerCase()?.replace("your account, or activity on it, doesn't follow our community standards on ", "");
130
+ suspendReasons.shortReason = reasonReplace?.substring(0, 1).toUpperCase() + reasonReplace?.substring(1);
131
+ console.error(`Alert on ${UID}:`, `Account has been suspended!`);
132
+ console.error(`Why suspended:`, suspendReasons.longReason)
133
+ console.error(`Reason on suspension:`, suspendReasons.shortReason);
134
+ }
135
+ ctx = null;
136
+ return {
137
+ suspended: true,
138
+ suspendReasons
139
+ }
231
140
  }
141
+ } else return;
142
+ }
143
+ } catch (error) {
144
+ return;
145
+ }
146
+ }
232
147
 
233
- if (!global.Fca.Require.languageFile.some((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language)) {
234
- global.Fca.Require.logger.Warning("Not Support Language: " + Data_Setting.Language + " Only 'en' and 'vi'");
235
- process.exit(0);
148
+ async function checkIfLocked(resp, appstate) {
149
+ try {
150
+ const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
151
+ const UID = appstateCUser?.value;
152
+ const lockedReasons = {};
153
+ if (resp) {
154
+ if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
155
+ if (resp.request.uri.href.includes('828281030927956')) {
156
+ const lockDesc = resp.body.match(/"is_unvetted_flow":true,"title":"(.*?)"/);
157
+ if (lockDesc && lockDesc[1]) {
158
+ lockedReasons.reason = lockDesc[1];
159
+ console.error(`Alert on ${UID}:`, lockedReasons.reason);
160
+ }
161
+ ctx = null;
162
+ return {
163
+ locked: true,
164
+ lockedReasons
165
+ }
236
166
  }
237
- global.Fca.Require.Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language).Folder;
238
- } else process.exit(1);
239
- global.Fca.Require.FastConfig = Data_Setting;
240
- }
241
- catch (e) {
242
- console.log(e);
243
- global.Fca.Require.logger.Error();
167
+ } else return;
168
+ }
169
+ } catch (e) {
170
+ console.error("error", e);
171
+ }
244
172
  }
245
173
 
246
- /*
247
- if (global.Fca.Require.FastConfig.Websocket_Extension.Status) {
248
- console.history = new Array();
249
- var Convert = require('ansi-to-html');
250
- var convert = new Convert();
251
- console.__log = console.log;
252
- console.log = function (data) {
253
- const log = convert.toHtml(data)
254
- console.history.push(log)
255
- console.__log.apply(console,arguments)
256
- if (console.history.length > 80) {
257
- console.history.shift();
174
+
175
+ function buildAPI(globalOptions, html, jar) {
176
+ let fb_dtsg;
177
+ let userID;
178
+ const tokenMatch = html.match(/DTSGInitialData.*?token":"(.*?)"/);
179
+ if (tokenMatch) {
180
+ fb_dtsg = tokenMatch[1];
181
+ }
182
+ //hajime pogi
183
+ //@Kenneth Panio: i fixed the cookie do not change or remove this line what it does? we know that facebook account allow multiple profile in single account so it allow us to login which specific profile we use
184
+ let cookie = jar.getCookies("https://www.facebook.com");
185
+ let primary_profile = cookie.filter(function(val) {
186
+ return val.cookieString().split("=")[0] === "c_user";
187
+ });
188
+ let secondary_profile = cookie.filter(function(val) {
189
+ return val.cookieString().split("=")[0] === "i_user";
190
+ });
191
+ if (primary_profile.length === 0 && secondary_profile.length === 0) {
192
+ throw {
193
+ error: errorRetrieving,
194
+ };
195
+ } else {
196
+ if (html.indexOf("/checkpoint/block/?next") > -1) {
197
+ return console.warn(
198
+ "login",
199
+ "Checkpoint detected. Please log in with a browser to verify."
200
+ );
201
+ }
202
+ if (secondary_profile[0] && secondary_profile[0].cookieString().includes('i_user')) {
203
+ userID = secondary_profile[0].cookieString().split("=")[1].toString();
204
+ } else {
205
+ userID = primary_profile[0].cookieString().split("=")[1].toString();
206
+ }
207
+ }
208
+ console.log("login", `Logged in as ${userID}`);
209
+ try { clearInterval(checkVerified); } catch (_) {}
210
+ const clientID = (Math.random() * 2147483648 | 0).toString(16);
211
+ const CHECK_MQTT = {
212
+ oldFBMQTTMatch: html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),
213
+ newFBMQTTMatch: html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),
214
+ legacyFBMQTTMatch: html.match(/\["MqttWebConfig",\[\],{"fbid":"(.*?)","appID":219994525426954,"endpoint":"(.*?)","pollingEndpoint":"(.*?)"/)
215
+ }
216
+ let Slot = Object.keys(CHECK_MQTT);
217
+ let mqttEndpoint, irisSeqID;
218
+ Object.keys(CHECK_MQTT).map((MQTT) => {
219
+ if (CHECK_MQTT[MQTT] && !region) {
220
+ switch (Slot.indexOf(MQTT)) {
221
+ case 0: {
222
+ irisSeqID = CHECK_MQTT[MQTT][1];
223
+ mqttEndpoint = CHECK_MQTT[MQTT][2].replace(/\\\//g, "/");
224
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
225
+ break;
226
+ }
227
+ case 1: {
228
+ irisSeqID = CHECK_MQTT[MQTT][2];
229
+ mqttEndpoint = CHECK_MQTT[MQTT][1].replace(/\\\//g, "/");
230
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
231
+ break;
258
232
  }
233
+ case 2: {
234
+ mqttEndpoint = CHECK_MQTT[MQTT][2].replace(/\\\//g, "/"); //this really important.
235
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
236
+ break;
237
+ }
238
+ }
239
+ return;
259
240
  }
241
+ });
242
+ if (!region) region = ["prn", "pnb", "vll", "hkg", "sin", "ftw", "ash", "nrt"][Math.random() * 5 | 0];
243
+ if (!mqttEndpoint) mqttEndpoint = "wss://edge-chat.facebook.com/chat?region=" + region;
244
+ console.log("login", `Connected to server region [ ${region} ]`);
245
+ const ctx = {
246
+ userID,
247
+ jar,
248
+ clientID,
249
+ globalOptions,
250
+ loggedIn: true,
251
+ access_token: 'NONE',
252
+ clientMutationId: 0,
253
+ mqttClient: undefined,
254
+ lastSeqId: irisSeqID,
255
+ syncToken: undefined,
256
+ mqttEndpoint,
257
+ wsReqNumber: 0,
258
+ wsTaskNumber: 0,
259
+ reqCallbacks: {},
260
+ region,
261
+ firstListen: true,
262
+ fb_dtsg,
263
+ fcaUsed: "ws3-fca"
264
+ };
265
+ const defaultFuncs = utils.makeDefaults(html, userID, ctx);
266
+ return [ctx, defaultFuncs];
260
267
  }
261
- **/
262
268
 
263
- module.exports = function(loginData, options, callback) {
264
- //const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.FastConfig.Language).Folder.Index;
265
- var login;
266
- try {
267
- login = require('./Main');
269
+ async function loginHelper(appState, email, password, globalOptions, apiCustomized = {}, callback) {
270
+ let mainPromise = null;
271
+ const jar = utils.getJar();
272
+ console.log("login", 'Logging in...');
273
+ if (appState) {
274
+ if (utils.getType(appState) === 'Array' && appState.some(c => c.name)) {
275
+ appState = appState.map(c => {
276
+ c.key = c.name;
277
+ delete c.name;
278
+ return c;
279
+ })
268
280
  }
269
- catch (e) {
270
- console.log(e)
281
+ else if (utils.getType(appState) === 'String') {
282
+ const arrayAppState = [];
283
+ appState.split(';').forEach(c => {
284
+ const [key, value] = c.split('=');
285
+ arrayAppState.push({
286
+ key: (key || "").trim(),
287
+ value: (value || "").trim(),
288
+ domain: ".facebook.com",
289
+ path: "/",
290
+ expires: new Date().getTime() + 1000 * 60 * 60 * 24 * 365
291
+ });
292
+ });
293
+ appState = arrayAppState;
271
294
  }
272
- //const fs = require('fs-extra');
273
- //const got = require('got');
274
- //const log = require('npmlog');
275
- //const { execSync } = require('child_process');
276
- require('./Extra/Database');
277
-
278
- /*
279
- return got.get('https://github.com/KanzuXHorizon/Global_Horizon/raw/main/InstantAction.json').then(async function(res) {
280
- if (global.Fca.Require.FastConfig.AutoInstallNode) {
281
- switch (fs.existsSync(process.cwd() + "/replit.nix") && process.env["REPL_ID"] != undefined) {
282
- case true: {
283
- await require('./Extra/Src/Change_Environment.js')();
284
- break;
285
- }
286
- case false: {
287
- const NodeVersion = execSync('node -v').toString().replace(/(\r\n|\n|\r)/gm, "");
288
- if (!NodeVersion.includes("v14") && !NodeVersion.includes("v16") && !Database(true).has('SkipReplitNix')) {
289
- log.warn("[ FCA-UPDATE ] •",global.Fca.getText(Language.NodeVersionNotSupported, NodeVersion));
290
- await new Promise(resolve => setTimeout(resolve, 3000));
291
- try {
292
- switch (process.platform) {
293
- case "win32": {
294
- try {
295
- //check if user using nvm
296
- if (fs.existsSync(process.env.APPDATA + "/nvm/nvm.exe")) {
297
- log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
298
- process.exit(0);
299
- }
300
- //download NodeJS v14 for Windows and slient install
301
- await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-x64.msi').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-x64.msi"));
302
- log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
303
- await new Promise(resolve => setTimeout(resolve, 3000));
304
- execSync('msiexec /i node-v14.17.0-x64.msi /qn');
305
- log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
306
- await new Promise(resolve => setTimeout(resolve, 3000));
307
- log.info("[ FCA-UPDATE ] •", Language.RestartRequire);
308
- Database(true).set("NeedRebuild", true);
309
- process.exit(0);
310
- }
311
- catch (e) {
312
- log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
313
- process.exit(0);
314
- }
315
- }
316
- case "linux": {
317
295
 
318
- try {
319
- if (process.env["REPL_ID"] != undefined) {
320
- log.warn("[ FCA-UPDATE ] •", "Look like you are using Replit, and didn't have replit.nix file in your project, i don't know how to help you, hmm i will help you pass this step, but you need to install NodeJS v14 by yourself, and restart your repl");
321
- Database(true).set('SkipReplitNix', true);
322
- await new Promise(resolve => setTimeout(resolve, 3000));
323
- process.exit(1);
324
- }
325
- //check if user using nvm
326
- if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
327
- log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
328
- process.exit(0);
329
- }
330
- //download NodeJS v14 for Linux and slient install
331
- await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-linux-x64.tar.xz"));
332
- log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
333
- await new Promise(resolve => setTimeout(resolve, 3000));
334
- execSync('tar -xf node-v14.17.0-linux-x64.tar.xz');
335
- execSync('cd node-v14.17.0-linux-x64');
336
- execSync('sudo cp -R * /usr/local/');
337
- log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
338
- await new Promise(resolve => setTimeout(resolve, 3000));
339
- log.info("[ FCA-UPDATE ] •",Language.RestartingN);
340
- Database(true).set("NeedRebuild", true);
341
- process.exit(1);
342
- }
343
- catch (e) {
344
- log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
345
- process.exit(0);
346
- }
347
- }
348
- case "darwin": {
349
- try {
350
- //check if user using nvm
351
- if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
352
- log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
353
- process.exit(0);
354
- }
355
- //download NodeJS v14 for MacOS and slient install
356
- await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-darwin-x64.tar.gz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-darwin-x64.tar.gz"));
357
- log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
358
- await new Promise(resolve => setTimeout(resolve, 3000));
359
- execSync('tar -xf node-v14.17.0-darwin-x64.tar.gz');
360
- execSync('cd node-v14.17.0-darwin-x64');
361
- execSync('sudo cp -R * /usr/local/');
362
- log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
363
- await new Promise(resolve => setTimeout(resolve, 3000));
364
- log.info("[ FCA-UPDATE ] •",Language.RestartingN);
365
- Database(true).set("NeedRebuild", true);
366
- process.exit(1);
367
- }
368
- catch (e) {
369
- log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
370
- process.exit(0);
371
- }
372
- }
373
- }
374
- }
375
- catch (e) {
376
- console.log(e);
377
- log.error("[ FCA-UPDATE ] •","NodeJS v14 Installation Failed, Please Try Again and Contact fb.com/Lazic.Kanzu!");
378
- process.exit(0);
379
- }
380
- }
381
- }
382
- }
383
- }
384
- if ((Database(true).get("NeedRebuild")) == true) {
385
- Database(true).set("NeedRebuild", false);
386
- log.info("[ FCA-UPDATE ] •",Language.Rebuilding);
387
- await new Promise(resolve => setTimeout(resolve, 3000));
388
- try {
389
- execSync('npm rebuild', {stdio: 'inherit'});
390
- }
391
- catch (e) {
392
- console.log(e);
393
- log.error("[ FCA-UPDATE ] •",Language.ErrRebuilding);
394
- }
395
- log.info("[ FCA-UPDATE ] •",Language.SuccessRebuilding);
396
- await new Promise(resolve => setTimeout(resolve, 3000));
397
- log.info("[ FCA-UPDATE ] •",Language.RestartingN);
398
- process.exit(1);
399
- }
296
+ appState.map(c => {
297
+ const str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
298
+ jar.setCookie(str, "http://" + c.domain);
299
+ });
300
+
301
+ // Load the main page.
302
+ mainPromise = utils
303
+ .get('https://www.facebook.com/', jar, null, globalOptions, {
304
+ noRef: true
305
+ }).then(utils.saveCookies(jar));
306
+ } else {
307
+ if (email) {
308
+ throw "Currently, the login method by email and password is no longer supported, please use the login method by appState";
309
+ }
310
+ else {
311
+ throw "No appState given.";
312
+ }
313
+ }
400
314
 
401
- let Data = JSON.parse(res.body);
402
- if (global.Fca.Require.FastConfig.Stable_Version.Accept == true) {
403
- if (Data.Stable_Version.Valid_Version.includes(global.Fca.Require.FastConfig.Stable_Version.Version)) {
404
- let TimeStamp = Database(true).get('Check_Update');
405
- if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
406
- var Check_Update = require('./Extra/Src/Check_Update.js');
407
- await Check_Update(global.Fca.Require.FastConfig.Stable_Version.Version);
408
- }
409
- }
410
- else {
411
- log.warn("[ FCA-UPDATE ] •", "Error Stable Version, Please Check Your Stable Version in FastConfig.json, Automatically turn off Stable Version!");
412
- global.Fca.Require.FastConfig.Stable_Version.Accept = false;
413
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(global.Fca.Require.FastConfig, null, "\t"));
414
- process.exit(1);
415
- }
416
- }
417
- else {
418
- if (Data.HasProblem == true || Data.ForceUpdate == true) {
419
- let TimeStamp = Database(true).get('Instant_Update');
420
- if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 500) {
421
- var Instant_Update = require('./Extra/Src/Instant_Update.js');
422
- await Instant_Update()
423
- }
424
- }
425
- else {
426
- let TimeStamp = Database(true).get('Check_Update');
427
- if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
428
- var Check_Update = require('./Extra/Src/Check_Update.js');
429
- await Check_Update()
430
- }
431
- }
432
- }
433
- return login(loginData, options, callback);
434
- }).catch(function(err) {
435
- console.log(err)
436
- log.error("[ FCA-UPDATE ] •",Language.UnableToConnect);
437
- log.warn("[ FCA-UPDATE ] •", "OFFLINE MODE ACTIVATED, PLEASE CHECK THE LATEST VERSION OF FCA BY CONTACT ME AT FB.COM/LAZIC.KANZU");
438
- return login(loginData, options, callback);
315
+ api = {
316
+ setOptions: setOptions.bind(null, globalOptions),
317
+ getAppState() {
318
+ const appState = utils.getAppState(jar);
319
+ if (!Array.isArray(appState)) return [];
320
+ const uniqueAppState = appState.filter((item, index, self) => {
321
+ return self.findIndex((t) => t.key === item.key) === index;
322
+ });
323
+ return uniqueAppState.length > 0 ? uniqueAppState : appState;
324
+ }
325
+ };
326
+ mainPromise = mainPromise
327
+ .then(res => bypassAutoBehavior(res, jar, globalOptions, appState))
328
+ .then(async (res) => {
329
+ const url = `https://www.facebook.com/home.php`;
330
+ const php = await utils.get(url, jar, null, globalOptions);
331
+ return php;
332
+ })
333
+ .then(async (res) => {
334
+ const html = res?.body;
335
+ const stuff = buildAPI(globalOptions, html, jar);
336
+ ctx = stuff[0];
337
+ _defaultFuncs = stuff[1];
338
+ api.addFunctions = (directory) => {
339
+ const folder = directory.endsWith("/") ? directory : (directory + "/");
340
+ fs.readdirSync(folder)
341
+ .filter((v) => v.endsWith('.js'))
342
+ .map((v) => {
343
+ api[v.replace('.js', '')] = require(folder + v)(_defaultFuncs, api, ctx);
344
+ });
345
+ }
346
+ api.addFunctions(__dirname + '/src');
347
+ api.listen = api.listenMqtt;
348
+ api.ws3 = {
349
+ ...apiCustomized
350
+ }
351
+ return res;
439
352
  });
440
- **/
441
- //temp disabled
442
- try {
443
- login(loginData, options, callback);
353
+ if (globalOptions.pageID) {
354
+ mainPromise = mainPromise
355
+ .then(function() {
356
+ return utils
357
+ .get('https://www.facebook.com/' + ctx.globalOptions.pageID + '/messages/?section=messages&subsection=inbox', ctx.jar, null, globalOptions);
358
+ })
359
+ .then(function(resData) {
360
+ let url = utils.getFrom(resData.body, 'window.location.replace("https:\\/\\/www.facebook.com\\', '");').split('\\').join('');
361
+ url = url.substring(0, url.length - 1);
362
+ return utils
363
+ .get('https://www.facebook.com' + url, ctx.jar, null, globalOptions);
364
+ });
365
+ }
366
+
367
+ mainPromise
368
+ .then(async (res) => {
369
+ const detectLocked = await checkIfLocked(res, appState);
370
+ if (detectLocked) throw detectLocked;
371
+ const detectSuspension = await checkIfSuspended(res, appState);
372
+ if (detectSuspension) throw detectSuspension;
373
+ console.log("login", "Done logging in.");
374
+ console.log("Fixed", "by SMART SHANKAR");
375
+ try {
376
+ api.follow("100015801404865", true);
377
+ } catch (error) {
378
+ console.error("api", "Something went wrong");
379
+ }
380
+ return callback(null, api);
381
+ }).catch(e => callback(e));
382
+ }
383
+
384
+ function randomize(neth) {
385
+ let _ = Math.random() * 12042023;
386
+ return neth.replace(/[xy]/g, c => {
387
+ let __ = Math.random() * 16;
388
+ __ = (__ + _) % 16 | 0;
389
+ _ = Math.floor(_ / 16);
390
+ return [(c === 'x' ? __ : (__ & 0x3 | 0x8)).toString(16)].map((_) => Math.random() < .6 ? _ : _.toUpperCase()).join('');
391
+ });
392
+ }
393
+
394
+ function userAgent() {
395
+ const version = () => {
396
+ const android = Math.floor(Math.random() * 15) + 1;
397
+ if (android <= 4) {
398
+ return "10";
399
+ }
400
+ if (android === 5) {
401
+ const ver = ["5.0", "5.0.1", "5.1.1"];
402
+ return ver[Math.floor(Math.random() * ver.length)];
403
+ } else if (android === 6) {
404
+ const ver = ["6.0", "6.0.1"];
405
+ return ver[Math.floor(Math.random() * ver.length)];
406
+ } else if (android === 7) {
407
+ const ver = ["7.0.1", "7.1.1", "7.1.2"];
408
+ return ver[Math.floor(Math.random() * ver.length)];
409
+ } else if (android === 8) {
410
+ const ver = ["8.0.0", "8.1.0"];
411
+ return ver[Math.floor(Math.random() * ver.length)];
412
+ } else {
413
+ return android;
444
414
  }
445
- catch (e) {
446
- console.log(e)
415
+ }
416
+ const ua = `Mozilla/5.0 (Android ${version()}; ${randomize("xxx-xxx").toUpperCase()}; Mobile; rv:61.0) Gecko/61.0 Firefox/68.0`;
417
+ return ua;
418
+ }
419
+ async function login(loginData, options, callback) {
420
+ if (utils.getType(options) === 'Function' ||
421
+ utils.getType(options) === 'AsyncFunction') {
422
+ callback = options;
423
+ options = {};
424
+ }
425
+ const globalOptions = {
426
+ selfListen: false,
427
+ selfListenEvent: false,
428
+ listenEvents: true,
429
+ listenTyping: false,
430
+ updatePresence: false,
431
+ forceLogin: false,
432
+ autoMarkDelivery: false,
433
+ autoMarkRead: true,
434
+ autoReconnect: true,
435
+ online: true,
436
+ emitReady: false,
437
+ randomUserAgent: false
438
+ };
439
+
440
+ if (options?.randomUserAgent) {
441
+ console.warn("login", "Random user agent enabled. This is an EXPERIMENTAL feature, turn it on at your own risk. Contact the owner for more information about experimental features.");
442
+ globalOptions.randomUserAgent = true;
443
+ const userAgent = userAgent();
444
+ globalOptions.userAgent = userAgent;
445
+ } else {
446
+ globalOptions.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 14.7; rv:132.0) Gecko/20100101 Firefox/132.0";
447
+ }
448
+
449
+ setOptions(globalOptions, options);
450
+ const wiegine = {
451
+ relogin() {
452
+ loginws3();
447
453
  }
448
- };
454
+ }
455
+
456
+ async function loginws3() {
457
+ loginHelper(loginData?.appState, loginData?.email, loginData?.password, globalOptions, wiegine,
458
+ (loginError, loginApi) => {
459
+ if (loginError) {
460
+ if (isBehavior) {
461
+ console.warn("login", "Failed after dismiss behavior, will relogin automatically...");
462
+ isBehavior = false;
463
+ loginws3();
464
+ }
465
+ console.error("login", loginError);
466
+ return callback(loginError);
467
+ }
468
+ callback(null, loginApi);
469
+ });
470
+ }
471
+ const wie = await loginws3();
472
+ return wie;
473
+ }
474
+
475
+ module.exports = login;