@jterrats/smart-deployment 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -0
- package/lib/ai/agentforce-error-handler.d.ts +81 -0
- package/lib/ai/agentforce-error-handler.js +196 -0
- package/lib/ai/agentforce-error-handler.js.map +1 -0
- package/lib/ai/agentforce-priority-service.d.ts +82 -0
- package/lib/ai/agentforce-priority-service.js +257 -0
- package/lib/ai/agentforce-priority-service.js.map +1 -0
- package/lib/ai/agentforce-service.d.ts +99 -0
- package/lib/ai/agentforce-service.js +300 -0
- package/lib/ai/agentforce-service.js.map +1 -0
- package/lib/ai/circuit-breaker.d.ts +115 -0
- package/lib/ai/circuit-breaker.js +277 -0
- package/lib/ai/circuit-breaker.js.map +1 -0
- package/lib/ai/dependency-inference-service.d.ts +76 -0
- package/lib/ai/dependency-inference-service.js +220 -0
- package/lib/ai/dependency-inference-service.js.map +1 -0
- package/lib/ai/llm-provider-factory.d.ts +15 -0
- package/lib/ai/llm-provider-factory.js +36 -0
- package/lib/ai/llm-provider-factory.js.map +1 -0
- package/lib/ai/llm-provider.d.ts +27 -0
- package/lib/ai/llm-provider.js +2 -0
- package/lib/ai/llm-provider.js.map +1 -0
- package/lib/ai/openai-service.d.ts +20 -0
- package/lib/ai/openai-service.js +89 -0
- package/lib/ai/openai-service.js.map +1 -0
- package/lib/ai/prompt-builder.d.ts +79 -0
- package/lib/ai/prompt-builder.js +180 -0
- package/lib/ai/prompt-builder.js.map +1 -0
- package/lib/ai/response-parser.d.ts +67 -0
- package/lib/ai/response-parser.js +234 -0
- package/lib/ai/response-parser.js.map +1 -0
- package/lib/ai/wave-validation-service.d.ts +111 -0
- package/lib/ai/wave-validation-service.js +381 -0
- package/lib/ai/wave-validation-service.js.map +1 -0
- package/lib/analysis/analysis-reporter.d.ts +56 -0
- package/lib/analysis/analysis-reporter.js +170 -0
- package/lib/analysis/analysis-reporter.js.map +1 -0
- package/lib/analytics/error-analytics.d.ts +80 -0
- package/lib/analytics/error-analytics.js +162 -0
- package/lib/analytics/error-analytics.js.map +1 -0
- package/lib/commands/analyze.d.ts +49 -0
- package/lib/commands/analyze.js +232 -0
- package/lib/commands/analyze.js.map +1 -0
- package/lib/commands/config.d.ts +42 -0
- package/lib/commands/config.js +219 -0
- package/lib/commands/config.js.map +1 -0
- package/lib/commands/resume.d.ts +26 -0
- package/lib/commands/resume.js +69 -0
- package/lib/commands/resume.js.map +1 -0
- package/lib/commands/start.d.ts +70 -0
- package/lib/commands/start.js +659 -0
- package/lib/commands/start.js.map +1 -0
- package/lib/commands/status.d.ts +37 -0
- package/lib/commands/status.js +69 -0
- package/lib/commands/status.js.map +1 -0
- package/lib/commands/validate.d.ts +33 -0
- package/lib/commands/validate.js +66 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/config/repo-config.d.ts +22 -0
- package/lib/config/repo-config.js +31 -0
- package/lib/config/repo-config.js.map +1 -0
- package/lib/constants/agentforce-limits.d.ts +174 -0
- package/lib/constants/agentforce-limits.js +262 -0
- package/lib/constants/agentforce-limits.js.map +1 -0
- package/lib/constants/api-version.d.ts +70 -0
- package/lib/constants/api-version.js +122 -0
- package/lib/constants/api-version.js.map +1 -0
- package/lib/constants/deployment-order.d.ts +68 -0
- package/lib/constants/deployment-order.js +162 -0
- package/lib/constants/deployment-order.js.map +1 -0
- package/lib/constants/salesforce-limits.d.ts +107 -0
- package/lib/constants/salesforce-limits.js +104 -0
- package/lib/constants/salesforce-limits.js.map +1 -0
- package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
- package/lib/dependencies/circular-dependency-detector.js +329 -0
- package/lib/dependencies/circular-dependency-detector.js.map +1 -0
- package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
- package/lib/dependencies/cycle-remediation-planner.js +192 -0
- package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
- package/lib/dependencies/dependency-cache.d.ts +134 -0
- package/lib/dependencies/dependency-cache.js +303 -0
- package/lib/dependencies/dependency-cache.js.map +1 -0
- package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
- package/lib/dependencies/dependency-depth-calculator.js +368 -0
- package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
- package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
- package/lib/dependencies/dependency-graph-builder.js +411 -0
- package/lib/dependencies/dependency-graph-builder.js.map +1 -0
- package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
- package/lib/dependencies/dependency-impact-analyzer.js +330 -0
- package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
- package/lib/dependencies/dependency-merger.d.ts +122 -0
- package/lib/dependencies/dependency-merger.js +245 -0
- package/lib/dependencies/dependency-merger.js.map +1 -0
- package/lib/dependencies/dependency-resolver.d.ts +157 -0
- package/lib/dependencies/dependency-resolver.js +298 -0
- package/lib/dependencies/dependency-resolver.js.map +1 -0
- package/lib/dependencies/dependency-validator.d.ts +123 -0
- package/lib/dependencies/dependency-validator.js +291 -0
- package/lib/dependencies/dependency-validator.js.map +1 -0
- package/lib/dependencies/graph-visualizer.d.ts +110 -0
- package/lib/dependencies/graph-visualizer.js +262 -0
- package/lib/dependencies/graph-visualizer.js.map +1 -0
- package/lib/dependencies/heuristic-inference.d.ts +136 -0
- package/lib/dependencies/heuristic-inference.js +430 -0
- package/lib/dependencies/heuristic-inference.js.map +1 -0
- package/lib/deployment/cycle-source-editor.d.ts +34 -0
- package/lib/deployment/cycle-source-editor.js +121 -0
- package/lib/deployment/cycle-source-editor.js.map +1 -0
- package/lib/deployment/deployment-error-handler.d.ts +38 -0
- package/lib/deployment/deployment-error-handler.js +79 -0
- package/lib/deployment/deployment-error-handler.js.map +1 -0
- package/lib/deployment/deployment-reporter.d.ts +63 -0
- package/lib/deployment/deployment-reporter.js +150 -0
- package/lib/deployment/deployment-reporter.js.map +1 -0
- package/lib/deployment/deployment-state-summary.d.ts +38 -0
- package/lib/deployment/deployment-state-summary.js +209 -0
- package/lib/deployment/deployment-state-summary.js.map +1 -0
- package/lib/deployment/deployment-status-service.d.ts +36 -0
- package/lib/deployment/deployment-status-service.js +128 -0
- package/lib/deployment/deployment-status-service.js.map +1 -0
- package/lib/deployment/deployment-tracker.d.ts +42 -0
- package/lib/deployment/deployment-tracker.js +79 -0
- package/lib/deployment/deployment-tracker.js.map +1 -0
- package/lib/deployment/deployment-validation-service.d.ts +28 -0
- package/lib/deployment/deployment-validation-service.js +161 -0
- package/lib/deployment/deployment-validation-service.js.map +1 -0
- package/lib/deployment/retry-handler.d.ts +37 -0
- package/lib/deployment/retry-handler.js +86 -0
- package/lib/deployment/retry-handler.js.map +1 -0
- package/lib/deployment/sf-cli-integration.d.ts +42 -0
- package/lib/deployment/sf-cli-integration.js +105 -0
- package/lib/deployment/sf-cli-integration.js.map +1 -0
- package/lib/deployment/state-manager.d.ts +61 -0
- package/lib/deployment/state-manager.js +83 -0
- package/lib/deployment/state-manager.js.map +1 -0
- package/lib/deployment/test-executor.d.ts +41 -0
- package/lib/deployment/test-executor.js +87 -0
- package/lib/deployment/test-executor.js.map +1 -0
- package/lib/errors/base-error.d.ts +24 -0
- package/lib/errors/base-error.js +66 -0
- package/lib/errors/base-error.js.map +1 -0
- package/lib/errors/dependency-error.d.ts +37 -0
- package/lib/errors/dependency-error.js +76 -0
- package/lib/errors/dependency-error.js.map +1 -0
- package/lib/errors/deployment-error.d.ts +55 -0
- package/lib/errors/deployment-error.js +132 -0
- package/lib/errors/deployment-error.js.map +1 -0
- package/lib/errors/index.d.ts +45 -0
- package/lib/errors/index.js +71 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/errors/network-error.d.ts +53 -0
- package/lib/errors/network-error.js +111 -0
- package/lib/errors/network-error.js.map +1 -0
- package/lib/errors/parsing-error.d.ts +41 -0
- package/lib/errors/parsing-error.js +69 -0
- package/lib/errors/parsing-error.js.map +1 -0
- package/lib/errors/validation-error-reporter.d.ts +34 -0
- package/lib/errors/validation-error-reporter.js +99 -0
- package/lib/errors/validation-error-reporter.js.map +1 -0
- package/lib/errors/validation-error.d.ts +58 -0
- package/lib/errors/validation-error.js +131 -0
- package/lib/errors/validation-error.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/monitoring/performance-monitor.d.ts +98 -0
- package/lib/monitoring/performance-monitor.js +260 -0
- package/lib/monitoring/performance-monitor.js.map +1 -0
- package/lib/parsers/apex-class-parser.d.ts +47 -0
- package/lib/parsers/apex-class-parser.js +368 -0
- package/lib/parsers/apex-class-parser.js.map +1 -0
- package/lib/parsers/apex-trigger-parser.d.ts +48 -0
- package/lib/parsers/apex-trigger-parser.js +229 -0
- package/lib/parsers/apex-trigger-parser.js.map +1 -0
- package/lib/parsers/aura-parser.d.ts +55 -0
- package/lib/parsers/aura-parser.js +229 -0
- package/lib/parsers/aura-parser.js.map +1 -0
- package/lib/parsers/bot-parser.d.ts +65 -0
- package/lib/parsers/bot-parser.js +225 -0
- package/lib/parsers/bot-parser.js.map +1 -0
- package/lib/parsers/custom-metadata-parser.d.ts +94 -0
- package/lib/parsers/custom-metadata-parser.js +199 -0
- package/lib/parsers/custom-metadata-parser.js.map +1 -0
- package/lib/parsers/custom-object-parser.d.ts +62 -0
- package/lib/parsers/custom-object-parser.js +297 -0
- package/lib/parsers/custom-object-parser.js.map +1 -0
- package/lib/parsers/email-template-parser.d.ts +64 -0
- package/lib/parsers/email-template-parser.js +238 -0
- package/lib/parsers/email-template-parser.js.map +1 -0
- package/lib/parsers/error-resilient-parser.d.ts +110 -0
- package/lib/parsers/error-resilient-parser.js +277 -0
- package/lib/parsers/error-resilient-parser.js.map +1 -0
- package/lib/parsers/flexipage-parser.d.ts +64 -0
- package/lib/parsers/flexipage-parser.js +196 -0
- package/lib/parsers/flexipage-parser.js.map +1 -0
- package/lib/parsers/flow-parser.d.ts +54 -0
- package/lib/parsers/flow-parser.js +287 -0
- package/lib/parsers/flow-parser.js.map +1 -0
- package/lib/parsers/genai-prompt-parser.d.ts +67 -0
- package/lib/parsers/genai-prompt-parser.js +160 -0
- package/lib/parsers/genai-prompt-parser.js.map +1 -0
- package/lib/parsers/layout-parser.d.ts +64 -0
- package/lib/parsers/layout-parser.js +267 -0
- package/lib/parsers/layout-parser.js.map +1 -0
- package/lib/parsers/lwc-parser.d.ts +60 -0
- package/lib/parsers/lwc-parser.js +264 -0
- package/lib/parsers/lwc-parser.js.map +1 -0
- package/lib/parsers/permission-set-parser.d.ts +86 -0
- package/lib/parsers/permission-set-parser.js +152 -0
- package/lib/parsers/permission-set-parser.js.map +1 -0
- package/lib/parsers/profile-parser.d.ts +81 -0
- package/lib/parsers/profile-parser.js +141 -0
- package/lib/parsers/profile-parser.js.map +1 -0
- package/lib/parsers/visualforce-parser.d.ts +47 -0
- package/lib/parsers/visualforce-parser.js +180 -0
- package/lib/parsers/visualforce-parser.js.map +1 -0
- package/lib/provisioning/data-provisioner.d.ts +88 -0
- package/lib/provisioning/data-provisioner.js +257 -0
- package/lib/provisioning/data-provisioner.js.map +1 -0
- package/lib/scanner/custom-structure-scanner.d.ts +66 -0
- package/lib/scanner/custom-structure-scanner.js +229 -0
- package/lib/scanner/custom-structure-scanner.js.map +1 -0
- package/lib/scanner/forceignore-parser.d.ts +69 -0
- package/lib/scanner/forceignore-parser.js +195 -0
- package/lib/scanner/forceignore-parser.js.map +1 -0
- package/lib/scanner/metadata-format-scanner.d.ts +77 -0
- package/lib/scanner/metadata-format-scanner.js +282 -0
- package/lib/scanner/metadata-format-scanner.js.map +1 -0
- package/lib/scanner/monorepo-scanner.d.ts +71 -0
- package/lib/scanner/monorepo-scanner.js +225 -0
- package/lib/scanner/monorepo-scanner.js.map +1 -0
- package/lib/scanner/project-validator.d.ts +55 -0
- package/lib/scanner/project-validator.js +235 -0
- package/lib/scanner/project-validator.js.map +1 -0
- package/lib/scanner/sfdx-project-detector.d.ts +86 -0
- package/lib/scanner/sfdx-project-detector.js +240 -0
- package/lib/scanner/sfdx-project-detector.js.map +1 -0
- package/lib/scanner/structure-validator.d.ts +64 -0
- package/lib/scanner/structure-validator.js +296 -0
- package/lib/scanner/structure-validator.js.map +1 -0
- package/lib/services/metadata-scanner-service.d.ts +64 -0
- package/lib/services/metadata-scanner-service.js +651 -0
- package/lib/services/metadata-scanner-service.js.map +1 -0
- package/lib/types/agentforce.d.ts +157 -0
- package/lib/types/agentforce.js +2 -0
- package/lib/types/agentforce.js.map +1 -0
- package/lib/types/dependency.d.ts +98 -0
- package/lib/types/dependency.js +5 -0
- package/lib/types/dependency.js.map +1 -0
- package/lib/types/deployment-plan.d.ts +81 -0
- package/lib/types/deployment-plan.js +6 -0
- package/lib/types/deployment-plan.js.map +1 -0
- package/lib/types/deployment.d.ts +88 -0
- package/lib/types/deployment.js +5 -0
- package/lib/types/deployment.js.map +1 -0
- package/lib/types/graph.d.ts +35 -0
- package/lib/types/graph.js +5 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +17 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/metadata.d.ts +101 -0
- package/lib/types/metadata.js +13 -0
- package/lib/types/metadata.js.map +1 -0
- package/lib/types/project.d.ts +156 -0
- package/lib/types/project.js +56 -0
- package/lib/types/project.js.map +1 -0
- package/lib/types/salesforce/apex.d.ts +94 -0
- package/lib/types/salesforce/apex.js +6 -0
- package/lib/types/salesforce/apex.js.map +1 -0
- package/lib/types/salesforce/aura.d.ts +150 -0
- package/lib/types/salesforce/aura.js +6 -0
- package/lib/types/salesforce/aura.js.map +1 -0
- package/lib/types/salesforce/bot.d.ts +293 -0
- package/lib/types/salesforce/bot.js +6 -0
- package/lib/types/salesforce/bot.js.map +1 -0
- package/lib/types/salesforce/common.d.ts +15 -0
- package/lib/types/salesforce/common.js +5 -0
- package/lib/types/salesforce/common.js.map +1 -0
- package/lib/types/salesforce/custom-metadata.d.ts +92 -0
- package/lib/types/salesforce/custom-metadata.js +6 -0
- package/lib/types/salesforce/custom-metadata.js.map +1 -0
- package/lib/types/salesforce/email.d.ts +56 -0
- package/lib/types/salesforce/email.js +6 -0
- package/lib/types/salesforce/email.js.map +1 -0
- package/lib/types/salesforce/flexipage.d.ts +149 -0
- package/lib/types/salesforce/flexipage.js +6 -0
- package/lib/types/salesforce/flexipage.js.map +1 -0
- package/lib/types/salesforce/flow.d.ts +516 -0
- package/lib/types/salesforce/flow.js +6 -0
- package/lib/types/salesforce/flow.js.map +1 -0
- package/lib/types/salesforce/genai.d.ts +67 -0
- package/lib/types/salesforce/genai.js +6 -0
- package/lib/types/salesforce/genai.js.map +1 -0
- package/lib/types/salesforce/index.d.ts +27 -0
- package/lib/types/salesforce/index.js +43 -0
- package/lib/types/salesforce/index.js.map +1 -0
- package/lib/types/salesforce/layout.d.ts +236 -0
- package/lib/types/salesforce/layout.js +6 -0
- package/lib/types/salesforce/layout.js.map +1 -0
- package/lib/types/salesforce/lwc.d.ts +123 -0
- package/lib/types/salesforce/lwc.js +6 -0
- package/lib/types/salesforce/lwc.js.map +1 -0
- package/lib/types/salesforce/object.d.ts +427 -0
- package/lib/types/salesforce/object.js +6 -0
- package/lib/types/salesforce/object.js.map +1 -0
- package/lib/types/salesforce/parser-types.d.ts +79 -0
- package/lib/types/salesforce/parser-types.js +80 -0
- package/lib/types/salesforce/parser-types.js.map +1 -0
- package/lib/types/salesforce/permission.d.ts +289 -0
- package/lib/types/salesforce/permission.js +6 -0
- package/lib/types/salesforce/permission.js.map +1 -0
- package/lib/types/salesforce/resource.d.ts +93 -0
- package/lib/types/salesforce/resource.js +6 -0
- package/lib/types/salesforce/resource.js.map +1 -0
- package/lib/types/salesforce/visualforce.d.ts +70 -0
- package/lib/types/salesforce/visualforce.js +6 -0
- package/lib/types/salesforce/visualforce.js.map +1 -0
- package/lib/utils/cache-manager.d.ts +158 -0
- package/lib/utils/cache-manager.js +429 -0
- package/lib/utils/cache-manager.js.map +1 -0
- package/lib/utils/deployment-plan-manager.d.ts +40 -0
- package/lib/utils/deployment-plan-manager.js +183 -0
- package/lib/utils/deployment-plan-manager.js.map +1 -0
- package/lib/utils/error-aggregator.d.ts +117 -0
- package/lib/utils/error-aggregator.js +268 -0
- package/lib/utils/error-aggregator.js.map +1 -0
- package/lib/utils/file-system.d.ts +62 -0
- package/lib/utils/file-system.js +167 -0
- package/lib/utils/file-system.js.map +1 -0
- package/lib/utils/functional.d.ts +52 -0
- package/lib/utils/functional.js +61 -0
- package/lib/utils/functional.js.map +1 -0
- package/lib/utils/graph-algorithms.d.ts +53 -0
- package/lib/utils/graph-algorithms.js +177 -0
- package/lib/utils/graph-algorithms.js.map +1 -0
- package/lib/utils/logger.d.ts +154 -0
- package/lib/utils/logger.js +327 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/network-handler.d.ts +64 -0
- package/lib/utils/network-handler.js +147 -0
- package/lib/utils/network-handler.js.map +1 -0
- package/lib/utils/performance.d.ts +148 -0
- package/lib/utils/performance.js +294 -0
- package/lib/utils/performance.js.map +1 -0
- package/lib/utils/string.d.ts +197 -0
- package/lib/utils/string.js +331 -0
- package/lib/utils/string.js.map +1 -0
- package/lib/utils/xml.d.ts +97 -0
- package/lib/utils/xml.js +227 -0
- package/lib/utils/xml.js.map +1 -0
- package/lib/validators/xml-metadata-validator.d.ts +106 -0
- package/lib/validators/xml-metadata-validator.js +509 -0
- package/lib/validators/xml-metadata-validator.js.map +1 -0
- package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
- package/lib/waves/priority-wave-generator-ai.js +191 -0
- package/lib/waves/priority-wave-generator-ai.js.map +1 -0
- package/lib/waves/priority-wave-generator.d.ts +47 -0
- package/lib/waves/priority-wave-generator.js +88 -0
- package/lib/waves/priority-wave-generator.js.map +1 -0
- package/lib/waves/test-optimizer.d.ts +155 -0
- package/lib/waves/test-optimizer.js +290 -0
- package/lib/waves/test-optimizer.js.map +1 -0
- package/lib/waves/wave-builder.d.ts +147 -0
- package/lib/waves/wave-builder.js +286 -0
- package/lib/waves/wave-builder.js.map +1 -0
- package/lib/waves/wave-diff-generator.d.ts +17 -0
- package/lib/waves/wave-diff-generator.js +6 -0
- package/lib/waves/wave-diff-generator.js.map +1 -0
- package/lib/waves/wave-executor.d.ts +33 -0
- package/lib/waves/wave-executor.js +50 -0
- package/lib/waves/wave-executor.js.map +1 -0
- package/lib/waves/wave-merger.d.ts +96 -0
- package/lib/waves/wave-merger.js +181 -0
- package/lib/waves/wave-merger.js.map +1 -0
- package/lib/waves/wave-metadata-generator.d.ts +13 -0
- package/lib/waves/wave-metadata-generator.js +12 -0
- package/lib/waves/wave-metadata-generator.js.map +1 -0
- package/lib/waves/wave-splitter.d.ts +154 -0
- package/lib/waves/wave-splitter.js +307 -0
- package/lib/waves/wave-splitter.js.map +1 -0
- package/lib/waves/wave-validator.d.ts +17 -0
- package/lib/waves/wave-validator.js +15 -0
- package/lib/waves/wave-validator.js.map +1 -0
- package/messages/analyze.json +18 -0
- package/messages/config.json +29 -0
- package/messages/resume.json +9 -0
- package/messages/start.json +24 -0
- package/messages/status.json +8 -0
- package/messages/validate.json +9 -0
- package/npm-shrinkwrap.json +25676 -0
- package/oclif.lock +11988 -0
- package/oclif.manifest.json +589 -0
- package/package.json +224 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance Monitoring Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides execution time tracking, memory profiling, and bottleneck identification
|
|
5
|
+
*/
|
|
6
|
+
export type PerformanceMetrics = {
|
|
7
|
+
/** Operation name */
|
|
8
|
+
operation: string;
|
|
9
|
+
/** Start timestamp (ms since epoch) */
|
|
10
|
+
startTime: number;
|
|
11
|
+
/** End timestamp (ms since epoch) */
|
|
12
|
+
endTime?: number;
|
|
13
|
+
/** Duration in milliseconds */
|
|
14
|
+
duration?: number;
|
|
15
|
+
/** Memory usage at start (bytes) */
|
|
16
|
+
memoryStart: number;
|
|
17
|
+
/** Memory usage at end (bytes) */
|
|
18
|
+
memoryEnd?: number;
|
|
19
|
+
/** Memory delta (bytes) */
|
|
20
|
+
memoryDelta?: number;
|
|
21
|
+
/** Additional metadata */
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
export type PerformanceReport = {
|
|
25
|
+
/** Total operations tracked */
|
|
26
|
+
totalOperations: number;
|
|
27
|
+
/** Total execution time (ms) */
|
|
28
|
+
totalDuration: number;
|
|
29
|
+
/** Average execution time (ms) */
|
|
30
|
+
averageDuration: number;
|
|
31
|
+
/** Slowest operation */
|
|
32
|
+
slowest: PerformanceMetrics | null;
|
|
33
|
+
/** Fastest operation */
|
|
34
|
+
fastest: PerformanceMetrics | null;
|
|
35
|
+
/** All operations sorted by duration */
|
|
36
|
+
operations: PerformanceMetrics[];
|
|
37
|
+
/** Bottlenecks (operations > 2x average) */
|
|
38
|
+
bottlenecks: PerformanceMetrics[];
|
|
39
|
+
/** Memory statistics */
|
|
40
|
+
memory: {
|
|
41
|
+
totalAllocated: number;
|
|
42
|
+
averageAllocated: number;
|
|
43
|
+
peakUsage: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Performance Monitor Singleton
|
|
48
|
+
*
|
|
49
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
50
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
51
|
+
* @ac US-012-AC-3: Operation profiling
|
|
52
|
+
*/
|
|
53
|
+
declare class PerformanceMonitor {
|
|
54
|
+
private static instance;
|
|
55
|
+
private metrics;
|
|
56
|
+
private completedMetrics;
|
|
57
|
+
private constructor();
|
|
58
|
+
static getInstance(): PerformanceMonitor;
|
|
59
|
+
/**
|
|
60
|
+
* Reset singleton instance (for testing)
|
|
61
|
+
*/
|
|
62
|
+
static resetInstance(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Start tracking an operation
|
|
65
|
+
*
|
|
66
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
67
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
68
|
+
*/
|
|
69
|
+
start(operation: string, metadata?: Record<string, unknown>): string;
|
|
70
|
+
/**
|
|
71
|
+
* End tracking an operation
|
|
72
|
+
*
|
|
73
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
74
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
75
|
+
*/
|
|
76
|
+
end(id: string): PerformanceMetrics | null;
|
|
77
|
+
/**
|
|
78
|
+
* Track a synchronous function execution
|
|
79
|
+
*
|
|
80
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
81
|
+
* @ac US-012-AC-3: Operation profiling
|
|
82
|
+
*/
|
|
83
|
+
track<T>(operation: string, fn: () => T, metadata?: Record<string, unknown>): T;
|
|
84
|
+
/**
|
|
85
|
+
* Track an asynchronous function execution
|
|
86
|
+
*
|
|
87
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
88
|
+
* @ac US-012-AC-3: Operation profiling
|
|
89
|
+
*/
|
|
90
|
+
trackAsync<T>(operation: string, fn: () => Promise<T>, metadata?: Record<string, unknown>): Promise<T>;
|
|
91
|
+
/**
|
|
92
|
+
* Generate performance report
|
|
93
|
+
*
|
|
94
|
+
* @ac US-012-AC-4: Performance reports
|
|
95
|
+
* @ac US-012-AC-5: Bottleneck identification
|
|
96
|
+
*/
|
|
97
|
+
generateReport(): PerformanceReport;
|
|
98
|
+
/**
|
|
99
|
+
* Get metrics for a specific operation
|
|
100
|
+
*
|
|
101
|
+
* @ac US-012-AC-3: Operation profiling
|
|
102
|
+
*/
|
|
103
|
+
getOperationMetrics(operationName: string): PerformanceMetrics[];
|
|
104
|
+
/**
|
|
105
|
+
* Compare two operations (benchmarking)
|
|
106
|
+
*
|
|
107
|
+
* @ac US-012-AC-6: Benchmark comparisons
|
|
108
|
+
*/
|
|
109
|
+
compare(operation1: string, operation2: string): {
|
|
110
|
+
operation1: PerformanceMetrics[];
|
|
111
|
+
operation2: PerformanceMetrics[];
|
|
112
|
+
comparison: {
|
|
113
|
+
averageDuration1: number;
|
|
114
|
+
averageDuration2: number;
|
|
115
|
+
faster: string;
|
|
116
|
+
speedup: number;
|
|
117
|
+
memoryDiff: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Clear all metrics
|
|
122
|
+
*/
|
|
123
|
+
clear(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Get current memory usage
|
|
126
|
+
*
|
|
127
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
128
|
+
*/
|
|
129
|
+
private getMemoryUsage;
|
|
130
|
+
/**
|
|
131
|
+
* Format bytes to human-readable string
|
|
132
|
+
*/
|
|
133
|
+
private formatBytes;
|
|
134
|
+
}
|
|
135
|
+
export declare const performanceMonitor: PerformanceMonitor;
|
|
136
|
+
/**
|
|
137
|
+
* Decorator for tracking method execution time
|
|
138
|
+
*
|
|
139
|
+
* @ac US-012-AC-3: Operation profiling
|
|
140
|
+
*/
|
|
141
|
+
export declare function Profile(operationName?: string): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Decorator for tracking async method execution time
|
|
144
|
+
*
|
|
145
|
+
* @ac US-012-AC-3: Operation profiling
|
|
146
|
+
*/
|
|
147
|
+
export declare function ProfileAsync(operationName?: string): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
148
|
+
export {};
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance Monitoring Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides execution time tracking, memory profiling, and bottleneck identification
|
|
5
|
+
*/
|
|
6
|
+
import { getLogger } from './logger.js';
|
|
7
|
+
const logger = getLogger('PerformanceMonitor');
|
|
8
|
+
/**
|
|
9
|
+
* Performance Monitor Singleton
|
|
10
|
+
*
|
|
11
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
12
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
13
|
+
* @ac US-012-AC-3: Operation profiling
|
|
14
|
+
*/
|
|
15
|
+
class PerformanceMonitor {
|
|
16
|
+
static instance;
|
|
17
|
+
metrics = new Map();
|
|
18
|
+
completedMetrics = [];
|
|
19
|
+
constructor() {
|
|
20
|
+
logger.debug('Performance Monitor initialized');
|
|
21
|
+
}
|
|
22
|
+
static getInstance() {
|
|
23
|
+
if (!PerformanceMonitor.instance) {
|
|
24
|
+
PerformanceMonitor.instance = new PerformanceMonitor();
|
|
25
|
+
}
|
|
26
|
+
return PerformanceMonitor.instance;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Reset singleton instance (for testing)
|
|
30
|
+
*/
|
|
31
|
+
static resetInstance() {
|
|
32
|
+
if (PerformanceMonitor.instance) {
|
|
33
|
+
PerformanceMonitor.instance.clear();
|
|
34
|
+
}
|
|
35
|
+
// @ts-expect-error - Resetting singleton for tests
|
|
36
|
+
PerformanceMonitor.instance = undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Start tracking an operation
|
|
40
|
+
*
|
|
41
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
42
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
43
|
+
*/
|
|
44
|
+
start(operation, metadata) {
|
|
45
|
+
const id = `${operation}-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
46
|
+
const metric = {
|
|
47
|
+
operation,
|
|
48
|
+
startTime: Date.now(),
|
|
49
|
+
memoryStart: this.getMemoryUsage(),
|
|
50
|
+
metadata,
|
|
51
|
+
};
|
|
52
|
+
this.metrics.set(id, metric);
|
|
53
|
+
logger.debug(`Performance tracking started: ${operation}`, { id, metadata });
|
|
54
|
+
return id;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* End tracking an operation
|
|
58
|
+
*
|
|
59
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
60
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
61
|
+
*/
|
|
62
|
+
end(id) {
|
|
63
|
+
const metric = this.metrics.get(id);
|
|
64
|
+
if (!metric) {
|
|
65
|
+
logger.warn(`Performance metric not found: ${id}`);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
metric.endTime = Date.now();
|
|
69
|
+
metric.duration = metric.endTime - metric.startTime;
|
|
70
|
+
metric.memoryEnd = this.getMemoryUsage();
|
|
71
|
+
metric.memoryDelta = metric.memoryEnd - metric.memoryStart;
|
|
72
|
+
this.completedMetrics.push(metric);
|
|
73
|
+
this.metrics.delete(id);
|
|
74
|
+
logger.debug(`Performance tracking ended: ${metric.operation}`, {
|
|
75
|
+
duration: `${metric.duration}ms`,
|
|
76
|
+
memoryDelta: this.formatBytes(metric.memoryDelta),
|
|
77
|
+
});
|
|
78
|
+
return metric;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Track a synchronous function execution
|
|
82
|
+
*
|
|
83
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
84
|
+
* @ac US-012-AC-3: Operation profiling
|
|
85
|
+
*/
|
|
86
|
+
track(operation, fn, metadata) {
|
|
87
|
+
const id = this.start(operation, metadata);
|
|
88
|
+
try {
|
|
89
|
+
const result = fn();
|
|
90
|
+
this.end(id);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
this.end(id);
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Track an asynchronous function execution
|
|
100
|
+
*
|
|
101
|
+
* @ac US-012-AC-1: Execution time tracking
|
|
102
|
+
* @ac US-012-AC-3: Operation profiling
|
|
103
|
+
*/
|
|
104
|
+
async trackAsync(operation, fn, metadata) {
|
|
105
|
+
const id = this.start(operation, metadata);
|
|
106
|
+
try {
|
|
107
|
+
const result = await fn();
|
|
108
|
+
this.end(id);
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
this.end(id);
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Generate performance report
|
|
118
|
+
*
|
|
119
|
+
* @ac US-012-AC-4: Performance reports
|
|
120
|
+
* @ac US-012-AC-5: Bottleneck identification
|
|
121
|
+
*/
|
|
122
|
+
generateReport() {
|
|
123
|
+
const operations = [...this.completedMetrics].filter((m) => m.duration !== undefined);
|
|
124
|
+
if (operations.length === 0) {
|
|
125
|
+
return {
|
|
126
|
+
totalOperations: 0,
|
|
127
|
+
totalDuration: 0,
|
|
128
|
+
averageDuration: 0,
|
|
129
|
+
slowest: null,
|
|
130
|
+
fastest: null,
|
|
131
|
+
operations: [],
|
|
132
|
+
bottlenecks: [],
|
|
133
|
+
memory: {
|
|
134
|
+
totalAllocated: 0,
|
|
135
|
+
averageAllocated: 0,
|
|
136
|
+
peakUsage: 0,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// Sort by duration (slowest first)
|
|
141
|
+
operations.sort((a, b) => (b.duration ?? 0) - (a.duration ?? 0));
|
|
142
|
+
const totalDuration = operations.reduce((sum, op) => sum + (op.duration ?? 0), 0);
|
|
143
|
+
const averageDuration = totalDuration / operations.length;
|
|
144
|
+
// Ignore timer jitter for sub-5ms work; otherwise short operations with 0/1ms
|
|
145
|
+
// variance produce false bottlenecks in CI.
|
|
146
|
+
const bottlenecks = operations.filter((op) => {
|
|
147
|
+
const duration = op.duration ?? 0;
|
|
148
|
+
return duration >= 5 && duration > averageDuration * 2;
|
|
149
|
+
});
|
|
150
|
+
// Memory statistics
|
|
151
|
+
const memoryDeltas = operations.map((op) => op.memoryDelta ?? 0);
|
|
152
|
+
const totalMemory = memoryDeltas.reduce((sum, delta) => sum + delta, 0);
|
|
153
|
+
const peakMemory = Math.max(...operations.map((op) => op.memoryEnd ?? 0));
|
|
154
|
+
const report = {
|
|
155
|
+
totalOperations: operations.length,
|
|
156
|
+
totalDuration,
|
|
157
|
+
averageDuration,
|
|
158
|
+
slowest: operations[0] ?? null,
|
|
159
|
+
fastest: operations[operations.length - 1] ?? null,
|
|
160
|
+
operations,
|
|
161
|
+
bottlenecks,
|
|
162
|
+
memory: {
|
|
163
|
+
totalAllocated: totalMemory,
|
|
164
|
+
averageAllocated: totalMemory / operations.length,
|
|
165
|
+
peakUsage: peakMemory,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
logger.info('Performance report generated', {
|
|
169
|
+
totalOperations: report.totalOperations,
|
|
170
|
+
totalDuration: `${report.totalDuration.toFixed(2)}ms`,
|
|
171
|
+
averageDuration: `${report.averageDuration.toFixed(2)}ms`,
|
|
172
|
+
bottlenecks: report.bottlenecks.length,
|
|
173
|
+
});
|
|
174
|
+
return report;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get metrics for a specific operation
|
|
178
|
+
*
|
|
179
|
+
* @ac US-012-AC-3: Operation profiling
|
|
180
|
+
*/
|
|
181
|
+
getOperationMetrics(operationName) {
|
|
182
|
+
return this.completedMetrics.filter((m) => m.operation === operationName);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Compare two operations (benchmarking)
|
|
186
|
+
*
|
|
187
|
+
* @ac US-012-AC-6: Benchmark comparisons
|
|
188
|
+
*/
|
|
189
|
+
compare(operation1, operation2) {
|
|
190
|
+
const metrics1 = this.getOperationMetrics(operation1);
|
|
191
|
+
const metrics2 = this.getOperationMetrics(operation2);
|
|
192
|
+
const avgDuration1 = metrics1.reduce((sum, m) => sum + (m.duration ?? 0), 0) / (metrics1.length || 1);
|
|
193
|
+
const avgDuration2 = metrics2.reduce((sum, m) => sum + (m.duration ?? 0), 0) / (metrics2.length || 1);
|
|
194
|
+
const avgMemory1 = metrics1.reduce((sum, m) => sum + (m.memoryDelta ?? 0), 0) / (metrics1.length || 1);
|
|
195
|
+
const avgMemory2 = metrics2.reduce((sum, m) => sum + (m.memoryDelta ?? 0), 0) / (metrics2.length || 1);
|
|
196
|
+
const faster = avgDuration1 < avgDuration2 ? operation1 : operation2;
|
|
197
|
+
const speedup = Math.abs(avgDuration2 / avgDuration1);
|
|
198
|
+
logger.info(`Benchmark comparison: ${operation1} vs ${operation2}`, {
|
|
199
|
+
faster,
|
|
200
|
+
speedup: `${speedup.toFixed(2)}x`,
|
|
201
|
+
avgDuration1: `${avgDuration1.toFixed(2)}ms`,
|
|
202
|
+
avgDuration2: `${avgDuration2.toFixed(2)}ms`,
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
operation1: metrics1,
|
|
206
|
+
operation2: metrics2,
|
|
207
|
+
comparison: {
|
|
208
|
+
averageDuration1: avgDuration1,
|
|
209
|
+
averageDuration2: avgDuration2,
|
|
210
|
+
faster,
|
|
211
|
+
speedup,
|
|
212
|
+
memoryDiff: avgMemory2 - avgMemory1,
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Clear all metrics
|
|
218
|
+
*/
|
|
219
|
+
clear() {
|
|
220
|
+
this.metrics.clear();
|
|
221
|
+
this.completedMetrics = [];
|
|
222
|
+
logger.debug('Performance metrics cleared');
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Get current memory usage
|
|
226
|
+
*
|
|
227
|
+
* @ac US-012-AC-2: Memory usage tracking
|
|
228
|
+
*/
|
|
229
|
+
// eslint-disable-next-line class-methods-use-this
|
|
230
|
+
getMemoryUsage() {
|
|
231
|
+
return process?.memoryUsage?.()?.heapUsed ?? 0;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Format bytes to human-readable string
|
|
235
|
+
*/
|
|
236
|
+
formatBytes(bytes) {
|
|
237
|
+
if (bytes === 0)
|
|
238
|
+
return '0 Bytes';
|
|
239
|
+
if (bytes < 0)
|
|
240
|
+
return `-${this.formatBytes(-bytes)}`;
|
|
241
|
+
const k = 1024;
|
|
242
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
|
243
|
+
const i = Math.floor(Math.log(Math.abs(bytes)) / Math.log(k));
|
|
244
|
+
return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Export singleton instance
|
|
248
|
+
export const performanceMonitor = PerformanceMonitor.getInstance();
|
|
249
|
+
/**
|
|
250
|
+
* Decorator for tracking method execution time
|
|
251
|
+
*
|
|
252
|
+
* @ac US-012-AC-3: Operation profiling
|
|
253
|
+
*/
|
|
254
|
+
export function Profile(operationName) {
|
|
255
|
+
return function (target, propertyKey, descriptor) {
|
|
256
|
+
const originalMethod = descriptor.value;
|
|
257
|
+
const operation = operationName ??
|
|
258
|
+
`${target?.constructor?.name ?? 'Unknown'}.${propertyKey}`;
|
|
259
|
+
const profiledMethod = function (...args) {
|
|
260
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
261
|
+
return performanceMonitor.track(operation, () => originalMethod.apply(this, args));
|
|
262
|
+
};
|
|
263
|
+
Object.defineProperty(descriptor, 'value', {
|
|
264
|
+
configurable: true,
|
|
265
|
+
enumerable: descriptor.enumerable ?? false,
|
|
266
|
+
writable: true,
|
|
267
|
+
value: profiledMethod,
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Decorator for tracking async method execution time
|
|
273
|
+
*
|
|
274
|
+
* @ac US-012-AC-3: Operation profiling
|
|
275
|
+
*/
|
|
276
|
+
export function ProfileAsync(operationName) {
|
|
277
|
+
return function (target, propertyKey, descriptor) {
|
|
278
|
+
const originalMethod = descriptor.value;
|
|
279
|
+
const operation = operationName ??
|
|
280
|
+
`${target?.constructor?.name ?? 'Unknown'}.${propertyKey}`;
|
|
281
|
+
const profiledMethod = async function (...args) {
|
|
282
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
283
|
+
return performanceMonitor.trackAsync(operation, () => originalMethod.apply(this, args));
|
|
284
|
+
};
|
|
285
|
+
Object.defineProperty(descriptor, 'value', {
|
|
286
|
+
configurable: true,
|
|
287
|
+
enumerable: descriptor.enumerable ?? false,
|
|
288
|
+
writable: true,
|
|
289
|
+
value: profiledMethod,
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
logger.debug('Performance monitoring utilities loaded');
|
|
294
|
+
//# sourceMappingURL=performance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.js","sourceRoot":"","sources":["../../src/utils/performance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC;AA4C/C;;;;;;GAMG;AACH,MAAM,kBAAkB;IACd,MAAM,CAAC,QAAQ,CAAqB;IACpC,OAAO,GAAoC,IAAI,GAAG,EAAE,CAAC;IACrD,gBAAgB,GAAyB,EAAE,CAAC;IAEpD;QACE,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YACjC,kBAAkB,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACzD,CAAC;QACD,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa;QACzB,IAAI,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YAChC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtC,CAAC;QACD,mDAAmD;QACnD,kBAAkB,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,SAAiB,EAAE,QAAkC;QAChE,MAAM,EAAE,GAAG,GAAG,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,E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CAAC,CAAC,CAAC;QAC1F,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE;YACzC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,KAAK;YAC1C,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,cAAc;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides string manipulation functions for metadata processing
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Convert string to camelCase
|
|
8
|
+
*
|
|
9
|
+
* @ac US-011-AC-1: Case conversions (camelCase, PascalCase, snake_case)
|
|
10
|
+
* @example
|
|
11
|
+
* toCamelCase('hello_world') // 'helloWorld'
|
|
12
|
+
* toCamelCase('HelloWorld') // 'helloWorld'
|
|
13
|
+
*/
|
|
14
|
+
export declare function toCamelCase(str: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Convert string to PascalCase
|
|
17
|
+
*
|
|
18
|
+
* @ac US-011-AC-1: Case conversions (camelCase, PascalCase, snake_case)
|
|
19
|
+
* @example
|
|
20
|
+
* toPascalCase('hello_world') // 'HelloWorld'
|
|
21
|
+
* toPascalCase('helloWorld') // 'HelloWorld'
|
|
22
|
+
*/
|
|
23
|
+
export declare function toPascalCase(str: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Convert string to snake_case
|
|
26
|
+
*
|
|
27
|
+
* @ac US-011-AC-1: Case conversions (camelCase, PascalCase, snake_case)
|
|
28
|
+
* @example
|
|
29
|
+
* toSnakeCase('helloWorld') // 'hello_world'
|
|
30
|
+
* toSnakeCase('HelloWorld') // 'hello_world'
|
|
31
|
+
*/
|
|
32
|
+
export declare function toSnakeCase(str: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Convert string to kebab-case
|
|
35
|
+
*
|
|
36
|
+
* @ac US-011-AC-1: Case conversions (camelCase, PascalCase, snake_case)
|
|
37
|
+
* @example
|
|
38
|
+
* toKebabCase('helloWorld') // 'hello-world'
|
|
39
|
+
* toKebabCase('hello_world') // 'hello-world'
|
|
40
|
+
*/
|
|
41
|
+
export declare function toKebabCase(str: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Extract comments from Apex code
|
|
44
|
+
*
|
|
45
|
+
* @ac US-011-AC-2: Extract comments from Apex/JavaScript
|
|
46
|
+
* @example
|
|
47
|
+
* extractApexComments('// comment\ncode') // ['// comment']
|
|
48
|
+
*/
|
|
49
|
+
export declare function extractApexComments(code: string): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Extract comments from JavaScript code
|
|
52
|
+
*
|
|
53
|
+
* @ac US-011-AC-2: Extract comments from Apex/JavaScript
|
|
54
|
+
* @example
|
|
55
|
+
* extractJavaScriptComments('/* comment *\/\ncode') // ['/* comment *\/']
|
|
56
|
+
*/
|
|
57
|
+
export declare function extractJavaScriptComments(code: string): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Escape XML special characters
|
|
60
|
+
*
|
|
61
|
+
* @ac US-011-AC-3: Escape/unescape XML special characters
|
|
62
|
+
* @example
|
|
63
|
+
* escapeXml('<tag>value & "quoted"</tag>') // '<tag>value & "quoted"</tag>'
|
|
64
|
+
*/
|
|
65
|
+
export declare function escapeXml(str: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Unescape XML special characters
|
|
68
|
+
*
|
|
69
|
+
* @ac US-011-AC-3: Escape/unescape XML special characters
|
|
70
|
+
* @example
|
|
71
|
+
* unescapeXml('<tag>value & "quoted"</tag>') // '<tag>value & "quoted"</tag>'
|
|
72
|
+
*/
|
|
73
|
+
export declare function unescapeXml(str: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Common regex patterns for Salesforce
|
|
76
|
+
*
|
|
77
|
+
* @ac US-011-AC-4: Regex utilities for common patterns
|
|
78
|
+
*/
|
|
79
|
+
export declare const REGEX_PATTERNS: {
|
|
80
|
+
/** Salesforce API name (letters, numbers, underscores, starts with letter) */
|
|
81
|
+
readonly SALESFORCE_API_NAME: RegExp;
|
|
82
|
+
/** Salesforce Email (standard email pattern) */
|
|
83
|
+
readonly EMAIL: RegExp;
|
|
84
|
+
/** Salesforce 15/18 character ID */
|
|
85
|
+
readonly SALESFORCE_ID: RegExp;
|
|
86
|
+
/** Salesforce namespace prefix */
|
|
87
|
+
readonly NAMESPACE_PREFIX: RegExp;
|
|
88
|
+
/** Custom field suffix */
|
|
89
|
+
readonly CUSTOM_FIELD_SUFFIX: RegExp;
|
|
90
|
+
/** Custom object suffix */
|
|
91
|
+
readonly CUSTOM_OBJECT_SUFFIX: RegExp;
|
|
92
|
+
/** Metadata file extension */
|
|
93
|
+
readonly METADATA_FILE: RegExp;
|
|
94
|
+
/** Version number (semantic versioning) */
|
|
95
|
+
readonly VERSION: RegExp;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Validate Salesforce API name
|
|
99
|
+
*
|
|
100
|
+
* @ac US-011-AC-4: Regex utilities for common patterns
|
|
101
|
+
* @example
|
|
102
|
+
* isValidSalesforceApiName('MyField__c') // true
|
|
103
|
+
* isValidSalesforceApiName('123Invalid') // false
|
|
104
|
+
*/
|
|
105
|
+
export declare function isValidSalesforceApiName(name: string): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Validate email address
|
|
108
|
+
*
|
|
109
|
+
* @ac US-011-AC-4: Regex utilities for common patterns
|
|
110
|
+
* @example
|
|
111
|
+
* isValidEmail('user@example.com') // true
|
|
112
|
+
* isValidEmail('invalid-email') // false
|
|
113
|
+
*/
|
|
114
|
+
export declare function isValidEmail(email: string): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Normalize Unicode string (NFC normalization)
|
|
117
|
+
*
|
|
118
|
+
* @ac US-011-AC-5: Unicode handling
|
|
119
|
+
* @example
|
|
120
|
+
* normalizeUnicode('café') // Normalized form
|
|
121
|
+
*/
|
|
122
|
+
export declare function normalizeUnicode(str: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Strip accents from Unicode string
|
|
125
|
+
*
|
|
126
|
+
* @ac US-011-AC-5: Unicode handling
|
|
127
|
+
* @example
|
|
128
|
+
* stripAccents('café') // 'cafe'
|
|
129
|
+
* stripAccents('naïve') // 'naive'
|
|
130
|
+
*/
|
|
131
|
+
export declare function stripAccents(str: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Truncate string with ellipsis
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* truncate('Hello World', 8) // 'Hello...'
|
|
137
|
+
* truncate('Short', 10) // 'Short'
|
|
138
|
+
*/
|
|
139
|
+
export declare function truncate(str: string, maxLength: number, ellipsis?: string): string;
|
|
140
|
+
/**
|
|
141
|
+
* Pluralize word (simple English rules)
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* pluralize('field') // 'fields'
|
|
145
|
+
* pluralize('class') // 'classes'
|
|
146
|
+
* pluralize('entry') // 'entries'
|
|
147
|
+
*/
|
|
148
|
+
export declare function pluralize(word: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Singularize word (simple English rules)
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* singularize('fields') // 'field'
|
|
154
|
+
* singularize('classes') // 'class'
|
|
155
|
+
* singularize('entries') // 'entry'
|
|
156
|
+
*/
|
|
157
|
+
export declare function singularize(word: string): string;
|
|
158
|
+
/**
|
|
159
|
+
* Convert string to title case
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* toTitleCase('hello world') // 'Hello World'
|
|
163
|
+
* toTitleCase('HELLO WORLD') // 'Hello World'
|
|
164
|
+
*/
|
|
165
|
+
export declare function toTitleCase(str: string): string;
|
|
166
|
+
/**
|
|
167
|
+
* Remove multiple consecutive spaces
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* normalizeWhitespace('hello world') // 'hello world'
|
|
171
|
+
* normalizeWhitespace(' spaces ') // 'spaces'
|
|
172
|
+
*/
|
|
173
|
+
export declare function normalizeWhitespace(str: string): string;
|
|
174
|
+
/**
|
|
175
|
+
* Extract namespace from Salesforce API name
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* extractNamespace('MyNamespace__CustomObject__c') // 'MyNamespace'
|
|
179
|
+
* extractNamespace('StandardObject') // null
|
|
180
|
+
*/
|
|
181
|
+
export declare function extractNamespace(apiName: string): string | null;
|
|
182
|
+
/**
|
|
183
|
+
* Check if API name is custom (ends with __c)
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* isCustom('MyField__c') // true
|
|
187
|
+
* isCustom('Name') // false
|
|
188
|
+
*/
|
|
189
|
+
export declare function isCustom(apiName: string): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Format bytes to human-readable string
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* formatBytes(1024) // '1.00 KB'
|
|
195
|
+
* formatBytes(1048576) // '1.00 MB'
|
|
196
|
+
*/
|
|
197
|
+
export declare function formatBytes(bytes: number, decimals?: number): string;
|