@kaikybrofc/omnizap-system 2.2.10 → 2.3.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.
- package/README.md +20 -18
- package/app/config/adminIdentity.js +1 -3
- package/app/connection/socketController.js +10 -20
- package/app/controllers/messageController.js +7 -28
- package/app/modules/aiModule/catCommand.js +29 -192
- package/app/modules/broadcastModule/noticeCommand.js +28 -97
- package/app/modules/gameModule/diceCommand.js +6 -32
- package/app/modules/playModule/playCommand.js +57 -258
- package/app/modules/quoteModule/quoteCommand.js +2 -4
- package/app/modules/rpgPokemonModule/rpgPokemonRepository.js +1 -13
- package/app/modules/statsModule/noMessageCommand.js +16 -84
- package/app/modules/statsModule/rankingCommand.js +5 -25
- package/app/modules/statsModule/rankingCommon.js +1 -9
- package/app/modules/stickerModule/convertToWebp.js +4 -27
- package/app/modules/stickerModule/stickerCommand.js +13 -24
- package/app/modules/stickerModule/stickerTextCommand.js +13 -25
- package/app/modules/stickerPackModule/autoPackCollectorService.js +16 -7
- package/app/modules/stickerPackModule/domainEventOutboxRepository.js +20 -36
- package/app/modules/stickerPackModule/domainEvents.js +2 -11
- package/app/modules/stickerPackModule/semanticReclassificationEngine.js +13 -50
- package/app/modules/stickerPackModule/semanticReclassificationEngine.test.js +2 -15
- package/app/modules/stickerPackModule/semanticThemeClusterService.js +14 -41
- package/app/modules/stickerPackModule/stickerAssetClassificationRepository.js +25 -95
- package/app/modules/stickerPackModule/stickerAssetRepository.js +12 -31
- package/app/modules/stickerPackModule/stickerAssetReprocessQueueRepository.js +13 -18
- package/app/modules/stickerPackModule/stickerAutoPackByTagsRuntime.js +284 -709
- package/app/modules/stickerPackModule/stickerClassificationBackgroundRuntime.js +27 -106
- package/app/modules/stickerPackModule/stickerClassificationService.js +46 -77
- package/app/modules/stickerPackModule/stickerDedicatedTaskWorkerRuntime.js +13 -53
- package/app/modules/stickerPackModule/stickerDomainEventBus.js +10 -16
- package/app/modules/stickerPackModule/stickerDomainEventConsumerRuntime.js +13 -34
- package/app/modules/stickerPackModule/stickerMarketplaceDriftService.js +1 -4
- package/app/modules/stickerPackModule/stickerObjectStorageService.js +26 -26
- package/app/modules/stickerPackModule/stickerPackCommandHandlers.js +32 -187
- package/app/modules/stickerPackModule/stickerPackInteractionEventRepository.js +6 -15
- package/app/modules/stickerPackModule/stickerPackItemRepository.js +6 -32
- package/app/modules/stickerPackModule/stickerPackMarketplaceService.js +12 -36
- package/app/modules/stickerPackModule/stickerPackMessageService.js +12 -40
- package/app/modules/stickerPackModule/stickerPackRepository.js +23 -66
- package/app/modules/stickerPackModule/stickerPackScoreSnapshotRepository.js +9 -21
- package/app/modules/stickerPackModule/stickerPackScoreSnapshotRuntime.js +10 -40
- package/app/modules/stickerPackModule/stickerPackService.js +50 -115
- package/app/modules/stickerPackModule/stickerPackServiceRuntime.js +2 -21
- package/app/modules/stickerPackModule/stickerPackUtils.js +13 -3
- package/app/modules/stickerPackModule/stickerStorageService.js +16 -65
- package/app/modules/stickerPackModule/stickerWorkerPipelineRuntime.js +4 -22
- package/app/modules/stickerPackModule/stickerWorkerTaskQueueRepository.js +14 -29
- package/app/modules/systemMetricsModule/pingCommand.js +9 -39
- package/app/modules/tiktokModule/tiktokCommand.js +17 -109
- package/app/modules/userModule/userCommand.js +2 -88
- package/app/observability/metrics.js +5 -16
- package/app/services/captchaService.js +1 -6
- package/app/services/dbWriteQueue.js +3 -18
- package/app/services/featureFlagService.js +2 -8
- package/app/services/newsBroadcastService.js +0 -1
- package/app/services/queueUtils.js +2 -4
- package/app/services/whatsappLoginLinkService.js +7 -9
- package/app/store/premiumUserStore.js +1 -2
- package/app/utils/antiLink/antiLinkModule.js +3 -233
- package/app/utils/logger/loggerModule.js +9 -34
- package/app/utils/systemMetrics/systemMetricsModule.js +1 -4
- package/database/init.js +1 -8
- package/docker-compose.yml +27 -27
- package/docs/seo/omnizap-seo-playbook-br-2026-02-28.md +26 -0
- package/docs/seo/satellite-page-template.md +2 -0
- package/docs/seo/satellite-pages-phase1.json +40 -177
- package/eslint.config.js +2 -15
- package/index.js +8 -36
- package/ml/clip_classifier/README.md +4 -6
- package/observability/alert-rules.yml +12 -12
- package/observability/grafana/provisioning/dashboards/dashboards.yml +1 -1
- package/package.json +6 -3
- package/public/api-docs/index.html +220 -193
- package/public/bot-whatsapp-para-grupo/index.html +291 -261
- package/public/bot-whatsapp-sem-programar/index.html +291 -261
- package/public/comandos/index.html +421 -406
- package/public/como-automatizar-avisos-no-whatsapp/index.html +291 -261
- package/public/como-criar-comandos-whatsapp/index.html +291 -261
- package/public/como-evitar-spam-no-whatsapp/index.html +291 -261
- package/public/como-moderar-grupo-whatsapp/index.html +291 -261
- package/public/como-organizar-comunidade-whatsapp/index.html +291 -261
- package/public/css/github-project-panel.css +13 -8
- package/public/css/stickers-admin.css +25 -9
- package/public/css/styles.css +23 -16
- package/public/index.html +1117 -994
- package/public/js/apps/apiDocsApp.js +17 -167
- package/public/js/apps/createPackApp.js +69 -332
- package/public/js/apps/homeApp.js +94 -74
- package/public/js/apps/loginApp.js +3 -12
- package/public/js/apps/stickersAdminApp.js +190 -181
- package/public/js/apps/stickersApp.js +496 -1397
- package/public/js/catalog.js +11 -74
- package/public/js/github-panel/components/ErrorState.js +1 -8
- package/public/js/github-panel/components/GithubProjectPanel.js +2 -9
- package/public/js/github-panel/components/SkeletonPanel.js +1 -11
- package/public/js/github-panel/components/StatCard.js +1 -7
- package/public/js/github-panel/vendor/react.js +1 -9
- package/public/js/runtime/react-runtime.js +1 -9
- package/public/licenca/index.html +104 -86
- package/public/login/index.html +315 -325
- package/public/melhor-bot-whatsapp-para-grupos/index.html +291 -261
- package/public/stickers/admin/index.html +14 -19
- package/public/stickers/create/index.html +39 -44
- package/public/stickers/index.html +96 -107
- package/public/termos-de-uso/index.html +142 -115
- package/public/user/index.html +347 -350
- package/scripts/cache-bust.mjs +5 -24
- package/scripts/generate-seo-satellite-pages.mjs +10 -13
- package/scripts/run-prettier-all.mjs +25 -0
- package/scripts/sticker-catalog-loadtest.mjs +13 -11
- package/scripts/sticker-worker-task.mjs +1 -4
- package/scripts/sync-readme-snapshot.mjs +3 -2
- package/server/controllers/stickerCatalogController.js +67 -5
- package/server/http/httpServer.js +2 -10
- package/server/routes/stickerCatalog/catalogHandlers/catalogAdminHttp.js +1 -8
- package/server/routes/stickerCatalog/catalogHandlers/catalogAuthHttp.js +1 -9
- package/server/routes/stickerCatalog/catalogHandlers/catalogPublicHttp.js +10 -11
- package/server/routes/stickerCatalog/catalogHandlers/catalogUploadHttp.js +1 -10
- package/server/routes/stickerCatalog/catalogRouter.js +11 -13
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
const FALLBACK_THUMB_URL = '/assets/images/brand-logo-128.webp';
|
|
2
|
+
const HOME_BOOTSTRAP_ENDPOINT = '/api/sticker-packs/home-bootstrap';
|
|
3
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
4
|
+
let homeBootstrapPayloadPromise = null;
|
|
5
|
+
|
|
6
|
+
const fetchHomeBootstrapPayload = async () => {
|
|
7
|
+
if (!homeBootstrapPayloadPromise) {
|
|
8
|
+
homeBootstrapPayloadPromise = fetch(HOME_BOOTSTRAP_ENDPOINT, { credentials: 'include' })
|
|
9
|
+
.then((response) => {
|
|
10
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
11
|
+
return response.json();
|
|
12
|
+
})
|
|
13
|
+
.then((payload) => payload?.data || {})
|
|
14
|
+
.catch((error) => {
|
|
15
|
+
homeBootstrapPayloadPromise = null;
|
|
16
|
+
throw error;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return homeBootstrapPayloadPromise;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const createIcon = (iconId, className = 'icon') => {
|
|
23
|
+
const wrapper = document.createElement('span');
|
|
24
|
+
wrapper.className = className;
|
|
25
|
+
wrapper.setAttribute('aria-hidden', 'true');
|
|
26
|
+
|
|
27
|
+
const svg = document.createElementNS(SVG_NS, 'svg');
|
|
28
|
+
svg.setAttribute('viewBox', '0 0 24 24');
|
|
29
|
+
svg.setAttribute('focusable', 'false');
|
|
30
|
+
|
|
31
|
+
const use = document.createElementNS(SVG_NS, 'use');
|
|
32
|
+
use.setAttribute('href', `#${iconId}`);
|
|
33
|
+
|
|
34
|
+
svg.appendChild(use);
|
|
35
|
+
wrapper.appendChild(svg);
|
|
36
|
+
return wrapper;
|
|
37
|
+
};
|
|
2
38
|
|
|
3
39
|
const shortNum = (value) =>
|
|
4
40
|
new Intl.NumberFormat('pt-BR', {
|
|
@@ -142,9 +178,7 @@ const initAuthSession = () => {
|
|
|
142
178
|
authLink.removeAttribute('aria-label');
|
|
143
179
|
clearChildren(authLink);
|
|
144
180
|
|
|
145
|
-
const icon =
|
|
146
|
-
icon.className = 'fa-solid fa-right-to-bracket';
|
|
147
|
-
icon.setAttribute('aria-hidden', 'true');
|
|
181
|
+
const icon = createIcon('icon-login');
|
|
148
182
|
|
|
149
183
|
authLink.append(icon, document.createTextNode('Entrar'));
|
|
150
184
|
|
|
@@ -188,9 +222,7 @@ const initAuthSession = () => {
|
|
|
188
222
|
const nameBubble = document.createElement('span');
|
|
189
223
|
nameBubble.className = 'nav-user-name-bubble';
|
|
190
224
|
|
|
191
|
-
const icon =
|
|
192
|
-
icon.className = 'fa-solid fa-user nav-user-icon';
|
|
193
|
-
icon.setAttribute('aria-hidden', 'true');
|
|
225
|
+
const icon = createIcon('icon-user', 'icon nav-user-icon');
|
|
194
226
|
|
|
195
227
|
const name = document.createElement('span');
|
|
196
228
|
name.className = 'nav-user-name';
|
|
@@ -209,36 +241,23 @@ const initAuthSession = () => {
|
|
|
209
241
|
}
|
|
210
242
|
};
|
|
211
243
|
|
|
212
|
-
return runAfterLoadIdle(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
244
|
+
return runAfterLoadIdle(
|
|
245
|
+
() => {
|
|
246
|
+
fetchHomeBootstrapPayload()
|
|
247
|
+
.then((bootstrapData) => {
|
|
248
|
+
const sessionData = bootstrapData?.session || {};
|
|
249
|
+
if (!sessionData?.authenticated || !sessionData?.user?.sub) {
|
|
250
|
+
setLoginState();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
setLoggedState(sessionData);
|
|
254
|
+
})
|
|
255
|
+
.catch(() => {
|
|
221
256
|
setLoginState();
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
.catch(() => {
|
|
227
|
-
setLoginState();
|
|
228
|
-
});
|
|
229
|
-
}, { delayMs: 160, timeoutMs: 1200 });
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const resolveSupportUrl = async () => {
|
|
233
|
-
try {
|
|
234
|
-
const response = await fetch('/api/sticker-packs/support');
|
|
235
|
-
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
236
|
-
const payload = await response.json();
|
|
237
|
-
const url = String(payload?.data?.url || '').trim();
|
|
238
|
-
return url || '';
|
|
239
|
-
} catch {
|
|
240
|
-
return '';
|
|
241
|
-
}
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
{ delayMs: 520, timeoutMs: 1200 },
|
|
260
|
+
);
|
|
242
261
|
};
|
|
243
262
|
|
|
244
263
|
const initAddBotCtas = () => {
|
|
@@ -263,18 +282,22 @@ const initAddBotCtas = () => {
|
|
|
263
282
|
return true;
|
|
264
283
|
};
|
|
265
284
|
|
|
266
|
-
return runAfterLoadIdle(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
285
|
+
return runAfterLoadIdle(
|
|
286
|
+
() => {
|
|
287
|
+
fetchHomeBootstrapPayload()
|
|
288
|
+
.then((bootstrapData) => {
|
|
289
|
+
const url = String(bootstrapData?.support?.url || '').trim();
|
|
290
|
+
const applied = applyLink(url);
|
|
291
|
+
if (!applied && floatButton) {
|
|
292
|
+
floatButton.hidden = true;
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
.catch(() => {
|
|
296
|
+
if (floatButton) floatButton.hidden = true;
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
{ delayMs: 480, timeoutMs: 1400 },
|
|
300
|
+
);
|
|
278
301
|
};
|
|
279
302
|
|
|
280
303
|
const initSocialProof = () => {
|
|
@@ -293,7 +316,9 @@ const initSocialProof = () => {
|
|
|
293
316
|
};
|
|
294
317
|
|
|
295
318
|
const normalizeStatus = (value) => {
|
|
296
|
-
const normalized = String(value || '')
|
|
319
|
+
const normalized = String(value || '')
|
|
320
|
+
.trim()
|
|
321
|
+
.toLowerCase();
|
|
297
322
|
if (!normalized) return 'pronto';
|
|
298
323
|
if (['online', 'ok', 'healthy'].includes(normalized)) return 'online';
|
|
299
324
|
if (['connecting', 'opening', 'reconnecting'].includes(normalized)) return 'conectando';
|
|
@@ -301,32 +326,27 @@ const initSocialProof = () => {
|
|
|
301
326
|
return 'pronto';
|
|
302
327
|
};
|
|
303
328
|
|
|
304
|
-
return runAfterLoadIdle(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
})
|
|
326
|
-
.catch(() => {
|
|
327
|
-
setFallback();
|
|
328
|
-
});
|
|
329
|
-
}, { delayMs: 260, timeoutMs: 1500 });
|
|
329
|
+
return runAfterLoadIdle(
|
|
330
|
+
() => {
|
|
331
|
+
fetchHomeBootstrapPayload()
|
|
332
|
+
.then((bootstrapData) => {
|
|
333
|
+
const stats = bootstrapData?.stats || {};
|
|
334
|
+
const summary = bootstrapData?.system_summary || {};
|
|
335
|
+
|
|
336
|
+
animateCountUp(packsEl, Number(stats.packs_total || 0));
|
|
337
|
+
animateCountUp(stickersEl, Number(stats.stickers_total || 0));
|
|
338
|
+
animateCountUp(groupsEl, Number(summary?.platform?.total_groups || 0));
|
|
339
|
+
|
|
340
|
+
if (statusEl) {
|
|
341
|
+
statusEl.textContent = `bot ${normalizeStatus(summary?.system_status || summary?.bot?.connection_status)}`;
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
.catch(() => {
|
|
345
|
+
setFallback();
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
{ delayMs: 620, timeoutMs: 1500 },
|
|
349
|
+
);
|
|
330
350
|
};
|
|
331
351
|
|
|
332
352
|
const registerCleanup = (cleanups, cleanup) => {
|
|
@@ -146,18 +146,12 @@ if (root) {
|
|
|
146
146
|
|
|
147
147
|
const renderHint = () => {
|
|
148
148
|
if (!state.hint.hasPayload) {
|
|
149
|
-
setText(
|
|
150
|
-
ui.hint,
|
|
151
|
-
'Voce abriu esta pagina direto. Por seguranca, gere seu link no WhatsApp clicando no botao abaixo e enviando "iniciar".',
|
|
152
|
-
);
|
|
149
|
+
setText(ui.hint, 'Voce abriu esta pagina direto. Por seguranca, gere seu link no WhatsApp clicando no botao abaixo e enviando "iniciar".');
|
|
153
150
|
return;
|
|
154
151
|
}
|
|
155
152
|
|
|
156
153
|
if (!state.hint.phone) {
|
|
157
|
-
setText(
|
|
158
|
-
ui.hint,
|
|
159
|
-
'Este link nao trouxe um numero de WhatsApp valido. Ele pode ter sido alterado ou expirado. Gere um novo link enviando "iniciar".',
|
|
160
|
-
);
|
|
154
|
+
setText(ui.hint, 'Este link nao trouxe um numero de WhatsApp valido. Ele pode ter sido alterado ou expirado. Gere um novo link enviando "iniciar".');
|
|
161
155
|
return;
|
|
162
156
|
}
|
|
163
157
|
|
|
@@ -193,10 +187,7 @@ if (root) {
|
|
|
193
187
|
}
|
|
194
188
|
|
|
195
189
|
if (state.hint.phone) {
|
|
196
|
-
setText(
|
|
197
|
-
ui.summaryOwner,
|
|
198
|
-
`Numero detectado: +${formatPhone(state.hint.phone)}. Clique no botao do Google para concluir o vinculo.`,
|
|
199
|
-
);
|
|
190
|
+
setText(ui.summaryOwner, `Numero detectado: +${formatPhone(state.hint.phone)}. Clique no botao do Google para concluir o vinculo.`);
|
|
200
191
|
renderWhatsAppCta();
|
|
201
192
|
return;
|
|
202
193
|
}
|