@kaikybrofc/omnizap-system 2.2.10 → 2.3.1

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 (123) hide show
  1. package/README.md +13 -13
  2. package/app/config/adminIdentity.js +1 -3
  3. package/app/connection/socketController.js +10 -20
  4. package/app/controllers/messageController.js +7 -28
  5. package/app/modules/aiModule/catCommand.js +29 -192
  6. package/app/modules/broadcastModule/noticeCommand.js +28 -97
  7. package/app/modules/gameModule/diceCommand.js +6 -32
  8. package/app/modules/playModule/playCommand.js +57 -258
  9. package/app/modules/quoteModule/quoteCommand.js +2 -4
  10. package/app/modules/rpgPokemonModule/rpgPokemonRepository.js +1 -13
  11. package/app/modules/statsModule/noMessageCommand.js +16 -84
  12. package/app/modules/statsModule/rankingCommand.js +5 -25
  13. package/app/modules/statsModule/rankingCommon.js +1 -9
  14. package/app/modules/stickerModule/convertToWebp.js +4 -27
  15. package/app/modules/stickerModule/stickerCommand.js +13 -24
  16. package/app/modules/stickerModule/stickerTextCommand.js +13 -25
  17. package/app/modules/stickerPackModule/autoPackCollectorService.js +16 -7
  18. package/app/modules/stickerPackModule/domainEventOutboxRepository.js +20 -36
  19. package/app/modules/stickerPackModule/domainEvents.js +2 -11
  20. package/app/modules/stickerPackModule/semanticReclassificationEngine.js +13 -50
  21. package/app/modules/stickerPackModule/semanticReclassificationEngine.test.js +2 -15
  22. package/app/modules/stickerPackModule/semanticThemeClusterService.js +14 -41
  23. package/app/modules/stickerPackModule/stickerAssetClassificationRepository.js +25 -95
  24. package/app/modules/stickerPackModule/stickerAssetRepository.js +12 -31
  25. package/app/modules/stickerPackModule/stickerAssetReprocessQueueRepository.js +13 -18
  26. package/app/modules/stickerPackModule/stickerAutoPackByTagsRuntime.js +284 -709
  27. package/app/modules/stickerPackModule/stickerClassificationBackgroundRuntime.js +27 -106
  28. package/app/modules/stickerPackModule/stickerClassificationService.js +46 -77
  29. package/app/modules/stickerPackModule/stickerDedicatedTaskWorkerRuntime.js +13 -53
  30. package/app/modules/stickerPackModule/stickerDomainEventBus.js +10 -16
  31. package/app/modules/stickerPackModule/stickerDomainEventConsumerRuntime.js +40 -39
  32. package/app/modules/stickerPackModule/stickerMarketplaceDriftService.js +1 -4
  33. package/app/modules/stickerPackModule/stickerObjectStorageService.js +26 -26
  34. package/app/modules/stickerPackModule/stickerPackCommandHandlers.js +32 -187
  35. package/app/modules/stickerPackModule/stickerPackInteractionEventRepository.js +6 -15
  36. package/app/modules/stickerPackModule/stickerPackItemRepository.js +6 -32
  37. package/app/modules/stickerPackModule/stickerPackMarketplaceService.js +12 -36
  38. package/app/modules/stickerPackModule/stickerPackMessageService.js +12 -40
  39. package/app/modules/stickerPackModule/stickerPackRepository.js +23 -66
  40. package/app/modules/stickerPackModule/stickerPackScoreSnapshotRepository.js +9 -21
  41. package/app/modules/stickerPackModule/stickerPackScoreSnapshotRuntime.js +10 -40
  42. package/app/modules/stickerPackModule/stickerPackService.js +50 -115
  43. package/app/modules/stickerPackModule/stickerPackServiceRuntime.js +2 -21
  44. package/app/modules/stickerPackModule/stickerPackUtils.js +13 -3
  45. package/app/modules/stickerPackModule/stickerStorageService.js +16 -65
  46. package/app/modules/stickerPackModule/stickerWorkerPipelineRuntime.js +4 -22
  47. package/app/modules/stickerPackModule/stickerWorkerTaskQueueRepository.js +14 -29
  48. package/app/modules/systemMetricsModule/pingCommand.js +9 -39
  49. package/app/modules/tiktokModule/tiktokCommand.js +17 -109
  50. package/app/modules/userModule/userCommand.js +2 -88
  51. package/app/observability/metrics.js +5 -16
  52. package/app/services/captchaService.js +1 -6
  53. package/app/services/dbWriteQueue.js +3 -18
  54. package/app/services/featureFlagService.js +2 -8
  55. package/app/services/newsBroadcastService.js +0 -1
  56. package/app/services/queueUtils.js +2 -4
  57. package/app/services/whatsappLoginLinkService.js +7 -9
  58. package/app/store/premiumUserStore.js +1 -2
  59. package/app/utils/antiLink/antiLinkModule.js +3 -233
  60. package/app/utils/logger/loggerModule.js +9 -34
  61. package/app/utils/systemMetrics/systemMetricsModule.js +1 -4
  62. package/database/index.js +1 -0
  63. package/database/init.js +1 -8
  64. package/database/migrations/20260228_0027_web_visit_event.sql +15 -0
  65. package/docker-compose.yml +27 -27
  66. package/docs/seo/omnizap-seo-playbook-br-2026-02-28.md +26 -0
  67. package/docs/seo/satellite-page-template.md +2 -0
  68. package/docs/seo/satellite-pages-phase1.json +40 -177
  69. package/eslint.config.js +2 -15
  70. package/index.js +8 -36
  71. package/ml/clip_classifier/README.md +4 -6
  72. package/observability/alert-rules.yml +12 -12
  73. package/observability/grafana/provisioning/dashboards/dashboards.yml +1 -1
  74. package/package.json +6 -3
  75. package/public/api-docs/index.html +220 -193
  76. package/public/bot-whatsapp-para-grupo/index.html +291 -261
  77. package/public/bot-whatsapp-sem-programar/index.html +291 -261
  78. package/public/comandos/index.html +421 -406
  79. package/public/como-automatizar-avisos-no-whatsapp/index.html +291 -261
  80. package/public/como-criar-comandos-whatsapp/index.html +291 -261
  81. package/public/como-evitar-spam-no-whatsapp/index.html +291 -261
  82. package/public/como-moderar-grupo-whatsapp/index.html +291 -261
  83. package/public/como-organizar-comunidade-whatsapp/index.html +291 -261
  84. package/public/css/github-project-panel.css +13 -8
  85. package/public/css/stickers-admin.css +25 -9
  86. package/public/css/styles.css +23 -16
  87. package/public/index.html +1106 -993
  88. package/public/js/apps/apiDocsApp.js +17 -167
  89. package/public/js/apps/createPackApp.js +69 -332
  90. package/public/js/apps/homeApp.js +274 -101
  91. package/public/js/apps/loginApp.js +3 -12
  92. package/public/js/apps/stickersAdminApp.js +190 -181
  93. package/public/js/apps/stickersApp.js +482 -1411
  94. package/public/js/apps/userApp.js +217 -1
  95. package/public/js/catalog.js +11 -74
  96. package/public/js/github-panel/components/ErrorState.js +1 -8
  97. package/public/js/github-panel/components/GithubProjectPanel.js +2 -9
  98. package/public/js/github-panel/components/SkeletonPanel.js +1 -11
  99. package/public/js/github-panel/components/StatCard.js +1 -7
  100. package/public/js/github-panel/vendor/react.js +1 -9
  101. package/public/js/runtime/react-runtime.js +1 -9
  102. package/public/licenca/index.html +200 -86
  103. package/public/login/index.html +315 -325
  104. package/public/melhor-bot-whatsapp-para-grupos/index.html +291 -261
  105. package/public/stickers/admin/index.html +14 -19
  106. package/public/stickers/create/index.html +39 -44
  107. package/public/stickers/index.html +96 -107
  108. package/public/termos-de-uso/index.html +369 -122
  109. package/public/user/index.html +527 -350
  110. package/scripts/cache-bust.mjs +5 -24
  111. package/scripts/generate-seo-satellite-pages.mjs +10 -13
  112. package/scripts/run-prettier-all.mjs +25 -0
  113. package/scripts/sticker-catalog-loadtest.mjs +13 -11
  114. package/scripts/sticker-worker-task.mjs +1 -4
  115. package/scripts/sync-readme-snapshot.mjs +3 -2
  116. package/server/auth/googleWebAuth/googleWebAuthService.js +614 -0
  117. package/server/controllers/stickerCatalogController.js +297 -632
  118. package/server/http/httpServer.js +2 -10
  119. package/server/routes/stickerCatalog/catalogHandlers/catalogAdminHttp.js +1 -8
  120. package/server/routes/stickerCatalog/catalogHandlers/catalogAuthHttp.js +1 -9
  121. package/server/routes/stickerCatalog/catalogHandlers/catalogPublicHttp.js +10 -11
  122. package/server/routes/stickerCatalog/catalogHandlers/catalogUploadHttp.js +1 -10
  123. package/server/routes/stickerCatalog/catalogRouter.js +11 -13
