@kaikybrofc/omnizap-system 2.3.4 → 2.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +14 -14
  2. package/app/modules/stickerModule/stickerCommand.js +1 -6
  3. package/app/modules/stickerModule/stickerTextCommand.js +1 -6
  4. package/package.json +1 -1
  5. package/public/index.html +8 -8
  6. package/public/js/apps/homeApp.js +22 -18
  7. package/public/js/apps/loginApp.js +3 -1
  8. package/public/js/apps/userProfileApp.js +0 -9
  9. package/public/user/index.html +224 -120
  10. package/server/controllers/admin/adminBanService.js +138 -0
  11. package/server/controllers/admin/adminPanelHandlers.js +1965 -0
  12. package/server/controllers/{systemAdminController.js → admin/systemAdminController.js} +2 -2
  13. package/server/controllers/{stickerCatalogController.js → sticker/stickerCatalogController.js} +129 -2116
  14. package/server/controllers/userController.js +1 -1
  15. package/server/routes/admin/systemAdminRouter.js +1 -1
  16. package/server/routes/indexRouter.js +3 -3
  17. package/server/routes/{stickerCatalog → sticker}/stickerApiRouter.js +1 -1
  18. package/server/routes/{stickerCatalog → sticker}/stickerDataRouter.js +1 -1
  19. package/server/routes/{stickerCatalog → sticker}/stickerSiteRouter.js +1 -1
  20. /package/server/controllers/{stickerCatalog → sticker}/nonCatalogHandlers.js +0 -0
  21. /package/server/routes/{stickerCatalog → sticker}/catalogHandlers/catalogAdminHttp.js +0 -0
  22. /package/server/routes/{stickerCatalog → sticker}/catalogHandlers/catalogAuthHttp.js +0 -0
  23. /package/server/routes/{stickerCatalog → sticker}/catalogHandlers/catalogPublicHttp.js +0 -0
  24. /package/server/routes/{stickerCatalog → sticker}/catalogHandlers/catalogUploadHttp.js +0 -0
  25. /package/server/routes/{stickerCatalog → sticker}/catalogRouter.js +0 -0
