@silasfmartins/testhub 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +520 -0
- package/biome.json +37 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +169 -0
- package/dist/scripts/consumer-postinstall.d.ts +15 -0
- package/dist/scripts/consumer-postinstall.js +785 -0
- package/dist/scripts/generate-docs.d.ts +16 -0
- package/dist/scripts/generate-docs.js +1363 -0
- package/dist/scripts/generate-index.d.ts +2 -0
- package/dist/scripts/generate-index.js +314 -0
- package/dist/scripts/init-api.d.ts +2 -0
- package/dist/scripts/init-api.js +525 -0
- package/dist/scripts/init-banco.d.ts +2 -0
- package/dist/scripts/init-banco.js +347 -0
- package/dist/scripts/init-frontend.d.ts +2 -0
- package/dist/scripts/init-frontend.js +627 -0
- package/dist/scripts/init-mobile.d.ts +2 -0
- package/dist/scripts/init-mobile.js +481 -0
- package/dist/scripts/init-scenarios.d.ts +2 -0
- package/dist/scripts/init-scenarios.js +846 -0
- package/dist/scripts/init-ssh.d.ts +2 -0
- package/dist/scripts/init-ssh.js +639 -0
- package/dist/scripts/package-versions.d.ts +57 -0
- package/dist/scripts/package-versions.js +768 -0
- package/dist/scripts/postinstall.d.ts +1 -0
- package/dist/scripts/postinstall.js +527 -0
- package/dist/scripts/robust-build.d.ts +7 -0
- package/dist/scripts/robust-build.js +88 -0
- package/dist/scripts/setup-local-packages.d.ts +31 -0
- package/dist/scripts/setup-local-packages.js +237 -0
- package/dist/scripts/smart-override.d.ts +2 -0
- package/dist/scripts/smart-override.js +1360 -0
- package/dist/scripts/sync-configs.d.ts +27 -0
- package/dist/scripts/sync-configs.js +248 -0
- package/dist/scripts/test-biome-parse.d.ts +5 -0
- package/dist/scripts/test-biome-parse.js +84 -0
- package/dist/scripts/ultracite-setup.d.ts +4 -0
- package/dist/scripts/ultracite-setup.js +310 -0
- package/dist/scripts/update-all-init-scripts.d.ts +2 -0
- package/dist/scripts/update-all-init-scripts.js +52 -0
- package/dist/scripts/update-biome-schema.d.ts +15 -0
- package/dist/scripts/update-biome-schema.js +124 -0
- package/dist/src/AutoCoreFacade.d.ts +145 -0
- package/dist/src/AutoCoreFacade.js +217 -0
- package/dist/src/api/ApiActions.d.ts +297 -0
- package/dist/src/api/ApiActions.js +1905 -0
- package/dist/src/api/Certificate.d.ts +60 -0
- package/dist/src/api/Certificate.js +79 -0
- package/dist/src/api/JsonResponse.d.ts +116 -0
- package/dist/src/api/JsonResponse.js +206 -0
- package/dist/src/appium/DeviceFarmViewer.d.ts +79 -0
- package/dist/src/appium/DeviceFarmViewer.js +1083 -0
- package/dist/src/appium/MobileActions.d.ts +347 -0
- package/dist/src/appium/MobileActions.js +1632 -0
- package/dist/src/appium/MobileConnection.d.ts +160 -0
- package/dist/src/appium/MobileConnection.js +772 -0
- package/dist/src/config/envLoader.d.ts +123 -0
- package/dist/src/config/envLoader.js +361 -0
- package/dist/src/config/jest-safe-setup.d.ts +19 -0
- package/dist/src/config/jest-safe-setup.js +369 -0
- package/dist/src/config/timeouts.d.ts +32 -0
- package/dist/src/config/timeouts.js +38 -0
- package/dist/src/desktop/DesktopActions.d.ts +46 -0
- package/dist/src/desktop/DesktopActions.js +398 -0
- package/dist/src/desktop/DesktopConnection.d.ts +32 -0
- package/dist/src/desktop/DesktopConnection.js +84 -0
- package/dist/src/domain/entities/TestExecution.d.ts +117 -0
- package/dist/src/domain/entities/TestExecution.js +150 -0
- package/dist/src/domain/entities/TestReport.d.ts +114 -0
- package/dist/src/domain/entities/TestReport.js +179 -0
- package/dist/src/domain/repositories/ITestRepository.d.ts +196 -0
- package/dist/src/domain/repositories/ITestRepository.js +14 -0
- package/dist/src/domain/schemas/ValidationSchemas.d.ts +159 -0
- package/dist/src/domain/schemas/ValidationSchemas.js +181 -0
- package/dist/src/functions/errors/BaseError.d.ts +78 -0
- package/dist/src/functions/errors/BaseError.js +245 -0
- package/dist/src/functions/errors/ConfigurationError.d.ts +16 -0
- package/dist/src/functions/errors/ConfigurationError.js +48 -0
- package/dist/src/functions/errors/ErrorCatalog.d.ts +148 -0
- package/dist/src/functions/errors/ErrorCatalog.js +157 -0
- package/dist/src/functions/errors/GlobalErrorHandler.d.ts +101 -0
- package/dist/src/functions/errors/GlobalErrorHandler.js +281 -0
- package/dist/src/functions/errors/IntegrationError.d.ts +17 -0
- package/dist/src/functions/errors/IntegrationError.js +51 -0
- package/dist/src/functions/errors/SecurityError.d.ts +14 -0
- package/dist/src/functions/errors/SecurityError.js +42 -0
- package/dist/src/functions/errors/SystemError.d.ts +12 -0
- package/dist/src/functions/errors/SystemError.js +36 -0
- package/dist/src/functions/errors/ValidationError.d.ts +14 -0
- package/dist/src/functions/errors/ValidationError.js +61 -0
- package/dist/src/functions/errors/index.d.ts +12 -0
- package/dist/src/functions/errors/index.js +13 -0
- package/dist/src/global-setup.d.ts +1 -0
- package/dist/src/global-setup.js +1037 -0
- package/dist/src/helpers/BancoActions.d.ts +188 -0
- package/dist/src/helpers/BancoActions.js +581 -0
- package/dist/src/helpers/EnviromentHelper.d.ts +17 -0
- package/dist/src/helpers/EnviromentHelper.js +66 -0
- package/dist/src/helpers/ParallelExecutionHelper.d.ts +183 -0
- package/dist/src/helpers/ParallelExecutionHelper.js +375 -0
- package/dist/src/helpers/SyncSignal.d.ts +15 -0
- package/dist/src/helpers/SyncSignal.js +44 -0
- package/dist/src/hubdocs/CategoryDetector.d.ts +83 -0
- package/dist/src/hubdocs/CategoryDetector.js +401 -0
- package/dist/src/hubdocs/DirectStatementInterceptor.d.ts +54 -0
- package/dist/src/hubdocs/DirectStatementInterceptor.js +243 -0
- package/dist/src/hubdocs/ExecutionTracker.d.ts +107 -0
- package/dist/src/hubdocs/ExecutionTracker.js +702 -0
- package/dist/src/hubdocs/HubDocs.d.ts +395 -0
- package/dist/src/hubdocs/HubDocs.js +3586 -0
- package/dist/src/hubdocs/StatementMethodFilter.d.ts +71 -0
- package/dist/src/hubdocs/StatementMethodFilter.js +618 -0
- package/dist/src/hubdocs/StatementTracker.d.ts +417 -0
- package/dist/src/hubdocs/StatementTracker.js +2419 -0
- package/dist/src/hubdocs/SwaggerGenerator.d.ts +59 -0
- package/dist/src/hubdocs/SwaggerGenerator.js +405 -0
- package/dist/src/hubdocs/index.d.ts +9 -0
- package/dist/src/hubdocs/index.js +9 -0
- package/dist/src/hubdocs/types.d.ts +114 -0
- package/dist/src/hubdocs/types.js +5 -0
- package/dist/src/infrastructure/DependencyContainer.d.ts +142 -0
- package/dist/src/infrastructure/DependencyContainer.js +250 -0
- package/dist/src/infrastructure/adapters/AppiumAdapter.d.ts +168 -0
- package/dist/src/infrastructure/adapters/AppiumAdapter.js +468 -0
- package/dist/src/infrastructure/adapters/OracleAdapter.d.ts +150 -0
- package/dist/src/infrastructure/adapters/OracleAdapter.js +388 -0
- package/dist/src/infrastructure/adapters/PlaywrightAdapter.d.ts +192 -0
- package/dist/src/infrastructure/adapters/PlaywrightAdapter.js +382 -0
- package/dist/src/infrastructure/adapters/SSHAdapter.d.ts +141 -0
- package/dist/src/infrastructure/adapters/SSHAdapter.js +428 -0
- package/dist/src/interfaces.d.ts +501 -0
- package/dist/src/interfaces.js +25 -0
- package/dist/src/internal/fakes/__fake-actions__.d.ts +17 -0
- package/dist/src/internal/fakes/__fake-actions__.js +21 -0
- package/dist/src/internal/fakes/__forbidden__.d.ts +10 -0
- package/dist/src/internal/fakes/__forbidden__.js +18 -0
- package/dist/src/internal/fakes/__honeypot__.d.ts +15 -0
- package/dist/src/internal/fakes/__honeypot__.js +24 -0
- package/dist/src/octane/OctaneReporter.d.ts +13 -0
- package/dist/src/octane/OctaneReporter.js +61 -0
- package/dist/src/playwright/CryptoActions.d.ts +20 -0
- package/dist/src/playwright/CryptoActions.js +75 -0
- package/dist/src/playwright/EnhancedWebActions.d.ts +7 -0
- package/dist/src/playwright/EnhancedWebActions.js +65 -0
- package/dist/src/playwright/WebActions.d.ts +1599 -0
- package/dist/src/playwright/WebActions.js +11788 -0
- package/dist/src/playwright/actions/ActionTimeline.d.ts +36 -0
- package/dist/src/playwright/actions/ActionTimeline.js +101 -0
- package/dist/src/playwright/actions/RecoveryQueue.d.ts +82 -0
- package/dist/src/playwright/actions/RecoveryQueue.js +130 -0
- package/dist/src/playwright/actions/SelectorCache.d.ts +53 -0
- package/dist/src/playwright/actions/SelectorCache.js +96 -0
- package/dist/src/playwright/actions/index.d.ts +13 -0
- package/dist/src/playwright/actions/index.js +14 -0
- package/dist/src/playwright/actions/types.d.ts +147 -0
- package/dist/src/playwright/actions/types.js +5 -0
- package/dist/src/playwright/fixtures.d.ts +112 -0
- package/dist/src/playwright/fixtures.js +718 -0
- package/dist/src/playwright/network-logs-reporter.d.ts +7 -0
- package/dist/src/playwright/network-logs-reporter.js +66 -0
- package/dist/src/playwright/registerRecoveryWrappers.d.ts +1 -0
- package/dist/src/playwright/registerRecoveryWrappers.js +54 -0
- package/dist/src/security/BuildSecurity.d.ts +12 -0
- package/dist/src/security/BuildSecurity.js +138 -0
- package/dist/src/security/EulaProtection.d.ts +70 -0
- package/dist/src/security/EulaProtection.js +155 -0
- package/dist/src/security/HoneypotManager.d.ts +46 -0
- package/dist/src/security/HoneypotManager.js +234 -0
- package/dist/src/security/KeysManager.d.ts +36 -0
- package/dist/src/security/KeysManager.js +158 -0
- package/dist/src/security/ProofOfWorkIntegration.d.ts +64 -0
- package/dist/src/security/ProofOfWorkIntegration.js +206 -0
- package/dist/src/security/SecurityValidation.d.ts +21 -0
- package/dist/src/security/SecurityValidation.js +163 -0
- package/dist/src/security/SourceMapProtection.d.ts +55 -0
- package/dist/src/security/SourceMapProtection.js +220 -0
- package/dist/src/security/protector.d.ts +1 -0
- package/dist/src/security/protector.js +97 -0
- package/dist/src/ssh/SSHActions.d.ts +262 -0
- package/dist/src/ssh/SSHActions.js +790 -0
- package/dist/src/ssh/SSHClient.d.ts +99 -0
- package/dist/src/ssh/SSHClient.js +409 -0
- package/dist/src/statements/BaseStatement.d.ts +38 -0
- package/dist/src/statements/BaseStatement.js +78 -0
- package/dist/src/testContext/AuthStateManager.d.ts +93 -0
- package/dist/src/testContext/AuthStateManager.js +256 -0
- package/dist/src/testContext/CoverageManager.d.ts +198 -0
- package/dist/src/testContext/CoverageManager.js +917 -0
- package/dist/src/testContext/TestAnnotations.d.ts +476 -0
- package/dist/src/testContext/TestAnnotations.js +2647 -0
- package/dist/src/testContext/TestContext.d.ts +138 -0
- package/dist/src/testContext/TestContext.js +369 -0
- package/dist/src/testContext/UnifiedHtmlGenerator.d.ts +7 -0
- package/dist/src/testContext/UnifiedHtmlGenerator.js +264 -0
- package/dist/src/testContext/UnifiedReportManager.d.ts +211 -0
- package/dist/src/testContext/UnifiedReportManager.js +1206 -0
- package/dist/src/testhub/DynamicConfigManager.d.ts +121 -0
- package/dist/src/testhub/DynamicConfigManager.js +320 -0
- package/dist/src/testhub/SystemsManager.d.ts +119 -0
- package/dist/src/testhub/SystemsManager.js +365 -0
- package/dist/src/testhub/TestHubClient.d.ts +335 -0
- package/dist/src/testhub/TestHubClient.js +1215 -0
- package/dist/src/testhub/TestHubReporter.d.ts +62 -0
- package/dist/src/testhub/TestHubReporter.js +576 -0
- package/dist/src/testhub/TestHubVars.d.ts +116 -0
- package/dist/src/testhub/TestHubVars.js +273 -0
- package/dist/src/utils/ActionInterceptor.d.ts +59 -0
- package/dist/src/utils/ActionInterceptor.js +741 -0
- package/dist/src/utils/ArtifactsCompressor.d.ts +43 -0
- package/dist/src/utils/ArtifactsCompressor.js +181 -0
- package/dist/src/utils/AutoLogsFinal.d.ts +47 -0
- package/dist/src/utils/AutoLogsFinal.js +148 -0
- package/dist/src/utils/CodeGenSession.d.ts +114 -0
- package/dist/src/utils/CodeGenSession.js +264 -0
- package/dist/src/utils/ConfigLogger.d.ts +133 -0
- package/dist/src/utils/ConfigLogger.js +611 -0
- package/dist/src/utils/CustomReporter.d.ts +22 -0
- package/dist/src/utils/CustomReporter.js +352 -0
- package/dist/src/utils/DataStore.d.ts +171 -0
- package/dist/src/utils/DataStore.js +484 -0
- package/dist/src/utils/DatabaseInterceptor.d.ts +19 -0
- package/dist/src/utils/DatabaseInterceptor.js +295 -0
- package/dist/src/utils/DateHelper.d.ts +16 -0
- package/dist/src/utils/DateHelper.js +120 -0
- package/dist/src/utils/DateValidator.d.ts +4 -0
- package/dist/src/utils/DateValidator.js +51 -0
- package/dist/src/utils/DocumentGenerator.d.ts +35 -0
- package/dist/src/utils/DocumentGenerator.js +129 -0
- package/dist/src/utils/EvidenceCapture.d.ts +90 -0
- package/dist/src/utils/EvidenceCapture.js +600 -0
- package/dist/src/utils/EvidenceReportGenerator.d.ts +70 -0
- package/dist/src/utils/EvidenceReportGenerator.js +799 -0
- package/dist/src/utils/FrameManagementUtil.d.ts +42 -0
- package/dist/src/utils/FrameManagementUtil.js +75 -0
- package/dist/src/utils/GlobalStatementsInterceptor.d.ts +1 -0
- package/dist/src/utils/GlobalStatementsInterceptor.js +1 -0
- package/dist/src/utils/HTMLTemplate.d.ts +1 -0
- package/dist/src/utils/HTMLTemplate.js +1034 -0
- package/dist/src/utils/InterceptacaoMagica.d.ts +23 -0
- package/dist/src/utils/InterceptacaoMagica.js +365 -0
- package/dist/src/utils/LogSanitizer.d.ts +35 -0
- package/dist/src/utils/LogSanitizer.js +110 -0
- package/dist/src/utils/Logger.d.ts +65 -0
- package/dist/src/utils/Logger.js +284 -0
- package/dist/src/utils/McpLocalClient.d.ts +141 -0
- package/dist/src/utils/McpLocalClient.js +871 -0
- package/dist/src/utils/PDFEvidenceGenerator.d.ts +20 -0
- package/dist/src/utils/PDFEvidenceGenerator.js +156 -0
- package/dist/src/utils/SpecFileAnalyzer.d.ts +35 -0
- package/dist/src/utils/SpecFileAnalyzer.js +209 -0
- package/dist/src/utils/StatementInterceptor.d.ts +18 -0
- package/dist/src/utils/StatementInterceptor.js +87 -0
- package/dist/src/utils/StatementLogger.d.ts +33 -0
- package/dist/src/utils/StatementLogger.js +113 -0
- package/dist/src/utils/StatementsInterceptor.d.ts +1 -0
- package/dist/src/utils/StatementsInterceptor.js +1 -0
- package/dist/src/utils/TeamsFlushHook.d.ts +17 -0
- package/dist/src/utils/TeamsFlushHook.js +168 -0
- package/dist/src/utils/TerminalLogCapture.d.ts +158 -0
- package/dist/src/utils/TerminalLogCapture.js +531 -0
- package/dist/src/utils/TestMethodLogger.d.ts +70 -0
- package/dist/src/utils/TestMethodLogger.js +95 -0
- package/dist/src/utils/UnifiedTeardown.d.ts +4 -0
- package/dist/src/utils/UnifiedTeardown.js +400 -0
- package/dist/src/utils/XPathCatalog.d.ts +152 -0
- package/dist/src/utils/XPathCatalog.js +350 -0
- package/dist/src/utils/generators.d.ts +90 -0
- package/dist/src/utils/generators.js +167 -0
- package/dist/src/utils/testRecovery/ResilientPlaywright.d.ts +152 -0
- package/dist/src/utils/testRecovery/ResilientPlaywright.js +715 -0
- package/dist/src/utils/testRecovery/TestRecoveryClient.d.ts +801 -0
- package/dist/src/utils/testRecovery/TestRecoveryClient.js +1415 -0
- package/dist/src/utils/testRecovery/autoFixCode.d.ts +65 -0
- package/dist/src/utils/testRecovery/autoFixCode.js +32 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +59 -0
- package/dist/wdio.conf.d.ts +1 -0
- package/dist/wdio.conf.js +420 -0
- package/package.json +137 -0
- package/protect-loader.mjs +643 -0
- package/scripts/consumer-postinstall.ts +975 -0
- package/scripts/generate-index.ts +343 -0
- package/scripts/init-api.ts +613 -0
- package/scripts/init-banco.ts +437 -0
- package/scripts/init-frontend.ts +727 -0
- package/scripts/init-mobile.ts +558 -0
- package/scripts/init-scenarios.ts +925 -0
- package/scripts/init-ssh.ts +734 -0
- package/scripts/package-versions.ts +978 -0
- package/scripts/postinstall.ts +605 -0
- package/scripts/smart-override.ts +1675 -0
- package/scripts/sync-configs.ts +302 -0
- package/scripts/ultracite-setup.ts +370 -0
- package/src/types/globals.d.ts +48 -0
- package/tsconfig.json +29 -0
- package/types/autocore-sync-signal.d.ts +10 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 📚 HubDocs - Sistema Principal de Documentação Automática (Versão Funcional)
|
|
3
|
+
* @silasfmartins/testhub - Auto Documentation System v1.1.51
|
|
4
|
+
*/
|
|
5
|
+
export interface DocsConfig {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
categories: string[];
|
|
8
|
+
outputDir: string;
|
|
9
|
+
includeRequestBody: boolean;
|
|
10
|
+
includeResponseBody: boolean;
|
|
11
|
+
generateSwagger: boolean;
|
|
12
|
+
includeScreenshots: boolean;
|
|
13
|
+
maxScreenshotSize?: number;
|
|
14
|
+
projectName?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class AutoDocs {
|
|
17
|
+
private static initialized;
|
|
18
|
+
private static finalizationExecuted;
|
|
19
|
+
private static config;
|
|
20
|
+
/**
|
|
21
|
+
* 🚀 Inicializar o sistema AutoDocs
|
|
22
|
+
*/
|
|
23
|
+
static initialize(options?: {
|
|
24
|
+
projectName?: string;
|
|
25
|
+
outputDir?: string;
|
|
26
|
+
config?: Partial<DocsConfig>;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* 📖 Gerar documentação completa
|
|
30
|
+
*/
|
|
31
|
+
static generateDocs(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 📄 Gerar relatório HTML principal
|
|
34
|
+
*/
|
|
35
|
+
private static generateHTMLReport;
|
|
36
|
+
/**
|
|
37
|
+
* 📄 Gerar documentação básica quando não há dados
|
|
38
|
+
*/
|
|
39
|
+
private static generateEmptyDocsReport;
|
|
40
|
+
/**
|
|
41
|
+
* 🔄 Reset do sistema (APENAS EM DESENVOLVIMENTO)
|
|
42
|
+
*/
|
|
43
|
+
static reset(): void;
|
|
44
|
+
/**
|
|
45
|
+
* 🌐 Interceptar chamada de API
|
|
46
|
+
* DESABILITADO: Evita duplicação com ApiActions que já faz interceptação
|
|
47
|
+
*/
|
|
48
|
+
static interceptAPI(operation: string, endpoint?: string, config?: any): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* 🔄 Atualizar resultado de API
|
|
51
|
+
* DESABILITADO: Evita duplicação com ExecutionTracker
|
|
52
|
+
*/
|
|
53
|
+
static updateAPIResult(docId: string, response?: any, statusCode?: number, error?: any): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* 🎯 Registrar AutoDocs globalmente para ApiActions
|
|
56
|
+
*/
|
|
57
|
+
private static registerGlobally;
|
|
58
|
+
/**
|
|
59
|
+
* 🔗 Configurar interceptação automática de fetch
|
|
60
|
+
* DESABILITADO: Para evitar duplicação com ApiActions
|
|
61
|
+
*/
|
|
62
|
+
private static setupFetchInterception;
|
|
63
|
+
/**
|
|
64
|
+
* 🎯 Verificar se URL deve ser interceptada
|
|
65
|
+
* CORRIGIDO: Não interceptar URLs que já são processadas pelo ApiActions
|
|
66
|
+
*/
|
|
67
|
+
private static shouldInterceptURL;
|
|
68
|
+
/**
|
|
69
|
+
* 🔄 Processar fetch interceptado
|
|
70
|
+
*/
|
|
71
|
+
private static handleInterceptedFetch;
|
|
72
|
+
/**
|
|
73
|
+
* 📥 Atualizar resposta do fetch
|
|
74
|
+
*/
|
|
75
|
+
private static updateFetchResponse;
|
|
76
|
+
/**
|
|
77
|
+
* ❌ Atualizar erro do fetch
|
|
78
|
+
*/
|
|
79
|
+
private static updateFetchError;
|
|
80
|
+
/**
|
|
81
|
+
* 🔧 NOVO: Método para forçar geração da documentação
|
|
82
|
+
*/
|
|
83
|
+
static forceGenerate(): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* 🖥️ Interceptar comando SSH
|
|
86
|
+
*/
|
|
87
|
+
static interceptSSH(command: string, host?: string, details?: any): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* 🗄️ Interceptar query de banco
|
|
90
|
+
*/
|
|
91
|
+
static interceptDB(query: string, params?: any[], dbType?: string, description?: string, serviceName?: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* 🔄 Atualizar resultado de query de banco
|
|
94
|
+
*/
|
|
95
|
+
static updateDBResult(query: string, timestamp: string, success: boolean, duration: number, error?: string, resultCount?: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* 🔄 Atualizar resultado de comando SSH
|
|
98
|
+
*/
|
|
99
|
+
static updateSSHResult(command: string, timestamp: string, success: boolean, duration: number, exitCode?: number, error?: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* 🎨 Interceptar ação de UI
|
|
102
|
+
*/
|
|
103
|
+
static interceptUI(action: string, element?: string, url?: string, details?: any): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* 🆕 Atualizar status de sucesso de uma ação UI
|
|
106
|
+
*/
|
|
107
|
+
static updateActionSuccess(action: string, element: string, success: boolean, duration: number, error?: string): void;
|
|
108
|
+
/**
|
|
109
|
+
* 📱 Interceptar ação mobile
|
|
110
|
+
*/
|
|
111
|
+
static interceptMobile(action: string, element?: string, platform?: string, details?: any): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* 🧹 Extrair nome limpo do CT removendo logs excessivos
|
|
114
|
+
*/
|
|
115
|
+
private static extractCleanCTName;
|
|
116
|
+
/**
|
|
117
|
+
* 🔐 Escapar HTML para segurança
|
|
118
|
+
*/
|
|
119
|
+
private static escapeHtml;
|
|
120
|
+
/**
|
|
121
|
+
* 🖼️ Resolve caminho de imagem para data URI quando possível
|
|
122
|
+
*/
|
|
123
|
+
private static resolveImageSource;
|
|
124
|
+
/**
|
|
125
|
+
* 🧪 Converte buffer de imagem em data URI
|
|
126
|
+
*/
|
|
127
|
+
private static toDataUri;
|
|
128
|
+
/**
|
|
129
|
+
* 🎨 Detecta MIME-Type básico pelo sufixo do arquivo
|
|
130
|
+
*/
|
|
131
|
+
private static detectMimeType;
|
|
132
|
+
/**
|
|
133
|
+
* 🔍 Detectar versão do AutoCore instalada dinamicamente
|
|
134
|
+
*/
|
|
135
|
+
private static getProjectVersion;
|
|
136
|
+
/**
|
|
137
|
+
* 🎨 Gerar conteúdo HTML com dados usando TailwindCSS e funcionalidades completas
|
|
138
|
+
*/
|
|
139
|
+
private static generateHTMLContent;
|
|
140
|
+
/**
|
|
141
|
+
* 🤖 Detectar tipo de projeto automaticamente
|
|
142
|
+
*/
|
|
143
|
+
private static detectProjectType;
|
|
144
|
+
/**
|
|
145
|
+
* 🔧 Detectar tipo de query SQL
|
|
146
|
+
*/
|
|
147
|
+
private static detectQueryType;
|
|
148
|
+
/**
|
|
149
|
+
* 🔧 Verificar se há dados para gerar
|
|
150
|
+
*/
|
|
151
|
+
private static hasDataToGenerate;
|
|
152
|
+
/**
|
|
153
|
+
* 📝 Obter nome do teste atual
|
|
154
|
+
*/
|
|
155
|
+
private static getCurrentTestName;
|
|
156
|
+
/**
|
|
157
|
+
* 📊 Gerar seções agrupadas inteligentemente
|
|
158
|
+
*/
|
|
159
|
+
private static generateGroupedSections;
|
|
160
|
+
/**
|
|
161
|
+
* 🎨 Obter cor do grupo
|
|
162
|
+
*/
|
|
163
|
+
private static getGroupColor;
|
|
164
|
+
/**
|
|
165
|
+
* 📊 Gerar overview do projeto
|
|
166
|
+
*/
|
|
167
|
+
private static generateProjectOverview;
|
|
168
|
+
/**
|
|
169
|
+
* 🧭 Gerar menu de navegação
|
|
170
|
+
*/
|
|
171
|
+
private static generateNavigationMenu;
|
|
172
|
+
/**
|
|
173
|
+
* 📊 Gerar estatísticas gerais
|
|
174
|
+
*/
|
|
175
|
+
private static generateOverallStats;
|
|
176
|
+
/**
|
|
177
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6 mb-8">
|
|
178
|
+
<div class="card bg-gradient-to-br from-green-600 to-green-700">
|
|
179
|
+
<h3 class="text-3xl font-bold text-white">${data.apis.length}</h3>
|
|
180
|
+
<p class="text-green-100">🌐 APIs Documentadas</p>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="card bg-gradient-to-br from-blue-600 to-blue-700">
|
|
183
|
+
<h3 class="text-3xl font-bold text-white">${data.ssh.length}</h3>
|
|
184
|
+
<p class="text-blue-100">🖥️ Comandos SSH</p>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="card bg-gradient-to-br from-purple-600 to-purple-700">
|
|
187
|
+
<h3 class="text-3xl font-bold text-white">${data.db.length}</h3>
|
|
188
|
+
<p class="text-purple-100">🗄️ Queries Database</p>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="card bg-gradient-to-br from-orange-600 to-orange-700">
|
|
191
|
+
<h3 class="text-3xl font-bold text-white">${data.ui.length}</h3>
|
|
192
|
+
<p class="text-orange-100">🎨 Ações UI</p>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="card bg-gradient-to-br from-pink-600 to-pink-700">
|
|
195
|
+
<h3 class="text-3xl font-bold text-white">${data.mobile.length}</h3>
|
|
196
|
+
<p class="text-pink-100">📱 Ações Mobile</p>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
${AutoDocs.generateAPISection(data.apis)}
|
|
201
|
+
${AutoDocs.generateSSHSection(data.ssh)}
|
|
202
|
+
${AutoDocs.generateDBSection(data.db)}
|
|
203
|
+
${AutoDocs.generateUISection(data.ui)}
|
|
204
|
+
${AutoDocs.generateMobileSection(data.mobile)}
|
|
205
|
+
|
|
206
|
+
<!-- Footer -->
|
|
207
|
+
<div class="footer-bar">
|
|
208
|
+
<p>Documentação gerada automaticamente pelo AutoDocs (${projectVersion}) em ${new Date().toLocaleString('pt-BR')}</p>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<script>
|
|
213
|
+
function toggleTheme() {
|
|
214
|
+
document.body.classList.toggle('light-mode');
|
|
215
|
+
localStorage.setItem('theme', document.body.classList.contains('light-mode') ? 'light' : 'dark');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function exportData(format) {
|
|
219
|
+
const data = ${JSON.stringify(data)};
|
|
220
|
+
|
|
221
|
+
if (format === 'pdf') {
|
|
222
|
+
const element = document.querySelector('.container');
|
|
223
|
+
|
|
224
|
+
html2canvas(element, {
|
|
225
|
+
scale: 2,
|
|
226
|
+
useCORS: false,
|
|
227
|
+
allowTaint: true,
|
|
228
|
+
backgroundColor: '#fff'
|
|
229
|
+
}).then(canvas => {
|
|
230
|
+
const { jsPDF } = jspdf;
|
|
231
|
+
const pdf = new jsPDF({
|
|
232
|
+
orientation: 'portrait',
|
|
233
|
+
unit: 'in',
|
|
234
|
+
format: 'letter'
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const imgData = canvas.toDataURL('image/jpeg', 0.98);
|
|
238
|
+
const imgWidth = 8.5;
|
|
239
|
+
const pageHeight = 11;
|
|
240
|
+
const imgHeight = (canvas.height * imgWidth) / canvas.width;
|
|
241
|
+
let heightLeft = imgHeight;
|
|
242
|
+
let position = 0;
|
|
243
|
+
|
|
244
|
+
pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight);
|
|
245
|
+
heightLeft -= pageHeight;
|
|
246
|
+
|
|
247
|
+
while (heightLeft > 0) {
|
|
248
|
+
position = heightLeft - imgHeight;
|
|
249
|
+
pdf.addPage();
|
|
250
|
+
pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight);
|
|
251
|
+
heightLeft -= pageHeight;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
pdf.save('${AutoDocs.config.projectName}_autodocs.pdf');
|
|
255
|
+
});
|
|
256
|
+
} else if (format === 'json') {
|
|
257
|
+
const dataStr = JSON.stringify(data, null, 2);
|
|
258
|
+
const dataBlob = new Blob([dataStr], {type: 'application/json'});
|
|
259
|
+
const url = URL.createObjectURL(dataBlob);
|
|
260
|
+
const link = document.createElement('a');
|
|
261
|
+
link.href = url;
|
|
262
|
+
link.download = '${AutoDocs.config.projectName}_autodocs.json';
|
|
263
|
+
link.click();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Load saved theme
|
|
268
|
+
const savedTheme = localStorage.getItem('theme');
|
|
269
|
+
if (savedTheme === 'light') {
|
|
270
|
+
document.body.classList.add('light-mode');
|
|
271
|
+
}
|
|
272
|
+
</script>
|
|
273
|
+
</body>
|
|
274
|
+
</html>`
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* 📊 Gerar visualização por CTs (Cenários de Teste)
|
|
279
|
+
* CORRIGIDO: Usar a mesma estratégia do UnifiedReportManager
|
|
280
|
+
*/
|
|
281
|
+
private static generateCTViewHTMLContent;
|
|
282
|
+
/**
|
|
283
|
+
* �🎨 Gerar conteúdo HTML vazio
|
|
284
|
+
*/
|
|
285
|
+
private static generateEmptyHTMLContent;
|
|
286
|
+
/**
|
|
287
|
+
* 🌐 Gerar seção de APIs com detalhes completos
|
|
288
|
+
*/
|
|
289
|
+
private static generateAPISection;
|
|
290
|
+
/**
|
|
291
|
+
* 🖥️ Gerar seção SSH com detalhes completos
|
|
292
|
+
*/
|
|
293
|
+
private static generateSSHSection;
|
|
294
|
+
/**
|
|
295
|
+
* 🎨 Obter classe TailwindCSS para tipo de query
|
|
296
|
+
*/
|
|
297
|
+
private static getQueryTypeBadgeClass;
|
|
298
|
+
/**
|
|
299
|
+
* 🗄️ Gerar seção Database com detalhes completos
|
|
300
|
+
*/
|
|
301
|
+
private static generateDBSection;
|
|
302
|
+
/**
|
|
303
|
+
* 🎨 Obter classe TailwindCSS para ação de UI
|
|
304
|
+
*/
|
|
305
|
+
private static getUIActionBadgeClass;
|
|
306
|
+
/**
|
|
307
|
+
* 🎨 Gerar seção UI com detalhes completos
|
|
308
|
+
*/
|
|
309
|
+
private static generateUISection;
|
|
310
|
+
/**
|
|
311
|
+
* 📱 Gerar seção Mobile com detalhes completos
|
|
312
|
+
*/
|
|
313
|
+
private static generateMobileSection;
|
|
314
|
+
/**
|
|
315
|
+
* 🎨 Obter classe TailwindCSS para ação mobile
|
|
316
|
+
*/
|
|
317
|
+
private static getMobileActionBadgeClass;
|
|
318
|
+
/**
|
|
319
|
+
* 🎨 Obter cor do tipo de query
|
|
320
|
+
*/
|
|
321
|
+
private static getQueryTypeColor;
|
|
322
|
+
/**
|
|
323
|
+
* 🎨 Obter cor da ação UI
|
|
324
|
+
*/
|
|
325
|
+
private static getUIActionColor;
|
|
326
|
+
/**
|
|
327
|
+
* 🎨 Obter cor da ação mobile
|
|
328
|
+
*/
|
|
329
|
+
private static getMobileActionColor;
|
|
330
|
+
/**
|
|
331
|
+
* 📋 Gerar documentação Swagger detalhada
|
|
332
|
+
*/
|
|
333
|
+
private static generateSwaggerDocs;
|
|
334
|
+
/**
|
|
335
|
+
* 🖥️ Extrair servidores das URLs das APIs
|
|
336
|
+
*/
|
|
337
|
+
private static extractServers;
|
|
338
|
+
/**
|
|
339
|
+
* 🛤️ Gerar paths detalhados do Swagger
|
|
340
|
+
*/
|
|
341
|
+
private static generateDetailedSwaggerPaths;
|
|
342
|
+
/**
|
|
343
|
+
* 📊 Gerar schemas do Swagger baseado nos dados
|
|
344
|
+
*/
|
|
345
|
+
private static generateSwaggerSchemas;
|
|
346
|
+
/**
|
|
347
|
+
* 🏷️ Gerar tags do Swagger
|
|
348
|
+
*/
|
|
349
|
+
private static generateSwaggerTags;
|
|
350
|
+
/**
|
|
351
|
+
* 🤖 Detectar categorias automaticamente baseado nos endpoints executados
|
|
352
|
+
*/
|
|
353
|
+
private static detectProjectCategories;
|
|
354
|
+
/**
|
|
355
|
+
* 🏷️ Categorizar endpoint com base nas categorias detectadas dinamicamente
|
|
356
|
+
*/
|
|
357
|
+
private static categorizeEndpointDynamic;
|
|
358
|
+
/**
|
|
359
|
+
* 🎯 Categorizar endpoint
|
|
360
|
+
*/
|
|
361
|
+
private static categorizeEndpoint;
|
|
362
|
+
/**
|
|
363
|
+
* 📄 Converter para YAML
|
|
364
|
+
*/
|
|
365
|
+
private static convertToYaml;
|
|
366
|
+
/**
|
|
367
|
+
* 🧹 Limpar objeto para conversão YAML
|
|
368
|
+
*/
|
|
369
|
+
private static cleanObjectForYaml;
|
|
370
|
+
/**
|
|
371
|
+
* 🔍 Inferir schema de um objeto
|
|
372
|
+
* ✅ CORRIGIDO: Tipos válidos OpenAPI 3.0 (array, boolean, integer, number, object, string)
|
|
373
|
+
* ✅ CORRIGIDO: required só é adicionado se tiver pelo menos 1 item
|
|
374
|
+
*/
|
|
375
|
+
private static inferSchema;
|
|
376
|
+
/**
|
|
377
|
+
* 📝 Gerar nome de schema
|
|
378
|
+
* ✅ CORRIGIDO: Sanitiza caracteres inválidos (OpenAPI só permite A-Z a-z 0-9 - . _)
|
|
379
|
+
*/
|
|
380
|
+
private static generateSchemaName;
|
|
381
|
+
/**
|
|
382
|
+
* 🔧 Sanitizar nome de schema para OpenAPI
|
|
383
|
+
* OpenAPI só permite: A-Z a-z 0-9 - . _
|
|
384
|
+
*/
|
|
385
|
+
private static sanitizeSchemaName;
|
|
386
|
+
/**
|
|
387
|
+
* 🔧 Extrair parâmetros da API
|
|
388
|
+
*/
|
|
389
|
+
private static extractParameters;
|
|
390
|
+
/**
|
|
391
|
+
* 🛤️ Gerar paths do Swagger
|
|
392
|
+
*/
|
|
393
|
+
private static generateSwaggerPaths;
|
|
394
|
+
private static ensureOutputDir;
|
|
395
|
+
}
|