zai-fca 1.0.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.

Potentially problematic release.


This version of zai-fca might be problematic. Click here for more details.

Files changed (185) hide show
  1. package/.cache/replit/env/latest +56 -0
  2. package/.cache/replit/env/latest.json +1 -0
  3. package/.cache/replit/modules/nodejs-20.res +1 -0
  4. package/.cache/replit/modules/replit.res +1 -0
  5. package/.cache/replit/modules.stamp +0 -0
  6. package/.cache/typescript/5.6/node_modules/.package-lock.json +40 -0
  7. package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
  8. package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
  9. package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
  10. package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
  11. package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
  12. package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  13. package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
  14. package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
  15. package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
  16. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  17. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
  18. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  19. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  20. package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
  21. package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
  22. package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
  23. package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
  24. package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  25. package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
  26. package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
  27. package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
  28. package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
  29. package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
  30. package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
  31. package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
  32. package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
  33. package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  34. package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
  35. package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
  36. package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
  37. package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
  38. package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
  39. package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
  40. package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
  41. package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
  42. package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
  43. package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
  44. package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
  45. package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
  46. package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
  47. package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
  48. package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
  49. package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
  50. package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
  51. package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
  52. package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
  53. package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
  54. package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
  55. package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
  56. package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
  57. package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
  58. package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
  59. package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
  60. package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
  61. package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
  62. package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
  63. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  64. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  65. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
  66. package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
  67. package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
  68. package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
  69. package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
  70. package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
  71. package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
  72. package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
  73. package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
  74. package/.cache/typescript/5.6/node_modules/@types/npmlog/LICENSE +21 -0
  75. package/.cache/typescript/5.6/node_modules/@types/npmlog/README.md +15 -0
  76. package/.cache/typescript/5.6/node_modules/@types/npmlog/index.d.ts +84 -0
  77. package/.cache/typescript/5.6/node_modules/@types/npmlog/package.json +32 -0
  78. package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
  79. package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
  80. package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
  81. package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +21 -0
  82. package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
  83. package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
  84. package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
  85. package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
  86. package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
  87. package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
  88. package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
  89. package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
  90. package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
  91. package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  92. package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
  93. package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  94. package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
  95. package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
  96. package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
  97. package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
  98. package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
  99. package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
  100. package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  101. package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
  102. package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
  103. package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
  104. package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
  105. package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
  106. package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
  107. package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
  108. package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
  109. package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  110. package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
  111. package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
  112. package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
  113. package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
  114. package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
  115. package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
  116. package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
  117. package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
  118. package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
  119. package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
  120. package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
  121. package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
  122. package/.cache/typescript/5.6/package-lock.json +48 -0
  123. package/.cache/typescript/5.6/package.json +1 -0
  124. package/.replit +4 -0
  125. package/.upm/store.json +1 -0
  126. package/README.md +289 -0
  127. package/index.js +460 -0
  128. package/package.json +30 -0
  129. package/src/Screenshot.js +83 -0
  130. package/src/addExternalModule.js +15 -0
  131. package/src/addUserToGroup.js +77 -0
  132. package/src/changeAdminStatus.js +47 -0
  133. package/src/changeArchivedStatus.js +41 -0
  134. package/src/changeAvt.js +85 -0
  135. package/src/changeBio.js +65 -0
  136. package/src/changeBlockedStatus.js +36 -0
  137. package/src/changeGroupImage.js +106 -0
  138. package/src/changeNickname.js +45 -0
  139. package/src/changeThreadColor.js +61 -0
  140. package/src/changeThreadEmoji.js +41 -0
  141. package/src/createNewGroup.js +70 -0
  142. package/src/createPoll.js +59 -0
  143. package/src/createPost.js +277 -0
  144. package/src/deleteMessage.js +44 -0
  145. package/src/deleteThread.js +42 -0
  146. package/src/forwardAttachment.js +47 -0
  147. package/src/getCurrentUserID.js +7 -0
  148. package/src/getEmojiUrl.js +27 -0
  149. package/src/getFriendsList.js +73 -0
  150. package/src/getThreadHistory.js +537 -0
  151. package/src/getThreadHistoryDeprecated.js +71 -0
  152. package/src/getThreadInfo.js +232 -0
  153. package/src/getThreadInfoDeprecated.js +56 -0
  154. package/src/getThreadList.js +213 -0
  155. package/src/getThreadListDeprecated.js +46 -0
  156. package/src/getThreadPictures.js +59 -0
  157. package/src/getUID.js +119 -0
  158. package/src/getUserID.js +61 -0
  159. package/src/getUserInfo.js +66 -0
  160. package/src/handleFriendRequest.js +46 -0
  161. package/src/handleMessageRequest.js +47 -0
  162. package/src/httpGet.js +49 -0
  163. package/src/httpPost.js +48 -0
  164. package/src/listenMqtt.js +827 -0
  165. package/src/listenMqtt.txt +827 -0
  166. package/src/logout.js +68 -0
  167. package/src/markAsDelivered.js +47 -0
  168. package/src/markAsRead.js +70 -0
  169. package/src/markAsReadAll.js +40 -0
  170. package/src/markAsSeen.js +48 -0
  171. package/src/muteThread.js +45 -0
  172. package/src/postFormData.txt +46 -0
  173. package/src/removeUserFromGroup.js +45 -0
  174. package/src/resolvePhotoUrl.js +36 -0
  175. package/src/searchForThread.js +42 -0
  176. package/src/sendMessage.js +329 -0
  177. package/src/sendTypingIndicator.js +70 -0
  178. package/src/setMessageReaction.js +109 -0
  179. package/src/setPostReaction.js +102 -0
  180. package/src/setTitle.js +70 -0
  181. package/src/shareContact.js +46 -0
  182. package/src/shareLink.js +62 -0
  183. package/src/threadColors.js +41 -0
  184. package/src/unfriend.js +42 -0
  185. package/src/unsendMessage.js +39 -0
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return async function shareContact(text, senderID, threadID, callback) {
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+ if (!callback) {
15
+ callback = function (err, data) {
16
+ if (err) return rejectFunc(err);
17
+ resolveFunc(data);
18
+ data };
19
+ }
20
+ let count_req = 0
21
+ var form = JSON.stringify({
22
+ "app_id": "2220391788200892",
23
+ "payload": JSON.stringify({
24
+ tasks: [{
25
+ label: '359',
26
+ payload: JSON.stringify({
27
+ "contact_id": senderID,
28
+ "sync_group": 1,
29
+ "text": text || "",
30
+ "thread_id": threadID
31
+ }),
32
+ queue_name: 'messenger_contact_sharing',
33
+ task_id: Math.random() * 1001 << 0,
34
+ failure_count: null,
35
+ }],
36
+ epoch_id: utils.generateOfflineThreadingID(),
37
+ version_id: '7214102258676893',
38
+ }),
39
+ "request_id": ++count_req,
40
+ "type": 3
41
+ });
42
+ mqttClient.publish('/ls_req',form)
43
+
44
+ return returnPromise;
45
+ };
46
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return async function shareLink(text, url, threadID, callback) {
8
+ if (!ctx.mqttClient) {
9
+ throw new Error("Not connected to MQTT");
10
+ }
11
+
12
+ var resolveFunc = function () {};
13
+ var rejectFunc = function () {};
14
+ var returnPromise = new Promise(function (resolve, reject) {
15
+ resolveFunc = resolve;
16
+ rejectFunc = reject;
17
+ });
18
+ if (!callback) {
19
+ callback = function (err, data) {
20
+ if (err) return rejectFunc(err);
21
+ resolveFunc(data);
22
+ };
23
+ }
24
+ let count_req = 0;
25
+ ctx.mqttClient.publish(
26
+ "/ls_req",
27
+ JSON.stringify({
28
+ app_id: "2220391788200892",
29
+ payload: JSON.stringify({
30
+ tasks: [
31
+ {
32
+ label: 46,
33
+ payload: JSON.stringify({
34
+ otid: utils.generateOfflineThreadingID(),
35
+ source: 524289,
36
+ sync_group: 1,
37
+ send_type: 6,
38
+ mark_thread_read: 0,
39
+ url: url || "",
40
+ text: text || "",
41
+ thread_id: threadID,
42
+ initiating_source: 0,
43
+ }),
44
+ queue_name: threadID,
45
+ task_id: (Math.random() * 1001) << 0,
46
+ failure_count: null,
47
+ },
48
+ ],
49
+ epoch_id: utils.generateOfflineThreadingID(),
50
+ version_id: "7191105584331330",
51
+ }),
52
+ request_id: ++count_req,
53
+ type: 3,
54
+ }),
55
+ {
56
+ qos: 1,
57
+ retain: false,
58
+ },
59
+ );
60
+ return returnPromise;
61
+ };
62
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ module.exports = function (_defaultFuncs, _api, _ctx) {
4
+ // Currently the only colors that can be passed to api.changeThreadColor(); may change if Facebook adds more
5
+ return {
6
+
7
+ //#region This part is for backward compatibly
8
+ //trying to match the color one-by-one. kill me plz
9
+ MessengerBlue: "196241301102133", //DefaultBlue
10
+ Viking: "1928399724138152", //TealBlue
11
+ GoldenPoppy: "174636906462322", //Yellow
12
+ RadicalRed: "2129984390566328", //Red
13
+ Shocking: "2058653964378557", //LavenderPurple
14
+ FreeSpeechGreen: "2136751179887052", //Green
15
+ Pumpkin: "175615189761153", //Orange
16
+ LightCoral: "980963458735625", //CoralPink
17
+ MediumSlateBlue: "234137870477637", //BrightPurple
18
+ DeepSkyBlue: "2442142322678320", //AquaBlue
19
+ BrilliantRose: "169463077092846", //HotPink
20
+ //i've tried my best, everything else can't be mapped. (or is it?) -UIRI 2020
21
+ //#endregion
22
+
23
+ DefaultBlue: "196241301102133",
24
+ HotPink: "169463077092846",
25
+ AquaBlue: "2442142322678320",
26
+ BrightPurple: "234137870477637",
27
+ CoralPink: "980963458735625",
28
+ Orange: "175615189761153",
29
+ Green: "2136751179887052",
30
+ LavenderPurple: "2058653964378557",
31
+ Red: "2129984390566328",
32
+ Yellow: "174636906462322",
33
+ TealBlue: "1928399724138152",
34
+ Aqua: "417639218648241",
35
+ Mango: "930060997172551",
36
+ Berry: "164535220883264",
37
+ Citrus: "370940413392601",
38
+ Candy: "205488546921017",
39
+ //StarWars: "809305022860427" Removed.
40
+ };
41
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return function unfriend(userID, callback) {
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+
15
+ if (!callback) {
16
+ callback = function (err, friendList) {
17
+ if (err) return rejectFunc(err);
18
+ resolveFunc(friendList);
19
+ };
20
+ }
21
+
22
+ var form = {
23
+ uid: userID,
24
+ unref: "bd_friends_tab",
25
+ floc: "friends_tab",
26
+ "nctr[_mod]": "pagelet_timeline_app_collection_" + ctx.userID + ":2356318349:2"
27
+ };
28
+
29
+ defaultFuncs
30
+ .post("https://www.facebook.com/ajax/profile/removefriendconfirm.php", ctx.jar, form)
31
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
32
+ .then(function (resData) {
33
+ if (resData.error) throw resData;
34
+ return callback();
35
+ })
36
+ .catch(function (err) {
37
+ log.error("unfriend", err);
38
+ return callback(err);
39
+ });
40
+ return returnPromise;
41
+ };
42
+ };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return function unsendMessage(messageID, callback) {
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+
15
+ if (!callback) {
16
+ callback = function (err, friendList) {
17
+ if (err) return rejectFunc(err);
18
+ resolveFunc(friendList);
19
+ };
20
+ }
21
+
22
+ var form = {
23
+ message_id: messageID
24
+ };
25
+
26
+ defaultFuncs
27
+ .post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
28
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
29
+ .then(function (resData) {
30
+ if (resData.error) throw resData;
31
+ return callback();
32
+ })
33
+ .catch(function (err) {
34
+ log.error("unsendMessage", err);
35
+ return callback(err);
36
+ });
37
+ return returnPromise;
38
+ };
39
+ };