fca-priyansh 19.0.0 → 20.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 (135) hide show
  1. package/.gitlab-ci.yml +22 -0
  2. package/CountTime.json +1 -0
  3. package/Extra/Balancer.js +49 -49
  4. package/Extra/BroadcastSystem.js +1 -0
  5. package/Extra/Bypass/956/index.js +233 -233
  6. package/Extra/Bypass/test/aaaa.json +169 -169
  7. package/Extra/Bypass/test/index.js +187 -187
  8. package/Extra/Database/index.js +468 -468
  9. package/Extra/ExtraAddons.js +82 -82
  10. package/Extra/ExtraFindUID.js +61 -61
  11. package/Extra/ExtraGetThread.js +365 -365
  12. package/Extra/ExtraScreenShot.js +430 -430
  13. package/Extra/ExtraUptimeRobot.js +142 -38
  14. package/Extra/Html/Classic/script.js +118 -118
  15. package/Extra/Html/Classic/style.css +7 -7
  16. package/Extra/Security/Base/Step_1.js +5 -5
  17. package/Extra/Security/Base/Step_2.js +22 -22
  18. package/Extra/Security/Base/Step_3.js +22 -22
  19. package/Extra/Security/Base/index.js +190 -190
  20. package/Extra/Security/Index.js +4 -4
  21. package/Extra/Security/Step_1.js +5 -5
  22. package/Extra/Security/Step_2.js +22 -22
  23. package/Extra/Security/Step_3.js +22 -22
  24. package/Extra/Src/Change_Environment.js +24 -24
  25. package/Extra/Src/Check_Update.js +66 -66
  26. package/Extra/Src/History.js +114 -114
  27. package/Extra/Src/Instant_Update.js +64 -64
  28. package/Extra/Src/Last-Run.js +64 -64
  29. package/Extra/Src/Premium.js +81 -81
  30. package/Extra/Src/Websocket.js +212 -212
  31. package/Extra/Src/uuid.js +137 -137
  32. package/Func/AcceptAgreement.js +31 -31
  33. package/Func/ClearCache.js +64 -64
  34. package/Func/ReportV1.js +54 -54
  35. package/LICENSE +21 -21
  36. package/Language/index.json +228 -228
  37. package/Main.js +1 -1290
  38. package/README.md +198 -198
  39. package/broadcast.js +1 -44
  40. package/errorHandler.js +151 -0
  41. package/index.js +1 -448
  42. package/logger.js +69 -66
  43. package/package.json +99 -98
  44. package/src/Dev_Horizon_Data.js +124 -124
  45. package/src/Dev_getThreadInfoOLD.js +421 -421
  46. package/src/Dev_shareTest2.js +68 -68
  47. package/src/Dev_shareTest3.js +71 -71
  48. package/src/Premium.js +24 -24
  49. package/src/Screenshot.js +82 -82
  50. package/src/addExternalModule.js +16 -16
  51. package/src/addUserToGroup.js +79 -79
  52. package/src/changeAdminStatus.js +79 -79
  53. package/src/changeArchivedStatus.js +41 -41
  54. package/src/changeAvt.js +84 -84
  55. package/src/changeBio.js +65 -65
  56. package/src/changeBlockedStatus.js +36 -36
  57. package/src/changeGroupImage.js +106 -106
  58. package/src/changeNickname.js +45 -45
  59. package/src/changeThreadColor.js +62 -62
  60. package/src/changeThreadEmoji.js +42 -42
  61. package/src/changeThreadTheme.js +263 -0
  62. package/src/comment.js +244 -0
  63. package/src/createNewGroup.js +70 -70
  64. package/src/createPoll.js +60 -60
  65. package/src/deleteMessage.js +45 -45
  66. package/src/deleteThread.js +43 -43
  67. package/src/editMessage.js +71 -53
  68. package/src/follow.js +119 -0
  69. package/src/forwardAttachment.js +48 -48
  70. package/src/friend.js +383 -0
  71. package/src/getAccessToken.js +27 -27
  72. package/src/getCurrentUserID.js +7 -7
  73. package/src/getEmojiUrl.js +27 -27
  74. package/src/getFriendsList.js +73 -73
  75. package/src/getMessage.js +102 -102
  76. package/src/getPendingFriendRequests.js +45 -0
  77. package/src/getThreadHistory.js +537 -537
  78. package/src/getThreadInfo.js +424 -423
  79. package/src/getThreadInfoOLD.js +421 -421
  80. package/src/getThreadList.js +213 -213
  81. package/src/getThreadMain.js +219 -219
  82. package/src/getThreadPictures.js +59 -59
  83. package/src/getUID.js +58 -58
  84. package/src/getUserID.js +62 -62
  85. package/src/getUserInfo.js +112 -112
  86. package/src/getUserInfoMain.js +64 -64
  87. package/src/getUserInfoV2.js +31 -31
  88. package/src/getUserInfoV3.js +62 -62
  89. package/src/getUserInfoV4.js +54 -54
  90. package/src/getUserInfoV5.js +60 -60
  91. package/src/handleFriendRequest.js +46 -46
  92. package/src/handleMessageRequest.js +49 -49
  93. package/src/httpGet.js +49 -49
  94. package/src/httpPost.js +48 -48
  95. package/src/httpPostFormData.js +40 -40
  96. package/src/listenMqtt.js +1 -956
  97. package/src/listenMqttV1.js +832 -846
  98. package/src/logout.js +68 -68
  99. package/src/markAsDelivered.js +48 -48
  100. package/src/markAsRead.js +70 -70
  101. package/src/markAsReadAll.js +42 -42
  102. package/src/markAsSeen.js +51 -51
  103. package/src/muteThread.js +47 -47
  104. package/src/notes.js +279 -0
  105. package/src/removeUserFromGroup.js +49 -49
  106. package/src/resolvePhotoUrl.js +37 -37
  107. package/src/searchForThread.js +43 -43
  108. package/src/sendMention.js +325 -0
  109. package/src/sendMessage.js +1 -386
  110. package/src/sendMqttMessage.js +70 -70
  111. package/src/sendTypingIndicator.js +79 -80
  112. package/src/setMessageReaction.js +109 -109
  113. package/src/setPostReaction.js +101 -101
  114. package/src/setTitle.js +74 -74
  115. package/src/share.js +98 -0
  116. package/src/shareContact.js +55 -55
  117. package/src/shareLink.js +58 -58
  118. package/src/stickers.js +525 -0
  119. package/src/story.js +267 -0
  120. package/src/threadColors.js +38 -38
  121. package/src/unfriend.js +43 -43
  122. package/src/unsendMessage.js +47 -47
  123. package/src/unsendMqttMessage.js +65 -65
  124. package/test/data/shareAttach.js +146 -146
  125. package/test/data/test.txt +7 -7
  126. package/test/example-config.json +18 -18
  127. package/test/test-page.js +140 -140
  128. package/test/test.js +385 -385
  129. package/test/testv2.js +2 -2
  130. package/userAgentManager.js +129 -0
  131. package/utils.js +1 -3077
  132. package/.github/workflows/publish.yml +0 -20
  133. package/Extra/Src/Release_Memory.js +0 -160
  134. package/Extra/Src/test.js +0 -28
  135. package/SECURITY.md +0 -17
