@omnizap-system/omnizap 2.5.12
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/.clusterfuzzlite/Dockerfile +10 -0
- package/.env.example +907 -0
- package/.github/codeql/codeql-config.yml +10 -0
- package/.github/dependabot.yml +35 -0
- package/.github/workflows/ci.yml +73 -0
- package/.github/workflows/codeql.yml +106 -0
- package/.github/workflows/db-migration-check.yml +98 -0
- package/.github/workflows/dependency-review.yml +22 -0
- package/.github/workflows/deploy.yml +95 -0
- package/.github/workflows/release.yml +106 -0
- package/.github/workflows/security-attest-provenance.yml +51 -0
- package/.github/workflows/security-gitleaks.yml +34 -0
- package/.github/workflows/security-runner-hardening.yml +31 -0
- package/.github/workflows/security-scorecard.yml +44 -0
- package/.github/workflows/security-zap-baseline.yml +44 -0
- package/.github/workflows/security-zap-full-scan.yml +43 -0
- package/.github/workflows/security-zizmor.yml +36 -0
- package/.github/workflows/wiki-sync.yml +44 -0
- package/.gitleaks.toml +15 -0
- package/.prettierrc +34 -0
- package/CODE_OF_CONDUCT.md +114 -0
- package/LICENSE +56 -0
- package/README.md +110 -0
- package/SECURITY.md +110 -0
- package/app/config/index.js +4 -0
- package/app/configParts/adminIdentity.js +92 -0
- package/app/configParts/baileysConfig.js +1818 -0
- package/app/configParts/groupUtils.js +692 -0
- package/app/configParts/loggerConfig.js +394 -0
- package/app/configParts/messagePersistenceService.js +305 -0
- package/app/connection/baileysCompatibility.test.js +40 -0
- package/app/connection/baileysDbAuthState.js +344 -0
- package/app/connection/socketController.js +2243 -0
- package/app/controllers/messageController.js +7 -0
- package/app/controllers/messagePipeline/commandMiddleware.js +146 -0
- package/app/controllers/messagePipeline/conversationMiddleware.js +183 -0
- package/app/controllers/messagePipeline/messagePipelineMiddlewares.test.js +522 -0
- package/app/controllers/messagePipeline/postProcessingMiddleware.js +41 -0
- package/app/controllers/messagePipeline/preProcessingMiddlewares.js +166 -0
- package/app/controllers/messageProcessingPipeline.js +699 -0
- package/app/modules/adminModule/AGENT.md +4056 -0
- package/app/modules/adminModule/adminAiHelpService.js +56 -0
- package/app/modules/adminModule/adminConfigRuntime.js +177 -0
- package/app/modules/adminModule/commandConfig.json +7122 -0
- package/app/modules/adminModule/groupCommandHandlers.js +1823 -0
- package/app/modules/adminModule/groupCommandHandlers.test.js +350 -0
- package/app/modules/adminModule/groupEventHandlers.js +399 -0
- package/app/modules/aiModule/AGENT.md +547 -0
- package/app/modules/aiModule/aiAiHelpService.js +14 -0
- package/app/modules/aiModule/aiConfigRuntime.js +135 -0
- package/app/modules/aiModule/catCommand.js +967 -0
- package/app/modules/aiModule/commandConfig.json +981 -0
- package/app/modules/analyticsModule/messageAnalysisEventRepository.js +83 -0
- package/app/modules/gameModule/AGENT.md +196 -0
- package/app/modules/gameModule/commandConfig.json +366 -0
- package/app/modules/gameModule/diceCommand.js +42 -0
- package/app/modules/gameModule/gameAiHelpService.js +14 -0
- package/app/modules/gameModule/gameConfigRuntime.js +68 -0
- package/app/modules/menuModule/AGENT.md +205 -0
- package/app/modules/menuModule/commandConfig.json +366 -0
- package/app/modules/menuModule/common.js +316 -0
- package/app/modules/menuModule/menuAiHelpService.js +14 -0
- package/app/modules/menuModule/menuConfigRuntime.js +68 -0
- package/app/modules/menuModule/menus.js +66 -0
- package/app/modules/playModule/AGENT.md +321 -0
- package/app/modules/playModule/commandConfig.json +584 -0
- package/app/modules/playModule/playAiHelpService.js +14 -0
- package/app/modules/playModule/playCommand.js +1417 -0
- package/app/modules/playModule/playConfigRuntime.js +68 -0
- package/app/modules/quoteModule/AGENT.md +199 -0
- package/app/modules/quoteModule/commandConfig.json +366 -0
- package/app/modules/quoteModule/quoteAiHelpService.js +14 -0
- package/app/modules/quoteModule/quoteCommand.js +842 -0
- package/app/modules/quoteModule/quoteConfigRuntime.js +68 -0
- package/app/modules/rpgPokemonModule/AGENT.md +229 -0
- package/app/modules/rpgPokemonModule/commandConfig.json +386 -0
- package/app/modules/rpgPokemonModule/rpgBattleCanvasRenderer.js +795 -0
- package/app/modules/rpgPokemonModule/rpgBattleService.js +2110 -0
- package/app/modules/rpgPokemonModule/rpgBattleService.test.js +770 -0
- package/app/modules/rpgPokemonModule/rpgEvolutionUtils.js +22 -0
- package/app/modules/rpgPokemonModule/rpgPokemonAiHelpService.js +14 -0
- package/app/modules/rpgPokemonModule/rpgPokemonCommand.js +174 -0
- package/app/modules/rpgPokemonModule/rpgPokemonConfigRuntime.js +68 -0
- package/app/modules/rpgPokemonModule/rpgPokemonDomain.js +192 -0
- package/app/modules/rpgPokemonModule/rpgPokemonDomain.test.js +93 -0
- package/app/modules/rpgPokemonModule/rpgPokemonEvolution.test.js +46 -0
- package/app/modules/rpgPokemonModule/rpgPokemonMessages.js +746 -0
- package/app/modules/rpgPokemonModule/rpgPokemonRepository.js +1847 -0
- package/app/modules/rpgPokemonModule/rpgPokemonService.js +6839 -0
- package/app/modules/rpgPokemonModule/rpgProfileCanvasRenderer.js +354 -0
- package/app/modules/statsModule/AGENT.md +320 -0
- package/app/modules/statsModule/commandConfig.json +540 -0
- package/app/modules/statsModule/globalRankingCommand.js +64 -0
- package/app/modules/statsModule/rankingCommand.js +41 -0
- package/app/modules/statsModule/rankingCommon.js +1305 -0
- package/app/modules/statsModule/statsAiHelpService.js +14 -0
- package/app/modules/statsModule/statsConfigRuntime.js +68 -0
- package/app/modules/stickerModule/AGENT.md +692 -0
- package/app/modules/stickerModule/addStickerMetadata.js +239 -0
- package/app/modules/stickerModule/commandConfig.json +1216 -0
- package/app/modules/stickerModule/convertToWebp.js +367 -0
- package/app/modules/stickerModule/stickerAiHelpService.js +14 -0
- package/app/modules/stickerModule/stickerCommand.js +446 -0
- package/app/modules/stickerModule/stickerConfigRuntime.js +68 -0
- package/app/modules/stickerModule/stickerConvertCommand.js +159 -0
- package/app/modules/stickerModule/stickerTextCommand.js +653 -0
- package/app/modules/stickerPackModule/AGENT.md +215 -0
- package/app/modules/stickerPackModule/autoPackCollectorRuntime.js +20 -0
- package/app/modules/stickerPackModule/autoPackCollectorService.js +357 -0
- package/app/modules/stickerPackModule/commandConfig.json +387 -0
- package/app/modules/stickerPackModule/domainEventOutboxRepository.js +227 -0
- package/app/modules/stickerPackModule/domainEvents.js +52 -0
- package/app/modules/stickerPackModule/semanticReclassificationEngine.js +429 -0
- package/app/modules/stickerPackModule/semanticReclassificationEngine.test.js +75 -0
- package/app/modules/stickerPackModule/semanticThemeClusterService.js +544 -0
- package/app/modules/stickerPackModule/stickerAssetClassificationRepository.js +400 -0
- package/app/modules/stickerPackModule/stickerAssetRepository.js +400 -0
- package/app/modules/stickerPackModule/stickerAssetReprocessQueueRepository.js +175 -0
- package/app/modules/stickerPackModule/stickerAutoPackByTagsRuntime.js +3702 -0
- package/app/modules/stickerPackModule/stickerClassificationBackgroundRuntime.js +559 -0
- package/app/modules/stickerPackModule/stickerClassificationService.js +557 -0
- package/app/modules/stickerPackModule/stickerDedicatedTaskWorkerRuntime.js +249 -0
- package/app/modules/stickerPackModule/stickerDomainEventBus.js +65 -0
- package/app/modules/stickerPackModule/stickerDomainEventConsumerRuntime.js +208 -0
- package/app/modules/stickerPackModule/stickerMarketplaceDriftService.js +99 -0
- package/app/modules/stickerPackModule/stickerObjectStorageService.js +285 -0
- package/app/modules/stickerPackModule/stickerPackAiHelpService.js +14 -0
- package/app/modules/stickerPackModule/stickerPackCommandHandlers.js +1148 -0
- package/app/modules/stickerPackModule/stickerPackConfigRuntime.js +68 -0
- package/app/modules/stickerPackModule/stickerPackEngagementRepository.js +152 -0
- package/app/modules/stickerPackModule/stickerPackErrors.js +30 -0
- package/app/modules/stickerPackModule/stickerPackInteractionEventRepository.js +101 -0
- package/app/modules/stickerPackModule/stickerPackItemRepository.js +432 -0
- package/app/modules/stickerPackModule/stickerPackMarketplaceService.js +313 -0
- package/app/modules/stickerPackModule/stickerPackMessageService.js +268 -0
- package/app/modules/stickerPackModule/stickerPackRepository.js +450 -0
- package/app/modules/stickerPackModule/stickerPackScoreSnapshotRepository.js +179 -0
- package/app/modules/stickerPackModule/stickerPackScoreSnapshotRuntime.js +271 -0
- package/app/modules/stickerPackModule/stickerPackService.js +733 -0
- package/app/modules/stickerPackModule/stickerPackServiceRuntime.js +32 -0
- package/app/modules/stickerPackModule/stickerPackUtils.js +107 -0
- package/app/modules/stickerPackModule/stickerStorageService.js +559 -0
- package/app/modules/stickerPackModule/stickerWorkerPipelineRuntime.js +242 -0
- package/app/modules/stickerPackModule/stickerWorkerTaskQueueRepository.js +242 -0
- package/app/modules/systemMetricsModule/AGENT.md +193 -0
- package/app/modules/systemMetricsModule/commandConfig.json +344 -0
- package/app/modules/systemMetricsModule/pingCommand.js +399 -0
- package/app/modules/systemMetricsModule/systemMetricsAiHelpService.js +14 -0
- package/app/modules/systemMetricsModule/systemMetricsConfigRuntime.js +68 -0
- package/app/modules/tiktokModule/AGENT.md +196 -0
- package/app/modules/tiktokModule/commandConfig.json +366 -0
- package/app/modules/tiktokModule/tiktokAiHelpService.js +14 -0
- package/app/modules/tiktokModule/tiktokCommand.js +716 -0
- package/app/modules/tiktokModule/tiktokConfigRuntime.js +68 -0
- package/app/modules/userModule/AGENT.md +200 -0
- package/app/modules/userModule/commandConfig.json +386 -0
- package/app/modules/userModule/userAiHelpService.js +14 -0
- package/app/modules/userModule/userCommand.js +1155 -0
- package/app/modules/userModule/userConfigRuntime.js +68 -0
- package/app/modules/waifuPicsModule/AGENT.md +431 -0
- package/app/modules/waifuPicsModule/commandConfig.json +780 -0
- package/app/modules/waifuPicsModule/waifuPicsAiHelpService.js +14 -0
- package/app/modules/waifuPicsModule/waifuPicsCommand.js +586 -0
- package/app/modules/waifuPicsModule/waifuPicsConfigRuntime.js +68 -0
- package/app/observability/metrics.js +766 -0
- package/app/services/ai/aiHelpResponseCacheRepository.js +280 -0
- package/app/services/ai/aiLearningRepository.js +400 -0
- package/app/services/ai/commandConfigEnrichmentRepository.js +769 -0
- package/app/services/ai/commandConfigEnrichmentService.js +452 -0
- package/app/services/ai/commandConfigValidationService.js +443 -0
- package/app/services/ai/commandToolBuilderService.js +192 -0
- package/app/services/ai/conversationRouterService.js +516 -0
- package/app/services/ai/geminiService.js +115 -0
- package/app/services/ai/geminiService.test.js +87 -0
- package/app/services/ai/globalModuleAiHelpService.js +1412 -0
- package/app/services/ai/globalToolCallingService.js +203 -0
- package/app/services/ai/messageCommandExecutionService.js +391 -0
- package/app/services/ai/moduleAiHelpCoreService.js +1099 -0
- package/app/services/ai/moduleAiHelpWrapperFactory.js +65 -0
- package/app/services/ai/moduleCommandConfigRuntimeService.js +113 -0
- package/app/services/ai/moduleToolExecutorService.js +464 -0
- package/app/services/ai/moduleToolRegistryService.js +178 -0
- package/app/services/ai/toolCandidateSelectorService.js +781 -0
- package/app/services/auth/googleWebLinkService.js +80 -0
- package/app/services/auth/whatsappLoginLinkService.js +230 -0
- package/app/services/external/pokeApiService.js +398 -0
- package/app/services/group/groupMetadataService.js +311 -0
- package/app/services/infra/dbWriteQueue.js +874 -0
- package/app/services/infra/featureFlagService.js +131 -0
- package/app/services/infra/queueUtils.js +55 -0
- package/app/services/messaging/captchaService.js +491 -0
- package/app/services/messaging/messagePersistenceService.js +1 -0
- package/app/services/messaging/newsBroadcastService.js +347 -0
- package/app/services/sticker/stickerFocusService.js +347 -0
- package/app/services/sticker/stickerFocusService.test.js +43 -0
- package/app/store/aiPromptStore.js +38 -0
- package/app/store/conversationSessionStore.js +131 -0
- package/app/store/groupConfigStore.js +58 -0
- package/app/store/premiumUserStore.js +54 -0
- package/app/utils/antiLink/antiLinkModule.js +700 -0
- package/app/utils/http/getImageBufferModule.js +18 -0
- package/app/utils/json/jsonSanitizer.js +113 -0
- package/app/utils/json/jsonSanitizer.test.js +40 -0
- package/app/utils/systemMetrics/systemMetricsModule.js +88 -0
- package/app/workers/aiLearningWorker.js +605 -0
- package/app/workers/commandConfigEnrichmentWorker.js +242 -0
- package/database/index.js +2075 -0
- package/database/init.js +151 -0
- package/database/migrations/.gitkeep +0 -0
- package/database/migrations/20260307_d0_hardening_down.sql +64 -0
- package/database/migrations/20260307_d0_hardening_up.sql +79 -0
- package/database/migrations/20260307_d1_terms_acceptance_down.sql +11 -0
- package/database/migrations/20260307_d1_terms_acceptance_up.sql +37 -0
- package/database/migrations/20260307_d2_auth_hardening_down.sql +75 -0
- package/database/migrations/20260307_d2_auth_hardening_up.sql +100 -0
- package/database/migrations/20260314_d7_canonical_sender_down.sql +53 -0
- package/database/migrations/20260314_d7_canonical_sender_up.sql +114 -0
- package/database/migrations/20260406_d30_security_analytics_down.sql +95 -0
- package/database/migrations/20260406_d30_security_analytics_up.sql +292 -0
- package/database/migrations/20260407_d31_web_google_session_token_hardening_down.sql +2 -0
- package/database/migrations/20260407_d31_web_google_session_token_hardening_up.sql +17 -0
- package/database/migrations/20260408_d32_ai_help_response_cache_down.sql +1 -0
- package/database/migrations/20260408_d32_ai_help_response_cache_up.sql +22 -0
- package/database/migrations/20260409_d33_ai_learning_tables_down.sql +4 -0
- package/database/migrations/20260409_d33_ai_learning_tables_up.sql +52 -0
- package/database/migrations/20260410_d34_command_config_enrichment_down.sql +3 -0
- package/database/migrations/20260410_d34_command_config_enrichment_up.sql +48 -0
- package/database/schema.sql +1186 -0
- package/docker-compose.yml +104 -0
- package/docs/audits/stickerCatalogController-out-of-scope.md +103 -0
- package/docs/audits/stickerCatalogController-symbols.md +58 -0
- package/docs/compliance/acceptable-use-policy-2026-03-07.md +35 -0
- package/docs/compliance/dpa-b2b-standard-2026-03-07.md +80 -0
- package/docs/compliance/monthly-compliance-checklist-2026-03-07.md +88 -0
- package/docs/compliance/notice-and-takedown-policy-2026-03-07.md +34 -0
- package/docs/compliance/privacy-policy-2026-03-07.md +75 -0
- package/docs/compliance/subprocessors-inventory-2026-03-07.md +16 -0
- package/docs/database/production-db-evolution-runbook-2026q1.md +365 -0
- package/docs/security/dsar-lgpd-runbook-2026-03-07.md +86 -0
- package/docs/security/incident-response-lgpd-anpd-runbook-2026-03-07.md +77 -0
- package/docs/security/network-hardening-runbook-2026-03-07.md +137 -0
- package/docs/seo/omnizap-seo-playbook-br-2026-02-28.md +238 -0
- package/docs/seo/satellite-page-template.md +116 -0
- package/docs/seo/satellite-pages-phase1.json +364 -0
- package/docs/wiki/Home.md +120 -0
- package/docs/wiki/pair-extraordinaire-2026-03-08.md +3 -0
- package/docs/wiki/recent-changes-2026-03-08.md +47 -0
- package/ecosystem.prod.config.cjs +135 -0
- package/eslint.config.js +89 -0
- package/index.js +488 -0
- package/ml/clip_classifier/Dockerfile +18 -0
- package/ml/clip_classifier/README.md +118 -0
- package/ml/clip_classifier/adaptive_scoring.py +40 -0
- package/ml/clip_classifier/classifier.py +654 -0
- package/ml/clip_classifier/embedding_store.py +481 -0
- package/ml/clip_classifier/env_loader.py +15 -0
- package/ml/clip_classifier/llm_label_expander.py +144 -0
- package/ml/clip_classifier/main.py +213 -0
- package/ml/clip_classifier/requirements.txt +10 -0
- package/ml/clip_classifier/similarity_engine.py +74 -0
- package/new-logo.png +0 -0
- package/observability/alert-rules.yml +60 -0
- package/observability/grafana/dashboards/omnizap-mysql.json +136 -0
- package/observability/grafana/dashboards/omnizap-overview.json +170 -0
- package/observability/grafana/provisioning/dashboards/dashboards.yml +11 -0
- package/observability/grafana/provisioning/datasources/datasources.yml +15 -0
- package/observability/loki-config.yml +38 -0
- package/observability/mysql-setup.sql +46 -0
- package/observability/prometheus.yml +35 -0
- package/observability/promtail-config.yml +84 -0
- package/observability/sticker-catalog-slo.md +83 -0
- package/observability/sticker-scale-hardening-rollout.md +128 -0
- package/package.json +144 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/assets/css/commands-react.input.css +71 -0
- package/public/assets/css/create-pack-react.input.css +31 -0
- package/public/assets/css/home-react.input.css +106 -0
- package/public/assets/css/login-react.input.css +58 -0
- package/public/assets/css/stickers-react.input.css +18 -0
- package/public/assets/css/terms-react.input.css +115 -0
- package/public/assets/css/user-react.input.css +57 -0
- package/public/assets/images/brand-icon-192.png +0 -0
- package/public/assets/images/brand-logo-128.webp +0 -0
- package/public/assets/images/hero-banner-1280.jpg +0 -0
- package/public/comandos/commands-catalog.json +4517 -0
- package/public/css/api-docs.css +161 -0
- package/public/css/stickers-admin.css +1288 -0
- package/public/css/styles.css +679 -0
- package/public/css/systemadm/admin.css +474 -0
- package/public/css/systemadm/base.css +73 -0
- package/public/css/systemadm/components.css +662 -0
- package/public/css/systemadm/layout.css +229 -0
- package/public/css/systemadm/tokens.css +56 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/js/apps/apiDocsApp.js +235 -0
- package/public/js/apps/commandsReactApp.js +528 -0
- package/public/js/apps/createPackApp.js +1646 -0
- package/public/js/apps/homeReactApp.js +942 -0
- package/public/js/apps/loginReactApp.js +496 -0
- package/public/js/apps/stickersAdminApp.js +1753 -0
- package/public/js/apps/stickersApp.js +3797 -0
- package/public/js/apps/termsReactApp.js +528 -0
- package/public/js/apps/userApp.js +2540 -0
- package/public/js/apps/userProfile/actions.js +66 -0
- package/public/js/apps/userReactApp.js +547 -0
- package/public/js/catalog.js +950 -0
- package/public/pages/api-docs.html +40 -0
- package/public/pages/aup.html +158 -0
- package/public/pages/comandos.html +41 -0
- package/public/pages/dpa.html +227 -0
- package/public/pages/home.html +45 -0
- package/public/pages/licenca.html +182 -0
- package/public/pages/login.html +40 -0
- package/public/pages/notice-and-takedown.html +234 -0
- package/public/pages/politica-de-privacidade.html +251 -0
- package/public/pages/seo-bot-whatsapp-para-grupo.html +350 -0
- package/public/pages/seo-bot-whatsapp-sem-programar.html +350 -0
- package/public/pages/seo-como-automatizar-avisos-no-whatsapp.html +350 -0
- package/public/pages/seo-como-criar-comandos-whatsapp.html +350 -0
- package/public/pages/seo-como-evitar-spam-no-whatsapp.html +350 -0
- package/public/pages/seo-como-moderar-grupo-whatsapp.html +350 -0
- package/public/pages/seo-como-organizar-comunidade-whatsapp.html +350 -0
- package/public/pages/seo-melhor-bot-whatsapp-para-grupos.html +350 -0
- package/public/pages/stickers-admin.html +31 -0
- package/public/pages/stickers-create.html +41 -0
- package/public/pages/stickers.html +45 -0
- package/public/pages/suboperadores.html +237 -0
- package/public/pages/termos-de-uso-texto-integral.html +241 -0
- package/public/pages/termos-de-uso.html +41 -0
- package/public/pages/user-password-reset.html +32 -0
- package/public/pages/user-systemadm.html +508 -0
- package/public/pages/user.html +39 -0
- package/public/robots.txt +9 -0
- package/public/site.webmanifest +24 -0
- package/public/sitemap.xml +98 -0
- package/schemas/command-config.schema.json +582 -0
- package/scripts/baileys-compat-smoke.mjs +12 -0
- package/scripts/cache-bust.mjs +142 -0
- package/scripts/deploy.sh +916 -0
- package/scripts/email-broadcast-terms-update.mjs +170 -0
- package/scripts/enrich-command-discovery-fields.mjs +286 -0
- package/scripts/generate-command-config-schema.mjs +273 -0
- package/scripts/generate-commands-catalog.mjs +308 -0
- package/scripts/generate-module-agents.mjs +631 -0
- package/scripts/generate-seo-satellite-pages.mjs +400 -0
- package/scripts/github-deploy-notify.mjs +174 -0
- package/scripts/github-release-notify.mjs +219 -0
- package/scripts/release.sh +599 -0
- package/scripts/run-codeql-local.sh +116 -0
- package/scripts/run-prettier-all.mjs +25 -0
- package/scripts/security-smoketest.mjs +581 -0
- package/scripts/sticker-catalog-loadtest.mjs +210 -0
- package/scripts/sticker-worker-task.mjs +119 -0
- package/scripts/sync-readme-snapshot.mjs +133 -0
- package/scripts/validate-command-config-schema.mjs +130 -0
- package/scripts/validate-command-configs.mjs +15 -0
- package/scripts/wiki-sync.sh +191 -0
- package/server/auth/googleWebAuth/googleWebAuthRuntime.js +62 -0
- package/server/auth/googleWebAuth/googleWebAuthService.js +807 -0
- package/server/auth/jwt/webJwtService.js +147 -0
- package/server/auth/stickerCatalogAuthContext.js +165 -0
- package/server/auth/termsAcceptance/termsAcceptanceHandler.js +189 -0
- package/server/auth/userPassword/index.js +14 -0
- package/server/auth/userPassword/userPasswordAuthService.js +422 -0
- package/server/auth/userPassword/userPasswordCrypto.js +199 -0
- package/server/auth/userPassword/userPasswordCrypto.test.js +76 -0
- package/server/auth/userPassword/userPasswordRecoveryService.js +728 -0
- package/server/auth/validation/authSchemas.js +236 -0
- package/server/auth/webAccount/webAccountHandlers.js +1434 -0
- package/server/controllers/admin/adminBanService.js +138 -0
- package/server/controllers/admin/adminPanelHandlers.js +2083 -0
- package/server/controllers/admin/stickerCatalogAdminContext.js +17 -0
- package/server/controllers/admin/systemAdminController.js +201 -0
- package/server/controllers/email/emailAutomationController.js +239 -0
- package/server/controllers/metricsController.js +21 -0
- package/server/controllers/seo/stickerCatalogSeoContext.js +514 -0
- package/server/controllers/sticker/nonCatalogHandlers.js +303 -0
- package/server/controllers/sticker/stickerCatalogController.js +4700 -0
- package/server/controllers/system/contactController.js +115 -0
- package/server/controllers/system/githubController.js +137 -0
- package/server/controllers/system/stickerCatalogSystemContext.js +758 -0
- package/server/controllers/system/storageController.js +154 -0
- package/server/controllers/system/systemController.js +135 -0
- package/server/controllers/system/systemMetricsController.js +156 -0
- package/server/controllers/system/visitController.js +90 -0
- package/server/controllers/userController.js +145 -0
- package/server/email/emailAutomationRuntime.js +225 -0
- package/server/email/emailAutomationService.js +125 -0
- package/server/email/emailOutboxRepository.js +282 -0
- package/server/email/emailTemplateService.js +480 -0
- package/server/email/emailTransportService.js +156 -0
- package/server/http/clientIp.js +95 -0
- package/server/http/httpRequestUtils.js +262 -0
- package/server/http/httpRequestUtils.test.js +80 -0
- package/server/http/httpServer.js +180 -0
- package/server/http/requestContext.js +20 -0
- package/server/http/siteRoutingUtils.js +87 -0
- package/server/index.js +1 -0
- package/server/middleware/cachePolicy.js +26 -0
- package/server/middleware/cachePolicyHelpers.js +1 -0
- package/server/middleware/endpointRateLimit.js +181 -0
- package/server/middleware/rateLimit.js +70 -0
- package/server/middleware/requireAdminAuth.js +48 -0
- package/server/middleware/securityHeaders.js +97 -0
- package/server/routes/admin/systemAdminRouter.js +64 -0
- package/server/routes/email/emailAutomationRouter.js +46 -0
- package/server/routes/health/healthRouter.js +41 -0
- package/server/routes/indexRouter.js +234 -0
- package/server/routes/metrics/metricsRouter.js +58 -0
- package/server/routes/static/staticPageRouter.js +134 -0
- package/server/routes/sticker/catalogHandlers/catalogAdminHttp.js +105 -0
- package/server/routes/sticker/catalogHandlers/catalogAuthHttp.js +77 -0
- package/server/routes/sticker/catalogHandlers/catalogPublicHttp.js +120 -0
- package/server/routes/sticker/catalogHandlers/catalogUploadHttp.js +83 -0
- package/server/routes/sticker/catalogRouter.js +77 -0
- package/server/routes/sticker/stickerApiRouter.js +84 -0
- package/server/routes/sticker/stickerDataRouter.js +145 -0
- package/server/routes/sticker/stickerSiteRouter.js +43 -0
- package/server/routes/user/userApiPaths.js +66 -0
- package/server/routes/user/userRouter.js +65 -0
- package/server/utils/safePath.js +26 -0
- package/utils/logger/loggerModule.js +35 -0
- package/vite.config.mjs +38 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
auth_enabled: false
|
|
2
|
+
|
|
3
|
+
server:
|
|
4
|
+
http_listen_port: 3100
|
|
5
|
+
|
|
6
|
+
common:
|
|
7
|
+
instance_addr: 0.0.0.0
|
|
8
|
+
path_prefix: /loki
|
|
9
|
+
storage:
|
|
10
|
+
filesystem:
|
|
11
|
+
chunks_directory: /loki/chunks
|
|
12
|
+
rules_directory: /loki/rules
|
|
13
|
+
replication_factor: 1
|
|
14
|
+
ring:
|
|
15
|
+
kvstore:
|
|
16
|
+
store: inmemory
|
|
17
|
+
|
|
18
|
+
schema_config:
|
|
19
|
+
configs:
|
|
20
|
+
- from: 2024-01-01
|
|
21
|
+
store: boltdb-shipper
|
|
22
|
+
object_store: filesystem
|
|
23
|
+
schema: v13
|
|
24
|
+
index:
|
|
25
|
+
prefix: index_
|
|
26
|
+
period: 24h
|
|
27
|
+
|
|
28
|
+
limits_config:
|
|
29
|
+
retention_period: 168h
|
|
30
|
+
reject_old_samples: true
|
|
31
|
+
reject_old_samples_max_age: 168h
|
|
32
|
+
|
|
33
|
+
chunk_store_config:
|
|
34
|
+
max_look_back_period: 0
|
|
35
|
+
|
|
36
|
+
table_manager:
|
|
37
|
+
retention_deletes_enabled: true
|
|
38
|
+
retention_period: 168h
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
-- OmniZap observability setup for MySQL
|
|
2
|
+
-- Run as a privileged user (root/admin).
|
|
3
|
+
-- This script is idempotent and focused on metrics/logging for mysqld-exporter.
|
|
4
|
+
|
|
5
|
+
-- 1) Metrics user for mysqld-exporter
|
|
6
|
+
-- Matches docker-compose default DSN: exporter:exporter@(host.docker.internal:3306)/
|
|
7
|
+
CREATE USER IF NOT EXISTS 'exporter'@'%' IDENTIFIED BY 'exporter';
|
|
8
|
+
ALTER USER 'exporter'@'%' IDENTIFIED BY 'exporter';
|
|
9
|
+
|
|
10
|
+
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'%';
|
|
11
|
+
GRANT SELECT ON performance_schema.* TO 'exporter'@'%';
|
|
12
|
+
GRANT SELECT ON information_schema.* TO 'exporter'@'%';
|
|
13
|
+
GRANT SELECT ON sys.* TO 'exporter'@'%';
|
|
14
|
+
FLUSH PRIVILEGES;
|
|
15
|
+
|
|
16
|
+
-- 2) Slow query log (runtime values; set in my.cnf for persistence)
|
|
17
|
+
SET GLOBAL slow_query_log = ON;
|
|
18
|
+
SET GLOBAL long_query_time = 0.5;
|
|
19
|
+
SET GLOBAL log_output = 'FILE';
|
|
20
|
+
-- Keep slow log in datadir for compatibility across MariaDB/MySQL host setups.
|
|
21
|
+
-- If needed, change to another writable path.
|
|
22
|
+
SET GLOBAL slow_query_log_file = '/var/lib/mysql/mysql-slow.log';
|
|
23
|
+
|
|
24
|
+
-- 3) Performance Schema consumers/instruments
|
|
25
|
+
-- NOTE: performance_schema itself cannot be enabled dynamically.
|
|
26
|
+
-- If disabled, set performance_schema=ON in my.cnf and restart MySQL.
|
|
27
|
+
UPDATE performance_schema.setup_instruments
|
|
28
|
+
SET ENABLED = 'YES', TIMED = 'YES'
|
|
29
|
+
WHERE NAME LIKE 'statement/%';
|
|
30
|
+
|
|
31
|
+
UPDATE performance_schema.setup_consumers
|
|
32
|
+
SET ENABLED = 'YES'
|
|
33
|
+
WHERE NAME IN (
|
|
34
|
+
'events_statements_current',
|
|
35
|
+
'events_statements_history',
|
|
36
|
+
'events_statements_history_long',
|
|
37
|
+
'events_waits_current',
|
|
38
|
+
'events_waits_history',
|
|
39
|
+
'events_waits_history_long'
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
-- 4) InnoDB diagnostics
|
|
43
|
+
SET GLOBAL innodb_monitor_enable = 'all';
|
|
44
|
+
SET GLOBAL innodb_status_output = ON;
|
|
45
|
+
SET GLOBAL innodb_status_output_locks = ON;
|
|
46
|
+
SET GLOBAL innodb_print_all_deadlocks = ON;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
global:
|
|
2
|
+
scrape_interval: 10s
|
|
3
|
+
evaluation_interval: 10s
|
|
4
|
+
|
|
5
|
+
rule_files:
|
|
6
|
+
- /etc/prometheus/alert-rules.yml
|
|
7
|
+
|
|
8
|
+
scrape_configs:
|
|
9
|
+
- job_name: prometheus
|
|
10
|
+
static_configs:
|
|
11
|
+
- targets: ["prometheus:9090"]
|
|
12
|
+
|
|
13
|
+
- job_name: node-exporter
|
|
14
|
+
static_configs:
|
|
15
|
+
- targets: ["node-exporter:9100"]
|
|
16
|
+
|
|
17
|
+
- job_name: mysql-exporter
|
|
18
|
+
static_configs:
|
|
19
|
+
- targets: ["mysql-exporter:9104"]
|
|
20
|
+
|
|
21
|
+
- job_name: omnizap
|
|
22
|
+
metrics_path: /metrics
|
|
23
|
+
authorization:
|
|
24
|
+
type: Bearer
|
|
25
|
+
credentials_file: /etc/prometheus/secrets/omnizap_metrics_token
|
|
26
|
+
static_configs:
|
|
27
|
+
- targets: ["host.docker.internal:9102"]
|
|
28
|
+
|
|
29
|
+
- job_name: loki
|
|
30
|
+
static_configs:
|
|
31
|
+
- targets: ["loki:3100"]
|
|
32
|
+
|
|
33
|
+
- job_name: promtail
|
|
34
|
+
static_configs:
|
|
35
|
+
- targets: ["promtail:9080"]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
server:
|
|
2
|
+
http_listen_port: 9080
|
|
3
|
+
grpc_listen_port: 0
|
|
4
|
+
|
|
5
|
+
positions:
|
|
6
|
+
filename: /tmp/positions.yaml
|
|
7
|
+
|
|
8
|
+
clients:
|
|
9
|
+
- url: http://loki:3100/loki/api/v1/push
|
|
10
|
+
|
|
11
|
+
scrape_configs:
|
|
12
|
+
- job_name: omnizap-app
|
|
13
|
+
static_configs:
|
|
14
|
+
- targets: [localhost]
|
|
15
|
+
labels:
|
|
16
|
+
job: omnizap-app
|
|
17
|
+
__path__: /var/log/omnizap/application-*.log
|
|
18
|
+
- targets: [localhost]
|
|
19
|
+
labels:
|
|
20
|
+
job: omnizap-app
|
|
21
|
+
__path__: /var/log/omnizap/error-*.log
|
|
22
|
+
- targets: [localhost]
|
|
23
|
+
labels:
|
|
24
|
+
job: omnizap-app
|
|
25
|
+
__path__: /var/log/omnizap/warn-*.log
|
|
26
|
+
pipeline_stages:
|
|
27
|
+
- json:
|
|
28
|
+
expressions:
|
|
29
|
+
timestamp: timestamp
|
|
30
|
+
level: level
|
|
31
|
+
message: message
|
|
32
|
+
service: service
|
|
33
|
+
instanceId: instanceId
|
|
34
|
+
environment: environment
|
|
35
|
+
event: event
|
|
36
|
+
table: table
|
|
37
|
+
durationMs: durationMs
|
|
38
|
+
- labels:
|
|
39
|
+
level:
|
|
40
|
+
service:
|
|
41
|
+
environment:
|
|
42
|
+
event:
|
|
43
|
+
table:
|
|
44
|
+
- timestamp:
|
|
45
|
+
source: timestamp
|
|
46
|
+
format: RFC3339Nano
|
|
47
|
+
|
|
48
|
+
- job_name: omnizap-db-monitor
|
|
49
|
+
static_configs:
|
|
50
|
+
- targets: [localhost]
|
|
51
|
+
labels:
|
|
52
|
+
job: db-monitor
|
|
53
|
+
__path__: /var/log/omnizap/db-monitor.log*
|
|
54
|
+
pipeline_stages:
|
|
55
|
+
- json:
|
|
56
|
+
expressions:
|
|
57
|
+
ts: ts
|
|
58
|
+
event: event
|
|
59
|
+
type: type
|
|
60
|
+
table: table
|
|
61
|
+
durationMs: durationMs
|
|
62
|
+
fingerprint: fingerprint
|
|
63
|
+
- labels:
|
|
64
|
+
event:
|
|
65
|
+
type:
|
|
66
|
+
table:
|
|
67
|
+
fingerprint:
|
|
68
|
+
- timestamp:
|
|
69
|
+
source: ts
|
|
70
|
+
format: RFC3339Nano
|
|
71
|
+
|
|
72
|
+
- job_name: mysql-slow
|
|
73
|
+
static_configs:
|
|
74
|
+
- targets: [localhost]
|
|
75
|
+
labels:
|
|
76
|
+
job: mysql-slow
|
|
77
|
+
__path__: /var/log/mysql/mysql-slow.log
|
|
78
|
+
|
|
79
|
+
- job_name: mysql-error
|
|
80
|
+
static_configs:
|
|
81
|
+
- targets: [localhost]
|
|
82
|
+
labels:
|
|
83
|
+
job: mysql-error
|
|
84
|
+
__path__: /var/log/mysql/error.log
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Sticker Catalog 10x Baseline e SLOs
|
|
2
|
+
|
|
3
|
+
Este documento define a baseline operacional da camada HTTP + pipeline de classificação para o módulo de stickers.
|
|
4
|
+
|
|
5
|
+
## 1. Metas SLO (fase inicial)
|
|
6
|
+
|
|
7
|
+
### HTTP catálogo (`/api/sticker-packs*`, `/stickers*`, `/api/marketplace/stats`)
|
|
8
|
+
|
|
9
|
+
- **Latência p95**: `<= 750ms`
|
|
10
|
+
- **Latência p99**: `<= 1500ms`
|
|
11
|
+
- **Taxa de erro (5xx + timeout)**: `<= 2%` por janela de 5 minutos
|
|
12
|
+
- **Throughput alvo**: escalar linearmente com workers/processos sem aumento abrupto do p95
|
|
13
|
+
|
|
14
|
+
### Classificação de stickers
|
|
15
|
+
|
|
16
|
+
- **Duração média do ciclo**: `<= 10s`
|
|
17
|
+
- **Throughput mínimo (assets classificados/min)**: `>= 300` (ajustar por hardware)
|
|
18
|
+
- **Backlog de fila (`sticker_reprocess_pending`)**: tendência de queda após picos; alerta se cresce por mais de 15 min
|
|
19
|
+
|
|
20
|
+
## 2. Métricas instrumentadas
|
|
21
|
+
|
|
22
|
+
### HTTP
|
|
23
|
+
|
|
24
|
+
- `omnizap_http_requests_total{route_group,method,status_class}`
|
|
25
|
+
- `omnizap_http_request_duration_ms{route_group,method,status_class}`
|
|
26
|
+
- `omnizap_http_slo_violation_total{route_group,method}`
|
|
27
|
+
|
|
28
|
+
`route_group` segmenta tráfego em:
|
|
29
|
+
|
|
30
|
+
- `catalog_api_public`
|
|
31
|
+
- `catalog_api_auth`
|
|
32
|
+
- `catalog_api_admin`
|
|
33
|
+
- `catalog_api_upload`
|
|
34
|
+
- `catalog_web`
|
|
35
|
+
- `catalog_data_asset`
|
|
36
|
+
- `catalog_user_profile`
|
|
37
|
+
- `marketplace_stats`
|
|
38
|
+
- `metrics`
|
|
39
|
+
- `other`
|
|
40
|
+
|
|
41
|
+
### Classificação
|
|
42
|
+
|
|
43
|
+
- `omnizap_sticker_classification_cycle_duration_ms{status}`
|
|
44
|
+
- `omnizap_sticker_classification_cycle_total{status}`
|
|
45
|
+
- `omnizap_sticker_classification_assets_total{outcome}`
|
|
46
|
+
- `omnizap_queue_depth{queue}`
|
|
47
|
+
|
|
48
|
+
## 3. Tracing mínimo
|
|
49
|
+
|
|
50
|
+
- Cada request HTTP agora recebe/propaga `X-Request-Id`.
|
|
51
|
+
- Se o cliente enviar `X-Request-Id`, o valor é reaproveitado.
|
|
52
|
+
- Sem header, o servidor gera UUID.
|
|
53
|
+
|
|
54
|
+
## 4. Baseline de carga (script local)
|
|
55
|
+
|
|
56
|
+
Script: `scripts/sticker-catalog-loadtest.mjs`
|
|
57
|
+
|
|
58
|
+
Exemplo:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node scripts/sticker-catalog-loadtest.mjs \
|
|
62
|
+
--base-url http://127.0.0.1:9102 \
|
|
63
|
+
--duration-seconds 60 \
|
|
64
|
+
--concurrency 40 \
|
|
65
|
+
--paths "/api/sticker-packs?limit=24&sort=popular,/api/sticker-packs/stats,/api/sticker-packs/creators?limit=25" \
|
|
66
|
+
--out /tmp/sticker-loadtest-report.json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Interpretação rápida:
|
|
70
|
+
|
|
71
|
+
- `latency_ms.p95 <= 750` = SLO de latência cumprido
|
|
72
|
+
- `error_rate <= 0.02` = estabilidade aceitável
|
|
73
|
+
- `throughput_rps` = referência para comparar antes/depois de otimizações
|
|
74
|
+
|
|
75
|
+
## 5. Gate de rollout sugerido
|
|
76
|
+
|
|
77
|
+
1. Capturar baseline com carga atual.
|
|
78
|
+
2. Aplicar mudança de arquitetura/índice/cache.
|
|
79
|
+
3. Reexecutar carga com mesmos parâmetros.
|
|
80
|
+
4. Aprovar rollout apenas se:
|
|
81
|
+
- p95 não piorar mais de 10%
|
|
82
|
+
- erro não subir acima de 2%
|
|
83
|
+
- backlog voltar ao patamar normal em até 15 min
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Sticker 10x Hardening And Rollout
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
This runbook covers phases 4-8 of the sticker-pack scale plan:
|
|
6
|
+
|
|
7
|
+
1. ranking snapshot read path
|
|
8
|
+
2. internal outbox/event consumer
|
|
9
|
+
3. dedicated workers (classification/curation/rebuild)
|
|
10
|
+
4. object storage delivery with secure URLs
|
|
11
|
+
5. canary rollout, rollback, and final tuning
|
|
12
|
+
|
|
13
|
+
## Feature Flags
|
|
14
|
+
|
|
15
|
+
Flags are stored in `feature_flag`:
|
|
16
|
+
|
|
17
|
+
- `enable_ranking_snapshot_read`
|
|
18
|
+
- `enable_domain_event_outbox`
|
|
19
|
+
- `enable_worker_dedicated_processes`
|
|
20
|
+
- `enable_object_storage_delivery`
|
|
21
|
+
|
|
22
|
+
### Query Current Status
|
|
23
|
+
|
|
24
|
+
```sql
|
|
25
|
+
SELECT flag_name, is_enabled, rollout_percent, updated_at
|
|
26
|
+
FROM feature_flag
|
|
27
|
+
WHERE flag_name IN (
|
|
28
|
+
'enable_ranking_snapshot_read',
|
|
29
|
+
'enable_domain_event_outbox',
|
|
30
|
+
'enable_worker_dedicated_processes',
|
|
31
|
+
'enable_object_storage_delivery'
|
|
32
|
+
)
|
|
33
|
+
ORDER BY flag_name;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Update Rollout Percent
|
|
37
|
+
|
|
38
|
+
```sql
|
|
39
|
+
UPDATE feature_flag
|
|
40
|
+
SET is_enabled = 1, rollout_percent = 25, updated_by = 'ops'
|
|
41
|
+
WHERE flag_name = 'enable_worker_dedicated_processes';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Emergency Disable
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
UPDATE feature_flag
|
|
48
|
+
SET is_enabled = 0, rollout_percent = 0, updated_by = 'ops'
|
|
49
|
+
WHERE flag_name IN (
|
|
50
|
+
'enable_worker_dedicated_processes',
|
|
51
|
+
'enable_object_storage_delivery',
|
|
52
|
+
'enable_domain_event_outbox'
|
|
53
|
+
);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Canary Sequence
|
|
57
|
+
|
|
58
|
+
1. `enable_ranking_snapshot_read`: 10% -> 50% -> 100%
|
|
59
|
+
2. `enable_domain_event_outbox`: 10% -> 50% -> 100%
|
|
60
|
+
3. start dedicated worker processes and set `enable_worker_dedicated_processes`: 10% -> 50% -> 100%
|
|
61
|
+
4. `enable_object_storage_delivery`: 5% -> 25% -> 100%
|
|
62
|
+
|
|
63
|
+
Promotion gate for each step:
|
|
64
|
+
|
|
65
|
+
- HTTP p95 within target
|
|
66
|
+
- queue backlog stable (`pending`, `failed`)
|
|
67
|
+
- outbox DLQ not growing unexpectedly
|
|
68
|
+
- no sustained error-rate increase
|
|
69
|
+
|
|
70
|
+
## Dedicated Workers
|
|
71
|
+
|
|
72
|
+
Run workers as isolated processes:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm run worker:sticker:classification
|
|
76
|
+
npm run worker:sticker:curation
|
|
77
|
+
npm run worker:sticker:rebuild
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
PM2 production profile includes these workers in `ecosystem.prod.config.cjs`.
|
|
81
|
+
|
|
82
|
+
## 10x Validation
|
|
83
|
+
|
|
84
|
+
### HTTP Stress
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run loadtest:stickers -- --base-url http://127.0.0.1:9102 --duration-seconds 120 --concurrency 200 --slo-ms 750
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Queue/Worker Validation
|
|
91
|
+
|
|
92
|
+
Monitor:
|
|
93
|
+
|
|
94
|
+
- `sticker_worker_tasks_pending`
|
|
95
|
+
- `sticker_worker_tasks_processing`
|
|
96
|
+
- `sticker_worker_tasks_failed`
|
|
97
|
+
- `domain_event_outbox_pending`
|
|
98
|
+
- `domain_event_outbox_failed`
|
|
99
|
+
|
|
100
|
+
Acceptance:
|
|
101
|
+
|
|
102
|
+
- failed queues remain near zero (transient spikes allowed)
|
|
103
|
+
- pending queues recover after load burst
|
|
104
|
+
- no monotonic growth in DLQ tables
|
|
105
|
+
|
|
106
|
+
## Rollback Plan
|
|
107
|
+
|
|
108
|
+
1. Disable `enable_object_storage_delivery`.
|
|
109
|
+
2. Disable `enable_worker_dedicated_processes` (inline poller resumes).
|
|
110
|
+
3. Disable `enable_domain_event_outbox` if event flow is unstable.
|
|
111
|
+
4. Keep `enable_ranking_snapshot_read` enabled only if snapshot freshness is healthy.
|
|
112
|
+
|
|
113
|
+
Data safety notes:
|
|
114
|
+
|
|
115
|
+
- tasks/events are persisted in SQL queues
|
|
116
|
+
- failed terminal tasks/events are preserved in DLQ tables
|
|
117
|
+
- local disk read path remains fallback for sticker asset serving
|
|
118
|
+
|
|
119
|
+
## Post-Rollout Tuning
|
|
120
|
+
|
|
121
|
+
Tune these env vars after baseline:
|
|
122
|
+
|
|
123
|
+
- `STICKER_WORKER_CLASSIFICATION_CADENCE_MS`
|
|
124
|
+
- `STICKER_WORKER_CURATION_CADENCE_MS`
|
|
125
|
+
- `STICKER_WORKER_REBUILD_CADENCE_MS`
|
|
126
|
+
- `STICKER_DEDICATED_WORKER_POLL_INTERVAL_MS`
|
|
127
|
+
- `STICKER_SCORE_SNAPSHOT_REFRESH_INTERVAL_MS`
|
|
128
|
+
- `STICKER_OBJECT_STORAGE_SIGNED_URL_TTL_SECONDS`
|
package/package.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@omnizap-system/omnizap",
|
|
3
|
+
"version": "2.5.12",
|
|
4
|
+
"description": "Sistema profissional de automação WhatsApp com tecnologia Baileys",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"registry": "https://npm.pkg.github.com"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"imports": {
|
|
11
|
+
"#logger": "./utils/logger/loggerModule.js"
|
|
12
|
+
},
|
|
13
|
+
"packageManager": "npm@10.9.2",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"whatsapp",
|
|
16
|
+
"automation",
|
|
17
|
+
"baileys",
|
|
18
|
+
"omnizap",
|
|
19
|
+
"messaging",
|
|
20
|
+
"bot"
|
|
21
|
+
],
|
|
22
|
+
"author": "OmniZap Team",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"prepack": "npm run sync:npmignore",
|
|
26
|
+
"sync:npmignore": "node -e \"const fs=require('node:fs');fs.copyFileSync('.gitignore','.npmignore');console.log('synced .npmignore from .gitignore');\"",
|
|
27
|
+
"start": "node index.js",
|
|
28
|
+
"dev": "node index.js",
|
|
29
|
+
"db:init": "node database/init.js",
|
|
30
|
+
"pm2:prod": "pm2 start ecosystem.prod.config.cjs",
|
|
31
|
+
"deploy": "bash ./scripts/deploy.sh",
|
|
32
|
+
"deploy:dry-run": "DEPLOY_DRY_RUN=1 bash ./scripts/deploy.sh",
|
|
33
|
+
"build": "npm run build:all",
|
|
34
|
+
"build:all": "npm run catalog:commands && npm run build:frontend",
|
|
35
|
+
"build:frontend": "npm run build:css && npm run build:js",
|
|
36
|
+
"build:css": "npm run build:css:home && npm run build:css:user && npm run build:css:login && npm run build:css:terms && npm run build:css:api-docs && npm run build:css:stickers && npm run build:css:create-pack && npm run build:css:stickers-admin && npm run build:css:user-systemadm && npm run build:css:commands",
|
|
37
|
+
"build:js": "vite build --config ./vite.config.mjs",
|
|
38
|
+
"build:js:home": "npm run build:js",
|
|
39
|
+
"build:js:user": "npm run build:js",
|
|
40
|
+
"build:js:login": "npm run build:js",
|
|
41
|
+
"build:js:api-docs": "npm run build:js",
|
|
42
|
+
"build:js:stickers": "npm run build:js",
|
|
43
|
+
"build:js:create-pack": "npm run build:js",
|
|
44
|
+
"build:js:stickers-admin": "npm run build:js",
|
|
45
|
+
"build:js:user-systemadm": "npm run build:js",
|
|
46
|
+
"build:js:home:watch": "vite build --config ./vite.config.mjs --watch",
|
|
47
|
+
"build:css:home": "tailwindcss -i ./public/assets/css/home-react.input.css -o ./public/assets/css/home-react.css --minify",
|
|
48
|
+
"build:css:user": "tailwindcss -i ./public/assets/css/user-react.input.css -o ./public/assets/css/user-react.css --minify",
|
|
49
|
+
"build:css:login": "tailwindcss -i ./public/assets/css/login-react.input.css -o ./public/assets/css/login-react.css --minify",
|
|
50
|
+
"build:css:terms": "tailwindcss -i ./public/assets/css/terms-react.input.css -o ./public/assets/css/terms-react.css --minify",
|
|
51
|
+
"build:css:commands": "tailwindcss -i ./public/assets/css/commands-react.input.css -o ./public/assets/css/commands-react.css --minify",
|
|
52
|
+
"build:css:api-docs": "cp ./public/css/api-docs.css ./public/assets/css/api-docs.css",
|
|
53
|
+
"build:css:stickers": "tailwindcss -i ./public/assets/css/stickers-react.input.css -o ./public/assets/css/stickers-react.css --minify",
|
|
54
|
+
"build:css:create-pack": "tailwindcss -i ./public/assets/css/create-pack-react.input.css -o ./public/assets/css/create-pack-react.css --minify",
|
|
55
|
+
"build:css:stickers-admin": "cp ./public/css/stickers-admin.css ./public/assets/css/stickers-admin.css",
|
|
56
|
+
"build:css:user-systemadm": "cat ./public/css/systemadm/tokens.css ./public/css/systemadm/base.css ./public/css/systemadm/layout.css ./public/css/systemadm/components.css ./public/css/systemadm/admin.css > ./public/assets/css/user-systemadm.css",
|
|
57
|
+
"build:css:home:watch": "tailwindcss -i ./public/assets/css/home-react.input.css -o ./public/assets/css/home-react.css --watch",
|
|
58
|
+
"readme:sync-snapshot": "node ./scripts/sync-readme-snapshot.mjs",
|
|
59
|
+
"wiki:sync": "bash ./scripts/wiki-sync.sh",
|
|
60
|
+
"loadtest:stickers": "node ./scripts/sticker-catalog-loadtest.mjs",
|
|
61
|
+
"baileys:smoke": "node ./scripts/baileys-compat-smoke.mjs",
|
|
62
|
+
"worker:sticker:classification": "node ./scripts/sticker-worker-task.mjs --task-type classification_cycle",
|
|
63
|
+
"worker:sticker:curation": "node ./scripts/sticker-worker-task.mjs --task-type curation_cycle",
|
|
64
|
+
"worker:sticker:rebuild": "node ./scripts/sticker-worker-task.mjs --task-type rebuild_cycle",
|
|
65
|
+
"email:broadcast:terms": "node ./scripts/email-broadcast-terms-update.mjs",
|
|
66
|
+
"seo:generate:satellites": "node ./scripts/generate-seo-satellite-pages.mjs --out public/pages --route-prefix /seo",
|
|
67
|
+
"seo:generate:satellites:phase1": "node ./scripts/generate-seo-satellite-pages.mjs --config docs/seo/satellite-pages-phase1.json --out public/pages --route-prefix /seo",
|
|
68
|
+
"release": "bash ./scripts/release.sh",
|
|
69
|
+
"release:minor": "RELEASE_TYPE=minor bash ./scripts/release.sh",
|
|
70
|
+
"release:major": "RELEASE_TYPE=major bash ./scripts/release.sh",
|
|
71
|
+
"catalog:commands": "node ./scripts/generate-commands-catalog.mjs",
|
|
72
|
+
"test": "node --test",
|
|
73
|
+
"lint": "eslint .",
|
|
74
|
+
"lint:fix": "eslint . --fix",
|
|
75
|
+
"validate:command-configs": "node ./scripts/validate-command-configs.mjs",
|
|
76
|
+
"command-config:schema:generate": "node ./scripts/generate-command-config-schema.mjs",
|
|
77
|
+
"command-config:schema:validate": "node ./scripts/validate-command-config-schema.mjs",
|
|
78
|
+
"format": "node ./scripts/run-prettier-all.mjs --write",
|
|
79
|
+
"format:check": "node ./scripts/run-prettier-all.mjs --check",
|
|
80
|
+
"check": "npm run format:check && npm run lint && npm run validate:command-configs && npm test",
|
|
81
|
+
"ci": "npm run check && npm run build",
|
|
82
|
+
"security:audit": "npm audit --audit-level=high",
|
|
83
|
+
"security:audit:fix": "npm audit fix",
|
|
84
|
+
"security:codeql": "bash ./scripts/run-codeql-local.sh"
|
|
85
|
+
},
|
|
86
|
+
"dependencies": {
|
|
87
|
+
"@hapi/boom": "^10.0.1",
|
|
88
|
+
"@kaikybrofc/logger-module": "^1.0.4",
|
|
89
|
+
"@whiskeysockets/baileys": "github:jlucaso1/Baileys#be89465e07afa871cf3f0e19cabfec9780db6be7",
|
|
90
|
+
"argon2": "^0.44.0",
|
|
91
|
+
"axios": "^1.13.5",
|
|
92
|
+
"canvas": "^3.2.1",
|
|
93
|
+
"chalk": "^4.1.2",
|
|
94
|
+
"dotenv": "^16.5.0",
|
|
95
|
+
"envalid": "^8.0.0",
|
|
96
|
+
"express-rate-limit": "^8.3.0",
|
|
97
|
+
"ffmpeg": "^0.0.4",
|
|
98
|
+
"helmet": "^8.1.0",
|
|
99
|
+
"htm": "^3.1.1",
|
|
100
|
+
"jimp": "^1.6.0",
|
|
101
|
+
"jsonwebtoken": "^9.0.3",
|
|
102
|
+
"lodash": "^4.17.21",
|
|
103
|
+
"moment-timezone": "^0.5.48",
|
|
104
|
+
"mysql2": "^3.15.0",
|
|
105
|
+
"natural": "^8.1.1",
|
|
106
|
+
"node-cache": "^5.1.2",
|
|
107
|
+
"nodemailer": "^8.0.1",
|
|
108
|
+
"openai": "^5.23.2",
|
|
109
|
+
"pino": "^10.0.0",
|
|
110
|
+
"pino-pretty": "^13.0.0",
|
|
111
|
+
"prom-client": "^15.1.3",
|
|
112
|
+
"proper-lockfile": "^4.1.2",
|
|
113
|
+
"qrcode-terminal": "^0.12.0",
|
|
114
|
+
"react": "^18.3.1",
|
|
115
|
+
"react-dom": "^18.3.1",
|
|
116
|
+
"stream-json": "^1.9.1",
|
|
117
|
+
"uuid": "^13.0.0",
|
|
118
|
+
"webp-conv": "github:kaikybrofc/webp-conv",
|
|
119
|
+
"wink-bm25-text-search": "^3.1.2",
|
|
120
|
+
"winston": "^3.17.0",
|
|
121
|
+
"winston-daily-rotate-file": "^5.0.0",
|
|
122
|
+
"zod": "^3.25.76"
|
|
123
|
+
},
|
|
124
|
+
"devDependencies": {
|
|
125
|
+
"@tailwindcss/cli": "^4.2.1",
|
|
126
|
+
"ajv": "^8.18.0",
|
|
127
|
+
"daisyui": "^5.5.19",
|
|
128
|
+
"eslint": "^9.39.2",
|
|
129
|
+
"prettier": "^3.8.1",
|
|
130
|
+
"tailwindcss": "^4.2.1",
|
|
131
|
+
"vite": "^6.4.1"
|
|
132
|
+
},
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": ">=18.0.0"
|
|
135
|
+
},
|
|
136
|
+
"repository": {
|
|
137
|
+
"type": "git",
|
|
138
|
+
"url": "https://github.com/Omnizap-System/omnizap.git"
|
|
139
|
+
},
|
|
140
|
+
"bugs": {
|
|
141
|
+
"url": "https://github.com/Omnizap-System/omnizap/issues"
|
|
142
|
+
},
|
|
143
|
+
"homepage": "https://github.com/Omnizap-System/omnizap#readme"
|
|
144
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@plugin "daisyui" {
|
|
3
|
+
themes: night --default;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@source "../../pages/comandos.html";
|
|
7
|
+
@source "../../js/apps/commandsReactApp.js";
|
|
8
|
+
|
|
9
|
+
@layer base {
|
|
10
|
+
html[data-theme='night'] {
|
|
11
|
+
--b1: 222 47% 11%;
|
|
12
|
+
--b2: 222 44% 9%;
|
|
13
|
+
--b3: 222 40% 8%;
|
|
14
|
+
--bc: 210 40% 96%;
|
|
15
|
+
--p: 142 71% 45%;
|
|
16
|
+
--pc: 222 47% 11%;
|
|
17
|
+
--s: 217 91% 60%;
|
|
18
|
+
--sc: 210 40% 98%;
|
|
19
|
+
--rounded-box: 2rem;
|
|
20
|
+
--rounded-btn: 1rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body {
|
|
24
|
+
color: hsl(var(--bc));
|
|
25
|
+
background: #020617;
|
|
26
|
+
background-image: radial-gradient(at 0% 0%, hsla(142, 71%, 45%, 0.12) 0px, transparent 50%), radial-gradient(at 100% 0%, hsla(217, 91%, 60%, 0.12) 0px, transparent 50%);
|
|
27
|
+
min-height: 100vh;
|
|
28
|
+
font-family: 'Sora', sans-serif;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@layer components {
|
|
33
|
+
[data-reveal] {
|
|
34
|
+
opacity: 0;
|
|
35
|
+
transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
|
|
36
|
+
transition-delay: var(--reveal-delay, 0ms);
|
|
37
|
+
will-change: transform, opacity;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-reveal='fade-up'] {
|
|
41
|
+
transform: translateY(30px);
|
|
42
|
+
}
|
|
43
|
+
[data-reveal='fade-right'] {
|
|
44
|
+
transform: translateX(-20px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[data-reveal].is-visible {
|
|
48
|
+
opacity: 1;
|
|
49
|
+
transform: translate(0, 0) !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.glass-card {
|
|
53
|
+
background: rgba(255, 255, 255, 0.02);
|
|
54
|
+
backdrop-filter: blur(12px);
|
|
55
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
56
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.text-balance {
|
|
60
|
+
text-wrap: balance;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Custom scrollbar for horizontal nav */
|
|
64
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
.no-scrollbar {
|
|
68
|
+
-ms-overflow-style: none;
|
|
69
|
+
scrollbar-width: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@plugin "daisyui" {
|
|
3
|
+
themes: night --default;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@source "../../stickers/create/index.html";
|
|
7
|
+
@source "../../js/apps/createPackApp.js";
|
|
8
|
+
|
|
9
|
+
@theme {
|
|
10
|
+
--font-sans: 'Manrope', ui-sans-serif, system-ui;
|
|
11
|
+
--font-display: 'Sora', ui-sans-serif, system-ui;
|
|
12
|
+
--color-app-base: #0f172a;
|
|
13
|
+
--color-panel: #1e293b;
|
|
14
|
+
--color-panelSoft: #111827;
|
|
15
|
+
--color-line: rgb(255 255 255 / 0.07);
|
|
16
|
+
--color-accent: #2563eb;
|
|
17
|
+
--color-accent2: #7c3aed;
|
|
18
|
+
--color-cta: #22c55e;
|
|
19
|
+
--shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.35);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@layer base {
|
|
23
|
+
body {
|
|
24
|
+
color: hsl(var(--bc));
|
|
25
|
+
background: radial-gradient(64rem 36rem at -12% -18%, rgb(37 99 235 / 0.18), transparent 64%), radial-gradient(52rem 28rem at 114% -8%, rgb(124 58 237 / 0.16), transparent 66%), #020617;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#create-pack-react-root {
|
|
29
|
+
color: hsl(var(--bc));
|
|
30
|
+
}
|
|
31
|
+
}
|