package/README.md CHANGED
@@ -78,27 +78,27 @@ Este bloco pode ser atualizado automaticamente pela API (`/api/sticker-packs/rea
78
78
  <!-- README_SNAPSHOT:START -->
79
79
  ### Snapshot do Sistema
80
80
 
81
- > Atualizado em `2026-03-01T08:23:02.911Z` | cache `1800s`
81
+ > Atualizado em `2026-03-02T03:59:47.711Z` | cache `1800s`
82
82
 
83
83
  | Métrica | Valor |
84
84
  | --- | ---: |
85
- | Usuários (lid_map) | 5.518 |
86
- | Grupos | 116 |
87
- | Packs | 309 |
88
- | Stickers | 7.334 |
89
- | Mensagens registradas | 447.648 |
85
+ | Usuários (lid_map) | 5.529 |
86
+ | Grupos | 118 |
87
+ | Packs | 318 |
88
+ | Stickers | 8.020 |
89
+ | Mensagens registradas | 453.847 |
90
90
 
91
91
  #### Tipos de mensagem mais usados (amostra: 25.000)
92
92
  | Tipo | Total |
93
93
  | --- | ---: |
94
- | `texto` | 16.014 |
95
- | `figurinha` | 4.502 |
96
- | `reacao` | 1.680 |
97
- | `imagem` | 1.390 |
98
- | `outros` | 1.000 |
99
- | `video` | 226 |
100
- | `audio` | 180 |
101
- | `documento` | 8 |
94
+ | `texto` | 15.317 |
95
+ | `figurinha` | 4.895 |
96
+ | `reacao` | 1.810 |
97
+ | `imagem` | 1.511 |
98
+ | `outros` | 1.079 |
99
+ | `video` | 205 |
100
+ | `audio` | 178 |
101
+ | `documento` | 5 |
102
102
 
103
103
  <details><summary>Comandos disponíveis (62)</summary>
104
104
 
@@ -223,12 +223,7 @@ function buildAutoPackNoticeText(result, commandPrefix = DEFAULT_COMMAND_PREFIX)
223
223
  return duplicateLines.join('\n');
224
224
  }
225
225
 
226
- const savedLines = [
227
- `✅ Figurinha adicionada ao pack *${packName}*${countLabel}.`,
228
- '',
229
- `📋 Gerencie seus packs com *${commandPrefix}pack list*.`,
230
- `🚀 Envie agora com *${commandPrefix}pack send ${packCommandTarget}*.`,
231
- ];
226
+ const savedLines = [`✅ Figurinha adicionada ao pack *${packName}*${countLabel}.`, '', `📋 Gerencie seus packs com *${commandPrefix}pack list*.`, `🚀 Envie agora com *${commandPrefix}pack send ${packCommandTarget}*.`];
232
227
  if (packWebUrl) {
233
228
  savedLines.push(`🌐 Veja no site: ${packWebUrl}`);
234
229
  } else {
@@ -150,12 +150,7 @@ function buildAutoPackNoticeText(result, commandPrefix = DEFAULT_COMMAND_PREFIX)
150
150
  return duplicateLines.join('\n');
151
151
  }
152
152
 
153
- const savedLines = [
154
- `✅ Figurinha adicionada ao pack *${packName}*${countLabel}.`,
155
- '',
156
- `📋 Gerencie seus packs com *${commandPrefix}pack list*.`,
157
- `🚀 Envie agora com *${commandPrefix}pack send ${packCommandTarget}*.`,
158
- ];
153
+ const savedLines = [`✅ Figurinha adicionada ao pack *${packName}*${countLabel}.`, '', `📋 Gerencie seus packs com *${commandPrefix}pack list*.`, `🚀 Envie agora com *${commandPrefix}pack send ${packCommandTarget}*.`];
159
154
  if (packWebUrl) {
160
155
  savedLines.push(`🌐 Veja no site: ${packWebUrl}`);
161
156
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaikybrofc/omnizap-system",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "Sistema profissional de automação WhatsApp com tecnologia Baileys",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
package/public/index.html CHANGED
@@ -880,20 +880,20 @@
880
880
 
881
881
  <div class="proof-grid" aria-label="Prova social">
882
882
  <article class="proof">
883
- <strong id="proof-bots-online">--</strong>
884
- <span>bots online agora</span>
883
+ <strong id="proof-users-total">--</strong>
884
+ <span>usuarios no sistema</span>
885
885
  </article>
886
886
  <article class="proof">
887
- <strong id="proof-messages-today">--</strong>
888
- <span>mensagens hoje</span>
887
+ <strong id="proof-messages-total">--</strong>
888
+ <span>mensagens totais</span>
889
889
  </article>
890
890
  <article class="proof">
891
- <strong id="proof-spam-blocked">--</strong>
892
- <span>spam bloqueado hoje</span>
891
+ <strong id="proof-commands-total">--</strong>
892
+ <span>comandos usados totais</span>
893
893
  </article>
894
894
  <article class="proof">
895
- <strong id="proof-uptime">--</strong>
896
- <span>uptime do bot</span>
895
+ <strong id="proof-system-latency">--</strong>
896
+ <span>latencia do sistema</span>
897
897
  </article>
898
898
  </div>
899
899
  </div>
@@ -462,19 +462,19 @@ const initAddBotCtas = () => {
462
462
  };
463
463
 
464
464
  const initSocialProof = () => {
465
- const botsOnlineEl = document.getElementById('proof-bots-online');
466
- const messagesTodayEl = document.getElementById('proof-messages-today');
467
- const spamBlockedEl = document.getElementById('proof-spam-blocked');
468
- const uptimeEl = document.getElementById('proof-uptime');
465
+ const usersTotalEl = document.getElementById('proof-users-total');
466
+ const messagesTotalEl = document.getElementById('proof-messages-total');
467
+ const commandsTotalEl = document.getElementById('proof-commands-total');
468
+ const latencyEl = document.getElementById('proof-system-latency');
469
469
  const statusEl = document.getElementById('proof-status');
470
470
 
471
- if (!botsOnlineEl || !messagesTodayEl || !spamBlockedEl || !uptimeEl) return null;
471
+ if (!usersTotalEl || !messagesTotalEl || !commandsTotalEl || !latencyEl) return null;
472
472
 
473
473
  const setFallback = () => {
474
- botsOnlineEl.textContent = 'n/d';
475
- messagesTodayEl.textContent = 'n/d';
476
- spamBlockedEl.textContent = 'n/d';
477
- uptimeEl.textContent = 'n/d';
474
+ usersTotalEl.textContent = 'n/d';
475
+ messagesTotalEl.textContent = 'n/d';
476
+ commandsTotalEl.textContent = 'n/d';
477
+ latencyEl.textContent = 'n/d';
478
478
  if (statusEl) statusEl.textContent = 'bot pronto';
479
479
  };
480
480
 
@@ -504,20 +504,24 @@ const initSocialProof = () => {
504
504
  animateCountUp(element, numeric);
505
505
  };
506
506
 
507
+ const setLatencyMetric = (element, value) => {
508
+ const numeric = Number(value);
509
+ if (!Number.isFinite(numeric)) {
510
+ element.textContent = 'n/d';
511
+ return;
512
+ }
513
+ element.textContent = `${Math.max(0, Math.round(numeric))} ms`;
514
+ };
515
+
507
516
  const refreshMetrics = async ({ forceRefresh = false, animate = false } = {}) => {
508
517
  const bootstrapData = await fetchHomeBootstrapPayload({ forceRefresh });
509
518
  const summary = bootstrapData?.system_summary || {};
510
519
  const realtime = bootstrapData?.home_realtime || {};
511
520
 
512
- const botsOnline = Number(realtime?.bots_online);
513
- const messagesToday = Number(realtime?.messages_today);
514
- const spamBlockedToday = Number(realtime?.spam_blocked_today);
515
- const uptime = String(realtime?.uptime || summary?.process?.uptime || '').trim() || 'n/d';
516
-
517
- setNumericMetric(botsOnlineEl, botsOnline, { animate });
518
- setNumericMetric(messagesTodayEl, messagesToday, { animate });
519
- setNumericMetric(spamBlockedEl, spamBlockedToday, { animate });
520
- uptimeEl.textContent = uptime;
521
+ setNumericMetric(usersTotalEl, realtime?.total_users, { animate });
522
+ setNumericMetric(messagesTotalEl, realtime?.total_messages, { animate });
523
+ setNumericMetric(commandsTotalEl, realtime?.total_commands, { animate });
524
+ setLatencyMetric(latencyEl, realtime?.system_latency_ms);
521
525
 
522
526
  if (statusEl) {
523
527
  statusEl.textContent = `bot ${normalizeStatus(summary?.system_status || summary?.bot?.connection_status)}`;
@@ -72,7 +72,9 @@ if (root) {
72
72
  const isAuthenticatedGoogleSession = (sessionData) => {
73
73
  if (!sessionData || typeof sessionData !== 'object') return false;
74
74
  if (!isAuthenticatedFlagEnabled(sessionData.authenticated)) return false;
75
- const provider = String(sessionData.provider || '').trim().toLowerCase();
75
+ const provider = String(sessionData.provider || '')
76
+ .trim()
77
+ .toLowerCase();
76
78
  if (provider && provider !== 'google') return false;
77
79
  const ownerJid = String(sessionData.owner_jid || '').trim();
78
80
  const userSub = String(sessionData?.user?.sub || '').trim();
@@ -21,10 +21,6 @@ if (root) {
21
21
  metricStickers: document.getElementById('metric-stickers'),
22
22
  metricDownloads: document.getElementById('metric-downloads'),
23
23
  metricLikes: document.getElementById('metric-likes'),
24
- summary: document.getElementById('user-summary'),
25
- ownerJid: document.getElementById('user-owner-jid'),
26
- googleSub: document.getElementById('user-google-sub'),
27
- expiresAt: document.getElementById('user-expires-at'),
28
24
  actions: document.getElementById('user-actions'),
29
25
  chatLink: document.getElementById('user-chat-link'),
30
26
  logoutBtn: document.getElementById('user-logout-btn'),
@@ -150,12 +146,7 @@ if (root) {
150
146
  };
151
147
  }
152
148
 
153
- setText(ui.ownerJid, ownerJid || 'n/d');
154
- setText(ui.googleSub, String(user?.sub || '').trim() || 'n/d');
155
- setText(ui.expiresAt, formatDateTime(sessionData?.expires_at));
156
-
157
149
  if (ui.profile) ui.profile.hidden = false;
158
- if (ui.summary) ui.summary.hidden = false;
159
150
  if (ui.actions) ui.actions.hidden = false;
160
151
  };
161
152