@@ -1,17 +1,9 @@
1
1
  import http from 'node:http';
2
2
  import logger from '../../app/utils/logger/loggerModule.js';
3
- import {
4
- getMetricsServerConfig,
5
- isMetricsEnabled,
6
- recordHttpRequest,
7
- resolveRouteGroup,
8
- } from '../../app/observability/metrics.js';
3
+ import { getMetricsServerConfig, isMetricsEnabled, recordHttpRequest, resolveRouteGroup } from '../../app/observability/metrics.js';
9
4
  import { parseRequestUrl, normalizeRequestId } from './requestContext.js';
10
5
  import { maybeHandleMetricsRoute } from '../routes/metricsRoute.js';
11
- import {
12
- getStickerCatalogRouteConfig,
13
- maybeHandleStickerCatalogRoute,
14
- } from '../routes/stickerCatalogRoute.js';
6
+ import { getStickerCatalogRouteConfig, maybeHandleStickerCatalogRoute } from '../routes/stickerCatalogRoute.js';
15
7
 
16
8
  let server = null;
17
9
  let serverStarted = false;
@@ -1,11 +1,4 @@
1
- export const handleCatalogAdminRoutes = async ({
2
- req,
3
- res,
4
- url,
5
- segments,
6
- handlers,
7
- sendJson,
8
- }) => {
1
+ export const handleCatalogAdminRoutes = async ({ req, res, url, segments, handlers, sendJson }) => {
9
2
  if (segments[0] !== 'admin') return false;
10
3
 
11
4
  if (segments.length === 2 && segments[1] === 'overview') {
@@ -2,15 +2,7 @@ const METHOD_NOT_ALLOWED_BODY = { error: 'Metodo nao permitido.' };
2
2
 
3
3
  const isReadMethod = (method) => method === 'GET' || method === 'HEAD';
4
4
 
5
- export const handleCatalogAuthRoutes = async ({
6
- req,
7
- res,
8
- pathname,
9
- url,
10
- apiBasePath,
11
- handlers,
12
- sendJson,
13
- }) => {
5
+ export const handleCatalogAuthRoutes = async ({ req, res, pathname, url, apiBasePath, handlers, sendJson }) => {
14
6
  if (pathname === `${apiBasePath}/auth/google/session`) {
15
7
  await handlers.handleGoogleAuthSessionRequest(req, res);
16
8
  return true;
@@ -2,17 +2,7 @@ const METHOD_NOT_ALLOWED_BODY = { error: 'Metodo nao permitido.' };
2
2
 
3
3
  const isReadMethod = (method) => method === 'GET' || method === 'HEAD';
4
4
 
5
- export const handleCatalogPublicRoutes = async ({
6
- req,
7
- res,
8
- pathname,
9
- url,
10
- segments,
11
- apiBasePath,
12
- orphanApiPath,
13
- handlers,
14
- sendJson,
15
- }) => {
5
+ export const handleCatalogPublicRoutes = async ({ req, res, pathname, url, segments, apiBasePath, orphanApiPath, handlers, sendJson }) => {
16
6
  if (pathname === apiBasePath) {
17
7
  if (!isReadMethod(req.method || '')) {
18
8
  sendJson(req, res, 405, METHOD_NOT_ALLOWED_BODY);
@@ -58,6 +48,15 @@ export const handleCatalogPublicRoutes = async ({
58
48
  return true;
59
49
  }
60
50
 
51
+ if (pathname === `${apiBasePath}/home-bootstrap`) {
52
+ if (!isReadMethod(req.method || '')) {
53
+ sendJson(req, res, 405, METHOD_NOT_ALLOWED_BODY);
54
+ return true;
55
+ }
56
+ await handlers.handleHomeBootstrapRequest(req, res, url);
57
+ return true;
58
+ }
59
+
61
60
  if (pathname === `${apiBasePath}/create-config`) {
62
61
  if (!isReadMethod(req.method || '')) {
63
62
  sendJson(req, res, 405, METHOD_NOT_ALLOWED_BODY);
@@ -2,16 +2,7 @@ const METHOD_NOT_ALLOWED_BODY = { error: 'Metodo nao permitido.' };
2
2
 
3
3
  const isPublishStateMethod = (method) => method === 'GET' || method === 'HEAD' || method === 'POST';
4
4
 
5
- export const handleCatalogUploadRoutes = async ({
6
- req,
7
- res,
8
- pathname,
9
- url,
10
- segments,
11
- apiBasePath,
12
- handlers,
13
- sendJson,
14
- }) => {
5
+ export const handleCatalogUploadRoutes = async ({ req, res, pathname, url, segments, apiBasePath, handlers, sendJson }) => {
15
6
  if (pathname === `${apiBasePath}/create`) {
16
7
  if (req.method !== 'POST') {
17
8
  sendJson(req, res, 405, METHOD_NOT_ALLOWED_BODY);
@@ -4,20 +4,18 @@ import { handleCatalogUploadRoutes } from './catalogHandlers/catalogUploadHttp.j
4
4
  import { handleCatalogPublicRoutes } from './catalogHandlers/catalogPublicHttp.js';
5
5
 
6
6
  const decodePathSegments = (suffix) =>
7
- suffix.split('/').filter(Boolean).map((segment) => {
8
- try {
9
- return decodeURIComponent(segment);
10
- } catch {
11
- return segment;
12
- }
13
- });
7
+ suffix
8
+ .split('/')
9
+ .filter(Boolean)
10
+ .map((segment) => {
11
+ try {
12
+ return decodeURIComponent(segment);
13
+ } catch {
14
+ return segment;
15
+ }
16
+ });
14
17
 
15
- export const createCatalogApiRouter = ({
16
- apiBasePath,
17
- orphanApiPath,
18
- handlers,
19
- sendJson,
20
- }) => {
18
+ export const createCatalogApiRouter = ({ apiBasePath, orphanApiPath, handlers, sendJson }) => {
21
19
  if (!apiBasePath || typeof handlers !== 'object' || typeof sendJson !== 'function') {
22
20
  throw new Error('catalog_api_router_config_invalid');
23
21
  }