@@ -1,20 +0,0 @@
1
- name: "publish npm"
2
-
3
- on: push
4
-
5
- jobs:
6
- publish:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - name: checkout
10
- uses: actions/checkout@v2
11
- - name: node
12
- uses: actions/setup-node@v2
13
- with:
14
- node-version: 14
15
- registry-url: https://registry.npmjs.org
16
- - name: publish
17
- run: npm publish --access public
18
- # working-directory: package.json
19
- env:
20
- NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
@@ -1,160 +0,0 @@
1
- /* eslint-disable linebreak-style */
2
- const fs = require('fs');
3
- const path = require('path');
4
- const v8 = require('v8');
5
- const EventEmitter = require('events');
6
-
7
- class MemoryManager extends EventEmitter {
8
- constructor(options = {}) {
9
- super();
10
- this.thresholds = {
11
- warning: options.warningThreshold || 0.7,
12
- release: options.releaseThreshold || 0.8,
13
- max: options.maxThreshold || 0.9,
14
- };
15
- this.interval = options.interval || 5000;
16
- this.logLevel = options.logLevel || 'info';
17
- this.logFile = options.logFile || path.join(__dirname, 'memory.log');
18
- this.allowLog = options.allowLog || true;
19
- this.weakRefs = new WeakMap();
20
- this.smartReleaseEnabled = options.smartReleaseEnabled || false;
21
- this.memoryUsageHistory = [];
22
- }
23
-
24
- start() {
25
- this.intervalId = setInterval(() => {
26
- const memoryUsage = this.getMemoryUsage();
27
- this.logMemoryUsage(memoryUsage);
28
-
29
- if (memoryUsage > this.thresholds.warning) {
30
- this.emit('memoryWarning', memoryUsage);
31
- }
32
-
33
- if (memoryUsage > this.thresholds.release) {
34
- this.releaseMemory(memoryUsage);
35
- }
36
-
37
- if (memoryUsage > this.thresholds.max) {
38
- this.emit('memoryMax', memoryUsage);
39
- }
40
-
41
- if (this.smartReleaseEnabled) {
42
- this.memoryUsageHistory.push(memoryUsage);
43
- this.smartRelease();
44
- }
45
- }, this.interval);
46
- }
47
-
48
- stop() {
49
- clearInterval(this.intervalId);
50
- }
51
-
52
- getMemoryUsage() {
53
- const heapStats = v8.getHeapStatistics();
54
- const totalHeapSize = heapStats.total_available_size / 1024 / 1024;
55
- const usedHeapSize = heapStats.used_heap_size / 1024 / 1024;
56
- return usedHeapSize / totalHeapSize;
57
- }
58
-
59
- releaseMemory(memoryUsage) {
60
- if (global.gc) {
61
- global.gc();
62
- } else {
63
- v8.setFlagsFromString('--expose_gc');
64
- const vm = require('vm');
65
- vm.runInNewContext('gc')();
66
- }
67
- this.emit('memoryReleased', memoryUsage);
68
- }
69
-
70
- logMemoryUsage(memoryUsage) {
71
- const timestamp = new Date().toLocaleString("in-en", {timeZone: "Asia/Kolkata"});
72
- const logMessage = `${timestamp} - Memory usage: ${(memoryUsage * 100).toFixed(2)}%`;
73
-
74
- switch (this.logLevel) {
75
- case 'debug':
76
- console.debug(logMessage);
77
- break;
78
- case 'info':
79
- global.Fca.Require.logger.Info(logMessage);
80
- break;
81
- case 'warn':
82
- global.Fca.Require.logger.Normal(logMessage);
83
- break;
84
- case 'error':
85
- global.Fca.Require.logger.Error(logMessage);
86
- break;
87
- default:
88
- global.Fca.Require.logger.Normal(logMessage);
89
- }
90
- if (this.allowLog) {
91
- fs.appendFile(this.logFile, `${logMessage}\n`, (err) => {
92
- if (err) throw err;
93
- });
94
- }
95
- }
96
-
97
- onMaxMemory(callback) {
98
- this.on('memoryMax', callback);
99
- }
100
-
101
- addMemoryUsageListener(callback) {
102
- this.on('memoryWarning', callback);
103
- this.on('memoryReleased', callback);
104
- this.on('memoryMax', callback);
105
- }
106
-
107
- removeMemoryUsageListener(callback) {
108
- this.off('memoryWarning', callback);
109
- this.off('memoryReleased', callback);
110
- this.off('memoryMax', callback);
111
- }
112
-
113
- addThreshold(type, value) {
114
- if (type === 'warning' || type === 'release' || type === 'max') {
115
- this.thresholds[type] = value;
116
- } else {
117
- throw new Error('Invalid threshold type');
118
- }
119
- }
120
-
121
- removeThreshold(type) {
122
- if (type === 'warning' || type === 'release' || type === 'max') {
123
- delete this.thresholds[type];
124
- } else {
125
- throw new Error('Invalid threshold type');
126
- }
127
- }
128
-
129
- smartRelease() {
130
- const memoryUsageHistory = this.memoryUsageHistory.slice(-100);
131
- const averageUsage = memoryUsageHistory.reduce((sum, usage) => sum + usage, 0) / memoryUsageHistory.length;
132
- const maxUsage = Math.max(...memoryUsageHistory);
133
-
134
- if (averageUsage > this.thresholds.release && maxUsage > this.thresholds.max) {
135
- this.releaseMemory(maxUsage);
136
- }
137
- }
138
-
139
- autoStart(interval) { //1h
140
- this.stopMemoryManager();
141
- this.startMemoryManager();
142
- this.autoStartInterval = setInterval(() => {
143
- this.stopMemoryManager();
144
- this.startMemoryManager();
145
- }, interval);
146
- }
147
-
148
- stopMemoryManager() {
149
- this.stop();
150
- clearInterval(this.intervalId);
151
- clearInterval(this.autoStartInterval);
152
- }
153
-
154
- startMemoryManager() {
155
- this.start();
156
- }
157
-
158
- }
159
-
160
- module.exports = MemoryManager;
package/Extra/Src/test.js DELETED
@@ -1,28 +0,0 @@
1
- const MemoryManager = require('./Release_Memory');
2
- const path = require('path');
3
-
4
- // Tạo một đối tượng MemoryManager với các tùy chọn cấu hình tối ưu
5
- const memoryManager = new MemoryManager({
6
- warningThreshold: 0.6, // Ngưỡng cảnh báo sử dụng bộ nhớ (60%)
7
- releaseThreshold: 0.7, // Ngưỡng giải phóng bộ nhớ (70%)
8
- maxThreshold: 0.8, // Ngưỡng tối đa sử dụng bộ nhớ (80%)
9
- interval: 30000, // Khoảng thời gian kiểm tra bộ nhớ (30 giây)
10
- logLevel: 'warn', // Chỉ ghi nhật ký khi có cảnh báo hoặc lỗi
11
- logFile: path.join(__dirname, 'memory.log'), // Tệp nhật ký
12
- smartReleaseEnabled: true, // Bật tính năng giải phóng bộ nhớ thông minh
13
- });
14
-
15
- memoryManager.addMemoryUsageListener((memoryUsage) => {
16
- console.log(`Memory released: ${(memoryUsage * 100).toFixed(2)}%`);
17
- });
18
-
19
-
20
- // Bắt đầu quá trình quản lý bộ nhớ tự động
21
- memoryManager.autoStart(3600000); // 1 giờ
22
-
23
-
24
- // Lưu trữ dữ liệu quan trọng trong WeakMap
25
- const importantData = { sensitive: 'data' };
26
- memoryManager.weakRefs.set('aaaaaaaaa', importantData);
27
-
28
- console.log(memoryManager.weakRefs.get('aaaaaaaaa'))
package/SECURITY.md DELETED
@@ -1,17 +0,0 @@
1
- # Security Policy
2
-
3
- + if have any Vulnerability finded contact: Author(Priyansh) or (Facebook.com/Priyanshu.Rajput.Official). Thanks!
4
-
5
- ## Supported Versions
6
-
7
- Use this section to tell people about which versions of your project are
8
- currently being supported with security updates.
9
-
10
- | Version | Supported |
11
- | ------- | ------------------ |
12
- | Main Version With Autoupdate | :white_check_mark: |
13
- | Old Version | :x:|
14
-
15
- ## Reporting a Vulnerability
16
-
17
- Contact Author