@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,229 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
block-size: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
body {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
overflow-x: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.admin-shell {
|
|
12
|
+
--sidebar-width: 264px;
|
|
13
|
+
--sidebar-collapsed-width: 72px;
|
|
14
|
+
--sidebar-max-height: 100dvh;
|
|
15
|
+
--topbar-height: 72px;
|
|
16
|
+
--layout-gutter: 24px;
|
|
17
|
+
--content-max-width: 1360px;
|
|
18
|
+
--section-gap: 16px;
|
|
19
|
+
--nav-columns: 1;
|
|
20
|
+
--footer-columns: 1;
|
|
21
|
+
--metric-grid-columns: 4;
|
|
22
|
+
--admin-grid-columns: 4;
|
|
23
|
+
--health-grid-columns: 3;
|
|
24
|
+
--risk-grid-columns: 4;
|
|
25
|
+
|
|
26
|
+
inline-size: 100%;
|
|
27
|
+
block-size: 100vh;
|
|
28
|
+
block-size: 100dvh;
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
|
|
31
|
+
grid-template-rows: minmax(0, 1fr);
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
isolation: isolate;
|
|
34
|
+
transition: grid-template-columns 180ms ease;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.admin-shell[data-sidebar='collapsed'],
|
|
38
|
+
.admin-shell.is-sidebar-collapsed {
|
|
39
|
+
grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sidebar {
|
|
43
|
+
min-block-size: 0;
|
|
44
|
+
block-size: 100%;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
border-right: 1px solid var(--line-soft);
|
|
47
|
+
background: linear-gradient(180deg, #0c1423 0%, #09111e 100%);
|
|
48
|
+
padding: var(--space-6) var(--space-4) var(--space-4);
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
51
|
+
gap: var(--space-4);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.workspace {
|
|
55
|
+
min-inline-size: 0;
|
|
56
|
+
min-block-size: 0;
|
|
57
|
+
block-size: 100%;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
display: grid;
|
|
60
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.topbar {
|
|
64
|
+
min-block-size: var(--topbar-height);
|
|
65
|
+
border-bottom: 1px solid var(--line-soft);
|
|
66
|
+
background: rgba(10, 17, 30, 0.92);
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
gap: var(--space-4);
|
|
71
|
+
padding: var(--space-4) var(--space-6);
|
|
72
|
+
position: sticky;
|
|
73
|
+
top: 0;
|
|
74
|
+
z-index: 20;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.viewport {
|
|
78
|
+
block-size: 100%;
|
|
79
|
+
inline-size: min(var(--content-max-width), 100%);
|
|
80
|
+
min-inline-size: 0;
|
|
81
|
+
margin-inline: auto;
|
|
82
|
+
padding: var(--layout-gutter);
|
|
83
|
+
display: grid;
|
|
84
|
+
gap: var(--section-gap);
|
|
85
|
+
align-content: start;
|
|
86
|
+
overflow-y: auto;
|
|
87
|
+
overflow-x: hidden;
|
|
88
|
+
overscroll-behavior: contain;
|
|
89
|
+
scrollbar-gutter: stable;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.viewport > [id],
|
|
93
|
+
.admin-layout > .section[id] {
|
|
94
|
+
scroll-margin-block-start: calc(var(--topbar-height) + var(--space-5));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.admin-layout {
|
|
98
|
+
min-inline-size: 0;
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
101
|
+
gap: var(--section-gap);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.admin-layout > .section {
|
|
105
|
+
min-inline-size: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.admin-layout.is-subpage > .section[data-admin-page] {
|
|
109
|
+
grid-column: span 12;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.span-12 {
|
|
113
|
+
grid-column: span 12;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.span-8 {
|
|
117
|
+
grid-column: span 8;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.span-6 {
|
|
121
|
+
grid-column: span 6;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.span-4 {
|
|
125
|
+
grid-column: span 4;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.nav-list {
|
|
129
|
+
grid-template-columns: repeat(var(--nav-columns), minmax(0, 1fr));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.sidebar-footer {
|
|
133
|
+
grid-template-columns: repeat(var(--footer-columns), minmax(0, 1fr));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.grid {
|
|
137
|
+
grid-template-columns: repeat(var(--metric-grid-columns), minmax(0, 1fr));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.admin-grid {
|
|
141
|
+
grid-template-columns: repeat(var(--admin-grid-columns), minmax(0, 1fr));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.health-grid {
|
|
145
|
+
grid-template-columns: repeat(var(--health-grid-columns), minmax(0, 1fr));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.risk-strip,
|
|
149
|
+
.security-strip {
|
|
150
|
+
grid-template-columns: repeat(var(--risk-grid-columns), minmax(0, 1fr));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@media (max-width: 1440px) {
|
|
154
|
+
.admin-shell {
|
|
155
|
+
--content-max-width: 1240px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media (max-width: 1160px) {
|
|
160
|
+
.admin-shell {
|
|
161
|
+
--sidebar-max-height: min(22rem, 42dvh);
|
|
162
|
+
--nav-columns: 3;
|
|
163
|
+
--footer-columns: 3;
|
|
164
|
+
--layout-gutter: 16px;
|
|
165
|
+
grid-template-columns: minmax(0, 1fr);
|
|
166
|
+
grid-template-rows: minmax(0, var(--sidebar-max-height)) minmax(0, 1fr);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.sidebar {
|
|
170
|
+
max-block-size: var(--sidebar-max-height);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (max-width: 920px) {
|
|
175
|
+
.admin-shell {
|
|
176
|
+
--topbar-height: 64px;
|
|
177
|
+
--metric-grid-columns: 2;
|
|
178
|
+
--admin-grid-columns: 2;
|
|
179
|
+
--health-grid-columns: 2;
|
|
180
|
+
--risk-grid-columns: 2;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.span-8,
|
|
184
|
+
.span-6,
|
|
185
|
+
.span-4 {
|
|
186
|
+
grid-column: span 12;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@media (max-width: 680px) {
|
|
191
|
+
.admin-shell {
|
|
192
|
+
--sidebar-max-height: min(20rem, 48dvh);
|
|
193
|
+
--nav-columns: 2;
|
|
194
|
+
--footer-columns: 1;
|
|
195
|
+
--metric-grid-columns: 1;
|
|
196
|
+
--admin-grid-columns: 1;
|
|
197
|
+
--health-grid-columns: 1;
|
|
198
|
+
--risk-grid-columns: 1;
|
|
199
|
+
--topbar-height: 56px;
|
|
200
|
+
--layout-gutter: 12px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.topbar {
|
|
204
|
+
padding: var(--space-3);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.sidebar {
|
|
208
|
+
padding: var(--space-3);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.admin-form-row,
|
|
212
|
+
.admin-inline-form {
|
|
213
|
+
grid-template-columns: 1fr;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.profile {
|
|
217
|
+
grid-template-columns: 1fr;
|
|
218
|
+
text-align: center;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.avatar {
|
|
222
|
+
margin-inline: auto;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.topbar-right {
|
|
226
|
+
inline-size: 100%;
|
|
227
|
+
justify-content: space-between;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--font-body: 'Manrope', system-ui, sans-serif;
|
|
3
|
+
--font-display: 'Sora', system-ui, sans-serif;
|
|
4
|
+
|
|
5
|
+
--fs-12: 0.75rem;
|
|
6
|
+
--fs-14: 0.875rem;
|
|
7
|
+
--fs-16: 1rem;
|
|
8
|
+
--fs-20: 1.25rem;
|
|
9
|
+
--fs-24: 1.5rem;
|
|
10
|
+
--fs-32: 2rem;
|
|
11
|
+
|
|
12
|
+
--lh-tight: 1.2;
|
|
13
|
+
--lh-body: 1.5;
|
|
14
|
+
|
|
15
|
+
--space-1: 4px;
|
|
16
|
+
--space-2: 8px;
|
|
17
|
+
--space-3: 12px;
|
|
18
|
+
--space-4: 16px;
|
|
19
|
+
--space-5: 20px;
|
|
20
|
+
--space-6: 24px;
|
|
21
|
+
--space-7: 28px;
|
|
22
|
+
--space-8: 32px;
|
|
23
|
+
|
|
24
|
+
--bg-canvas: #070d18;
|
|
25
|
+
--bg-surface: #0d1626;
|
|
26
|
+
--bg-surface-2: #111d32;
|
|
27
|
+
--bg-surface-3: #16253f;
|
|
28
|
+
--bg-surface-4: #1a2d4a;
|
|
29
|
+
|
|
30
|
+
--line-soft: rgba(149, 167, 195, 0.2);
|
|
31
|
+
--line-strong: rgba(149, 167, 195, 0.38);
|
|
32
|
+
--line-focus: rgba(94, 169, 255, 0.5);
|
|
33
|
+
|
|
34
|
+
--text-main: #f2f7ff;
|
|
35
|
+
--text-soft: #a8b6cc;
|
|
36
|
+
--text-mute: #7f8ba1;
|
|
37
|
+
|
|
38
|
+
--accent: #5aaeff;
|
|
39
|
+
--accent-2: #34d399;
|
|
40
|
+
--accent-warn: #fbbf24;
|
|
41
|
+
--accent-danger: #ef4444;
|
|
42
|
+
|
|
43
|
+
--status-ok: #22c55e;
|
|
44
|
+
--status-warning: #f59e0b;
|
|
45
|
+
--status-error: #ef4444;
|
|
46
|
+
--status-info: #60a5fa;
|
|
47
|
+
|
|
48
|
+
--radius-lg: 20px;
|
|
49
|
+
--radius-md: 14px;
|
|
50
|
+
--radius-sm: 10px;
|
|
51
|
+
--radius-xs: 8px;
|
|
52
|
+
|
|
53
|
+
--shadow-card: 0 12px 28px rgba(2, 8, 24, 0.38);
|
|
54
|
+
--shadow-soft: 0 6px 14px rgba(2, 8, 20, 0.28);
|
|
55
|
+
--shadow-none: 0 0 0 rgba(0, 0, 0, 0);
|
|
56
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
const h = React.createElement;
|
|
5
|
+
|
|
6
|
+
function Icon({ cls }) {
|
|
7
|
+
return h('i', { className: `icon ${cls}`, 'aria-hidden': 'true' });
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function Card({ title, code, iconClass }) {
|
|
11
|
+
return h('section', { className: 'card' }, h('h2', null, h(Icon, { cls: iconClass || 'fa-solid fa-file-code' }), title), h('pre', null, h('code', null, code)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function SectionTitle({ iconClass, children }) {
|
|
15
|
+
return h('h2', { className: 'section-title' }, h(Icon, { cls: iconClass }), children);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function StatusPanel() {
|
|
19
|
+
const [state, setState] = useState({
|
|
20
|
+
loading: true,
|
|
21
|
+
ok: false,
|
|
22
|
+
latencyMs: null,
|
|
23
|
+
cpu: null,
|
|
24
|
+
ram: null,
|
|
25
|
+
uptime: null,
|
|
26
|
+
error: '',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
let active = true;
|
|
31
|
+
|
|
32
|
+
const load = async () => {
|
|
33
|
+
const start = Date.now();
|
|
34
|
+
try {
|
|
35
|
+
const response = await fetch('/api/home-bootstrap');
|
|
36
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
37
|
+
const payload = await response.json();
|
|
38
|
+
const summary = payload?.data?.system_summary || {};
|
|
39
|
+
const host = summary.host || {};
|
|
40
|
+
const process = summary.process || {};
|
|
41
|
+
|
|
42
|
+
if (!active) return;
|
|
43
|
+
setState({
|
|
44
|
+
loading: false,
|
|
45
|
+
ok: true,
|
|
46
|
+
latencyMs: Date.now() - start,
|
|
47
|
+
cpu: Number.isFinite(Number(host.cpu_percent)) ? `${Number(host.cpu_percent).toFixed(2)}%` : 'n/d',
|
|
48
|
+
ram: host.memory_used && host.memory_total ? `${host.memory_used} / ${host.memory_total} (${Number(host.memory_percent || 0).toFixed(2)}%)` : 'n/d',
|
|
49
|
+
uptime: process.uptime || 'n/d',
|
|
50
|
+
error: '',
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (!active) return;
|
|
54
|
+
setState({
|
|
55
|
+
loading: false,
|
|
56
|
+
ok: false,
|
|
57
|
+
latencyMs: null,
|
|
58
|
+
cpu: null,
|
|
59
|
+
ram: null,
|
|
60
|
+
uptime: null,
|
|
61
|
+
error: error?.message || 'Falha ao consultar status da API',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
load();
|
|
67
|
+
const timer = setInterval(load, 60 * 1000);
|
|
68
|
+
return () => {
|
|
69
|
+
active = false;
|
|
70
|
+
clearInterval(timer);
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
74
|
+
const statusLabel = state.loading ? 'Consultando...' : state.ok ? 'Online' : 'Instável';
|
|
75
|
+
const statusClass = state.loading ? 'badge badge-warn' : state.ok ? 'badge badge-ok' : 'badge badge-bad';
|
|
76
|
+
|
|
77
|
+
return h('section', { className: 'card' }, h('h3', { className: 'sub-title' }, h(Icon, { cls: 'fa-solid fa-heart-pulse' }), 'Status em tempo real'), h('div', { className: 'status-row' }, h('span', { className: statusClass }, statusLabel), state.latencyMs ? h('span', { className: 'status-meta' }, `Latência: ${state.latencyMs}ms`) : null), h('div', { className: 'status-grid' }, h('div', { className: 'status-item' }, h('strong', null, 'CPU host'), h('span', null, state.cpu || 'n/d')), h('div', { className: 'status-item' }, h('strong', null, 'RAM host'), h('span', null, state.ram || 'n/d')), h('div', { className: 'status-item' }, h('strong', null, 'Uptime processo'), h('span', null, state.uptime || 'n/d'))), state.error ? h('p', { className: 'status-error' }, `Falha: ${state.error}`) : null);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function ApiDocsApp() {
|
|
81
|
+
return h(
|
|
82
|
+
'main',
|
|
83
|
+
{ className: 'wrap' },
|
|
84
|
+
h(
|
|
85
|
+
'div',
|
|
86
|
+
{ className: 'top' },
|
|
87
|
+
h('a', { href: '/' }, h(Icon, { cls: 'fa-solid fa-house' }), 'Home'),
|
|
88
|
+
h('a', { href: '/stickers/' }, h(Icon, { cls: 'fa-solid fa-icons' }), 'Stickers'),
|
|
89
|
+
h('a', { href: '/termos-de-uso/' }, h(Icon, { cls: 'fa-solid fa-file-contract' }), 'Termos'),
|
|
90
|
+
h('a', { href: '/licenca/' }, h(Icon, { cls: 'fa-solid fa-scale-balanced' }), 'Licença'),
|
|
91
|
+
h(
|
|
92
|
+
'a',
|
|
93
|
+
{
|
|
94
|
+
href: 'https://github.com/Omnizap-System/omnizap',
|
|
95
|
+
target: '_blank',
|
|
96
|
+
rel: 'noreferrer noopener',
|
|
97
|
+
},
|
|
98
|
+
h(Icon, { cls: 'fa-brands fa-github' }),
|
|
99
|
+
'GitHub',
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
h('h1', null, h(Icon, { cls: 'fa-solid fa-code' }), 'OmniZap API | Área de Desenvolvedor'),
|
|
103
|
+
h('p', null, 'Documentação técnica da API OmniZap para bots e automação WhatsApp, com o catálogo de stickers como módulo integrável.'),
|
|
104
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-route' }, 'Casos de uso'),
|
|
105
|
+
h('section', { className: 'card' }, h('ul', { className: 'list' }, h('li', null, 'Operar bot WhatsApp com endpoints públicos para conteúdo e interação.'), h('li', null, 'Integrar server-to-server para sincronizar packs, stickers e métricas.'), h('li', null, 'Conectar automações internas (CRM, suporte, marketing e comunidades).'))),
|
|
106
|
+
h('section', { className: 'card' }, h('h2', null, h(Icon, { cls: 'fa-solid fa-diagram-project' }), 'Mapa da plataforma'), h('p', null, 'O domínio principal é a plataforma de bot + API. O catálogo de stickers funciona como feature integrada para distribuição e engajamento.'), h('ul', { className: 'list' }, h('li', null, 'Página principal: / (plataforma OmniZap)'), h('li', null, 'Catálogo: /stickers/ (módulo de stickers)'), h('li', null, 'Packs públicos: /stickers/{packKey} (landing de conteúdo)'))),
|
|
107
|
+
h(StatusPanel),
|
|
108
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-plug-circle-check' }, 'Endpoints'),
|
|
109
|
+
h(Card, {
|
|
110
|
+
title: 'Base URL',
|
|
111
|
+
code: 'https://omnizap.shop/api/sticker-packs',
|
|
112
|
+
iconClass: 'fa-solid fa-link',
|
|
113
|
+
}),
|
|
114
|
+
h(Card, {
|
|
115
|
+
title: 'Listar packs',
|
|
116
|
+
code: 'GET /api/sticker-packs?q=&visibility=public|unlisted|all&limit=&offset=',
|
|
117
|
+
iconClass: 'fa-solid fa-layer-group',
|
|
118
|
+
}),
|
|
119
|
+
h(Card, {
|
|
120
|
+
title: 'Listar stickers sem pack',
|
|
121
|
+
code: 'GET /api/sticker-packs/orphan-stickers?q=&categories=&limit=&offset=',
|
|
122
|
+
iconClass: 'fa-solid fa-box-open',
|
|
123
|
+
}),
|
|
124
|
+
h(Card, {
|
|
125
|
+
title: 'Detalhes de pack',
|
|
126
|
+
code: 'GET /api/sticker-packs/:packKey',
|
|
127
|
+
iconClass: 'fa-solid fa-circle-info',
|
|
128
|
+
}),
|
|
129
|
+
h(Card, {
|
|
130
|
+
title: 'Interações do pack (dados reais)',
|
|
131
|
+
code: 'POST /api/sticker-packs/:packKey/open\n' + 'POST /api/sticker-packs/:packKey/like\n' + 'POST /api/sticker-packs/:packKey/dislike',
|
|
132
|
+
iconClass: 'fa-solid fa-thumbs-up',
|
|
133
|
+
}),
|
|
134
|
+
h(Card, {
|
|
135
|
+
title: 'Contato de suporte',
|
|
136
|
+
code: 'GET /api/support',
|
|
137
|
+
iconClass: 'fa-brands fa-whatsapp',
|
|
138
|
+
}),
|
|
139
|
+
h(Card, {
|
|
140
|
+
title: 'Imagem de sticker',
|
|
141
|
+
code: 'GET /api/sticker-packs/:packKey/stickers/:stickerId.webp\nGET /data/stickers/:owner/:file.webp',
|
|
142
|
+
iconClass: 'fa-solid fa-image',
|
|
143
|
+
}),
|
|
144
|
+
h(Card, {
|
|
145
|
+
title: 'Resumo de métricas do sistema',
|
|
146
|
+
code: 'GET /api/system-summary',
|
|
147
|
+
iconClass: 'fa-solid fa-gauge-high',
|
|
148
|
+
}),
|
|
149
|
+
h(Card, {
|
|
150
|
+
title: 'Resumo do projeto no GitHub',
|
|
151
|
+
code: 'GET /api/project-summary',
|
|
152
|
+
iconClass: 'fa-brands fa-github',
|
|
153
|
+
}),
|
|
154
|
+
h(Card, {
|
|
155
|
+
title: 'Ranking global (cacheado)',
|
|
156
|
+
code: 'GET /api/global-ranking-summary',
|
|
157
|
+
iconClass: 'fa-solid fa-ranking-star',
|
|
158
|
+
}),
|
|
159
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-brackets-curly' }, 'Como a API responde'),
|
|
160
|
+
h(Card, {
|
|
161
|
+
title: 'Padrão de resposta (sucesso)',
|
|
162
|
+
code: '{\n' + ' "data": [ ... ],\n' + ' "pagination": { "limit": 24, "offset": 0, "has_more": true, "next_offset": 24 },\n' + ' "filters": { "q": "", "visibility": "public", "categories": [] }\n' + '}',
|
|
163
|
+
iconClass: 'fa-solid fa-circle-check',
|
|
164
|
+
}),
|
|
165
|
+
h(Card, {
|
|
166
|
+
title: 'Padrão de resposta (erro)',
|
|
167
|
+
code: '{\n' + ' "ok": false,\n' + ' "error": "mensagem descritiva do erro"\n' + '}',
|
|
168
|
+
iconClass: 'fa-solid fa-triangle-exclamation',
|
|
169
|
+
}),
|
|
170
|
+
h(Card, {
|
|
171
|
+
title: 'Exemplo real de retorno (pack + engagement)',
|
|
172
|
+
code: '{\n' + ' "data": {\n' + ' "pack_key": "auto-manga-panel-2-iu4n2",\n' + ' "name": "[AUTO] Manga Panel #2",\n' + ' "sticker_count": 30,\n' + ' "tags": ["manga-panel", "anime"],\n' + ' "engagement": {\n' + ' "open_count": 120,\n' + ' "like_count": 34,\n' + ' "dislike_count": 2,\n' + ' "score": 32\n' + ' }\n' + ' }\n' + '}',
|
|
173
|
+
iconClass: 'fa-solid fa-database',
|
|
174
|
+
}),
|
|
175
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-filter' }, 'Filtros e paginação'),
|
|
176
|
+
h(Card, {
|
|
177
|
+
title: 'Parâmetros principais',
|
|
178
|
+
code: 'q: texto de busca (nome, publisher, descrição, pack_key)\n' + 'visibility: public | unlisted | all\n' + 'categories: lista separada por vírgula (ex: anime,meme)\n' + 'limit: tamanho da página\n' + 'offset: deslocamento para próxima página',
|
|
179
|
+
iconClass: 'fa-solid fa-sliders',
|
|
180
|
+
}),
|
|
181
|
+
h(Card, {
|
|
182
|
+
title: 'Exemplo de paginação incremental',
|
|
183
|
+
code: 'GET /api/sticker-packs?visibility=public&limit=24&offset=0\n' + 'GET /api/sticker-packs?visibility=public&limit=24&offset=24\n' + 'GET /api/sticker-packs?visibility=public&limit=24&offset=48',
|
|
184
|
+
iconClass: 'fa-solid fa-forward-step',
|
|
185
|
+
}),
|
|
186
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-diagram-project' }, 'Como integrar no seu sistema'),
|
|
187
|
+
h(Card, {
|
|
188
|
+
title: 'Passo a passo de integração',
|
|
189
|
+
code: '1) Defina a base URL: https://omnizap.shop/api/sticker-packs\n' + '2) Faça um health-check inicial em /system-summary\n' + '3) Liste packs com /?visibility=public&limit=24\n' + '4) Abra detalhes com /:packKey\n' + '5) Baixe stickers com /:packKey/stickers/:stickerId.webp\n' + '6) Trate paginação usando limit/offset e has_more',
|
|
190
|
+
iconClass: 'fa-solid fa-list-check',
|
|
191
|
+
}),
|
|
192
|
+
h(Card, {
|
|
193
|
+
title: 'Exemplo cURL',
|
|
194
|
+
code: 'curl -sS "https://omnizap.shop/api/sticker-packs?visibility=public&limit=5"\n' + 'curl -sS "https://omnizap.shop/api/sticker-packs?categories=anime,meme&limit=12"\n' + 'curl -sS "https://omnizap.shop/api/sticker-packs/orphan-stickers?limit=20&offset=0"\n' + 'curl -sS -X POST "https://omnizap.shop/api/sticker-packs/<packKey>/open"\n' + 'curl -sS -X POST "https://omnizap.shop/api/sticker-packs/<packKey>/like"\n' + 'curl -sS "https://omnizap.shop/api/support"\n' + 'curl -sS "https://omnizap.shop/api/system-summary"\n' + 'curl -sS "https://omnizap.shop/api/project-summary"',
|
|
195
|
+
iconClass: 'fa-solid fa-terminal',
|
|
196
|
+
}),
|
|
197
|
+
h(Card, {
|
|
198
|
+
title: 'Exemplo JavaScript (fetch)',
|
|
199
|
+
code: "const API_BASE = 'https://omnizap.shop/api/sticker-packs';\n\n" + 'async function getPublicPacks() {\n' + ' const url = `${API_BASE}?visibility=public&limit=24&offset=0`;\n' + ' const response = await fetch(url);\n' + ' if (!response.ok) throw new Error(`HTTP ${response.status}`);\n' + ' const payload = await response.json();\n' + ' return payload?.data || [];\n' + '}\n\n' + 'async function getPackDetails(packKey) {\n' + ' const response = await fetch(`${API_BASE}/${encodeURIComponent(packKey)}`);\n' + ' if (!response.ok) throw new Error(`HTTP ${response.status}`);\n' + ' const payload = await response.json();\n' + ' return payload?.data || null;\n' + '}\n\n' + '(async () => {\n' + ' try {\n' + ' const packs = await getPublicPacks();\n' + " console.log('Packs encontrados:', packs.length);\n" + ' if (packs[0]?.pack_key) {\n' + ' const details = await getPackDetails(packs[0].pack_key);\n' + " console.log('Primeiro pack:', details?.name, details?.pack_key);\n" + " await fetch(`${API_BASE}/${encodeURIComponent(packs[0].pack_key)}/open`, { method: 'POST' });\n" + ' }\n' + ' } catch (error) {\n' + " console.error('Falha ao consumir API:', error.message);\n" + ' }\n' + '})();',
|
|
200
|
+
iconClass: 'fa-brands fa-js',
|
|
201
|
+
}),
|
|
202
|
+
h(Card, {
|
|
203
|
+
title: 'Exemplo Node.js (backend / integração server-to-server)',
|
|
204
|
+
code: "const API_BASE = 'https://omnizap.shop/api/sticker-packs';\n" + '\n' + 'export async function syncCatalogPage(offset = 0) {\n' + ' const url = `${API_BASE}?visibility=public&limit=50&offset=${offset}`;\n' + ' const response = await fetch(url, { headers: { Accept: "application/json" } });\n' + ' if (!response.ok) throw new Error(`Catalog HTTP ${response.status}`);\n' + ' const payload = await response.json();\n' + ' const packs = payload?.data || [];\n' + ' const nextOffset = payload?.pagination?.next_offset;\n' + ' return { packs, nextOffset, hasMore: Boolean(payload?.pagination?.has_more) };\n' + '}\n' + '\n' + 'export async function markPackLike(packKey) {\n' + ' const response = await fetch(`${API_BASE}/${encodeURIComponent(packKey)}/like`, { method: "POST" });\n' + ' if (!response.ok) throw new Error(`Like HTTP ${response.status}`);\n' + ' return response.json();\n' + '}',
|
|
205
|
+
iconClass: 'fa-solid fa-server',
|
|
206
|
+
}),
|
|
207
|
+
h(SectionTitle, { iconClass: 'fa-solid fa-circle-question' }, 'FAQ rápido'),
|
|
208
|
+
h(Card, {
|
|
209
|
+
title: 'Para que serve a API OmniZap?',
|
|
210
|
+
code: 'Ela permite integrar bots e automações WhatsApp com catálogo de stickers, métricas e fluxos técnicos.',
|
|
211
|
+
iconClass: 'fa-solid fa-circle-question',
|
|
212
|
+
}),
|
|
213
|
+
h(Card, {
|
|
214
|
+
title: 'Posso usar packs no meu bot?',
|
|
215
|
+
code: 'Sim. Consulte packs públicos, detalhe itens e registre interações para montar experiências no seu bot.',
|
|
216
|
+
iconClass: 'fa-solid fa-puzzle-piece',
|
|
217
|
+
}),
|
|
218
|
+
h(Card, {
|
|
219
|
+
title: 'Onde ver o catálogo web?',
|
|
220
|
+
code: 'https://omnizap.shop/stickers/',
|
|
221
|
+
iconClass: 'fa-solid fa-icons',
|
|
222
|
+
}),
|
|
223
|
+
h(Card, {
|
|
224
|
+
title: 'Checklist de produção',
|
|
225
|
+
code: '- Implementar retry com backoff (429/5xx)\n' + '- Cachear listagens por 30-120s no seu sistema\n' + '- Validar next_offset para paginação contínua\n' + '- Tratar 404 de pack removido/inválido\n' + '- Registrar métricas de latência e taxa de erro do consumo',
|
|
226
|
+
iconClass: 'fa-solid fa-shield-heart',
|
|
227
|
+
}),
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const rootEl = document.getElementById('api-docs-react-root');
|
|
232
|
+
if (rootEl) {
|
|
233
|
+
const root = createRoot(rootEl);
|
|
234
|
+
root.render(h(ApiDocsApp));
|
|
235
|
+
}
|