@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,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salesforce Metadata Deployment Order
|
|
3
|
+
*
|
|
4
|
+
* Defines recommended deployment order for CORE Salesforce metadata types.
|
|
5
|
+
*
|
|
6
|
+
* **Important**: Salesforce has 100+ metadata types and adds new ones each release.
|
|
7
|
+
* This file defines priorities for the MOST COMMON types (~78).
|
|
8
|
+
* For unlisted types, the plugin uses a fallback priority (99) via getDeploymentPriority().
|
|
9
|
+
*
|
|
10
|
+
* **Extensibility Strategy**:
|
|
11
|
+
* - Add new types here as needed (e.g., new Einstein features)
|
|
12
|
+
* - Unknown types automatically get priority 99 (deploy last, safe default)
|
|
13
|
+
* - Plugin works with ANY metadata type, even if not listed here
|
|
14
|
+
*
|
|
15
|
+
* Lower numbers = deploy first
|
|
16
|
+
* Higher numbers = deploy later
|
|
17
|
+
*
|
|
18
|
+
* @see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm
|
|
19
|
+
* @see https://help.salesforce.com/s/articleView?id=000386798&type=1
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Deployment priority map for all Salesforce metadata types.
|
|
23
|
+
* Follows the principle: dependencies first, dependents later.
|
|
24
|
+
*
|
|
25
|
+
* Priority Groups:
|
|
26
|
+
* - 1-9: Core data model (objects, fields, record types)
|
|
27
|
+
* - 10-19: Code (Apex classes, pages, components)
|
|
28
|
+
* - 20-29: Automation (triggers, flows, process builders)
|
|
29
|
+
* - 30-39: UI & Experiences (layouts, pages, sites)
|
|
30
|
+
* - 40-49: Security & Access (profiles, permission sets, sharing)
|
|
31
|
+
* - 50-59: Integration & External (connected apps, named credentials)
|
|
32
|
+
* - 60-69: Content & Knowledge
|
|
33
|
+
* - 70-79: Analytics & Reporting
|
|
34
|
+
* - 80-89: Other metadata
|
|
35
|
+
* - 90-99: Post-deployment (translations, static resources)
|
|
36
|
+
*/
|
|
37
|
+
export const DEPLOYMENT_ORDER = Object.freeze({
|
|
38
|
+
// ========== Tier 0: Global Configuration (1-5) ==========
|
|
39
|
+
GlobalValueSet: 1, // Global value sets used by picklists
|
|
40
|
+
StandardValueSet: 2, // Standard value sets
|
|
41
|
+
CustomLabels: 3, // Custom labels
|
|
42
|
+
Translations: 4, // Translation files
|
|
43
|
+
StandardValueSetTranslation: 5, // Standard value set translations
|
|
44
|
+
// ========== Tier 1: Foundation - Objects & Fields (6-15) ==========
|
|
45
|
+
CustomObject: 6, // Core data model - must be early
|
|
46
|
+
CustomSetting: 7, // Custom settings (like custom objects)
|
|
47
|
+
DataCategoryGroup: 8, // Data category groups
|
|
48
|
+
CustomMetadata: 9, // Custom metadata types
|
|
49
|
+
CustomMetadataRecord: 10, // Custom metadata records
|
|
50
|
+
CustomField: 11, // Fields depend on objects
|
|
51
|
+
ObjectTranslation: 12, // Object translations
|
|
52
|
+
RecordType: 13, // Record types depend on objects/fields
|
|
53
|
+
BusinessProcess: 14, // Business processes depend on record types
|
|
54
|
+
ValidationRule: 15, // Validation rules depend on fields
|
|
55
|
+
WorkflowRule: 16, // Workflow rules
|
|
56
|
+
// ========== Tier 2: Security Foundation (17-23) ==========
|
|
57
|
+
OrgSettings: 17, // Org-wide settings
|
|
58
|
+
CorsWhitelistOrigin: 18, // CORS settings
|
|
59
|
+
CspTrustedSite: 19, // CSP trusted sites
|
|
60
|
+
Role: 20, // Role hierarchy
|
|
61
|
+
DelegateGroup: 21, // Delegate groups
|
|
62
|
+
Group: 22, // Public groups
|
|
63
|
+
CustomPermission: 23, // Custom permissions
|
|
64
|
+
ExternalCredential: 24, // External credentials
|
|
65
|
+
NamedCredential: 25, // Named credentials for callouts
|
|
66
|
+
DataSourceObject: 26, // Data source objects
|
|
67
|
+
// ========== Tier 3: Code & Resources (27-36) ==========
|
|
68
|
+
StaticResource: 27, // Static resources
|
|
69
|
+
Document: 28, // Documents
|
|
70
|
+
ContentAsset: 29, // Content assets
|
|
71
|
+
EmailTemplate: 30, // Email templates
|
|
72
|
+
ApexClass: 31, // Apex classes - deploy before triggers
|
|
73
|
+
VisualforceComponent: 32, // VF components
|
|
74
|
+
VisualforcePage: 33, // VF pages
|
|
75
|
+
LightningComponentBundle: 34, // LWC
|
|
76
|
+
AuraDefinitionBundle: 35, // Aura components
|
|
77
|
+
ApexTrigger: 36, // Triggers after classes
|
|
78
|
+
// ========== Tier 4: Service Cloud (37-42) ==========
|
|
79
|
+
ServicePresenceStatus: 37, // Service presence
|
|
80
|
+
PresenceUserConfig: 38, // Presence config
|
|
81
|
+
Queue: 39, // Queues
|
|
82
|
+
ServiceChannel: 40, // Service channels
|
|
83
|
+
QueueRoutingConfig: 41, // Queue routing
|
|
84
|
+
ChannelLayout: 42, // Channel layouts
|
|
85
|
+
// ========== Tier 5: Business Logic & AI (43-49) ==========
|
|
86
|
+
MilestoneType: 43, // Milestone types
|
|
87
|
+
EntitlementProcess: 44, // Entitlement processes
|
|
88
|
+
GenAiFunction: 45, // Einstein AI functions
|
|
89
|
+
GenAiPromptTemplate: 46, // Einstein prompts
|
|
90
|
+
GenAiPlannerBundle: 47, // Einstein planners
|
|
91
|
+
Flow: 48, // Flows (after Apex classes)
|
|
92
|
+
PathAssistant: 49, // Path assistant
|
|
93
|
+
// ========== Tier 6: UI Components (50-59) ==========
|
|
94
|
+
Layout: 50, // Page layouts
|
|
95
|
+
Bot: 51, // Einstein Bots
|
|
96
|
+
BotVersion: 52, // Bot versions
|
|
97
|
+
GenAiPlugin: 53, // Einstein plugins
|
|
98
|
+
FlexiPage: 54, // Lightning pages
|
|
99
|
+
QuickAction: 55, // Quick actions
|
|
100
|
+
CompactLayout: 56, // Compact layouts
|
|
101
|
+
ListView: 57, // List views
|
|
102
|
+
WebLink: 58, // Web links
|
|
103
|
+
LightningApp: 59, // Lightning apps
|
|
104
|
+
SearchCustomization: 60, // Search customizations
|
|
105
|
+
CustomNotificationType: 61, // Custom notifications
|
|
106
|
+
// ========== Tier 7: Experience Cloud (62-69) ==========
|
|
107
|
+
BrandingSet: 62, // Branding sets
|
|
108
|
+
DigitalExperienceConfig: 63, // Digital experience config
|
|
109
|
+
Site: 64, // Sites
|
|
110
|
+
DigitalExperience: 65, // Digital experiences
|
|
111
|
+
NetworkBranding: 66, // Network branding
|
|
112
|
+
Network: 67, // Networks (communities)
|
|
113
|
+
EmbeddedServiceConfig: 68, // Embedded service
|
|
114
|
+
MessagingChannel: 69, // Messaging channels
|
|
115
|
+
// ========== Tier 8: Advanced Configurations (70-74) ==========
|
|
116
|
+
OmniSupervisorConfig: 70, // Omni supervisor
|
|
117
|
+
// ========== Tier 9: Security & Access - LAST (75-79) ==========
|
|
118
|
+
SharingRules: 75, // Sharing rules after everything
|
|
119
|
+
PermissionSet: 76, // Permission sets
|
|
120
|
+
MutingPermissionSet: 77, // Muting permission sets
|
|
121
|
+
PermissionSetGroup: 78, // Permission set groups
|
|
122
|
+
Profile: 79, // Profiles LAST (reference everything)
|
|
123
|
+
// ========== Tier 10: Testing & Data Packages (80-82) ==========
|
|
124
|
+
ApexTestSuite: 80, // Test suites
|
|
125
|
+
DataPackageKitDefinition: 81, // Data package kits
|
|
126
|
+
DataPackageKitObject: 82, // Data package kit objects
|
|
127
|
+
});
|
|
128
|
+
/**
|
|
129
|
+
* Get deployment priority for a given metadata type.
|
|
130
|
+
*
|
|
131
|
+
* **Extensibility**: Returns 99 for unknown/new metadata types (safe fallback).
|
|
132
|
+
* This ensures the plugin works with future Salesforce metadata types without updates.
|
|
133
|
+
*
|
|
134
|
+
* @param metadataType - The Salesforce metadata type
|
|
135
|
+
* @returns Priority number (1-99), or 99 (lowest priority) if type is unknown
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* const priority = getDeploymentPriority('CustomObject'); // 6
|
|
140
|
+
* const priority2 = getDeploymentPriority('ApexClass'); // 31
|
|
141
|
+
* const unknown = getDeploymentPriority('UnknownNewType'); // 99 (safe fallback)
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export function getDeploymentPriority(metadataType) {
|
|
145
|
+
return DEPLOYMENT_ORDER[metadataType] ?? 99; // Fallback for unknown/future types
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Sort metadata components by deployment priority.
|
|
149
|
+
*
|
|
150
|
+
* @param components - Array of metadata type names
|
|
151
|
+
* @returns Sorted array (lowest priority number first = deploy first)
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const sorted = sortByDeploymentOrder(['ApexClass', 'CustomObject', 'Flow']);
|
|
156
|
+
* // Result: ['CustomObject', 'ApexClass', 'Flow']
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
export function sortByDeploymentOrder(components) {
|
|
160
|
+
return [...components].sort((a, b) => getDeploymentPriority(a) - getDeploymentPriority(b));
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=deployment-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-order.js","sourceRoot":"","sources":["../../src/constants/deployment-order.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salesforce API and Deployment Limits
|
|
3
|
+
*
|
|
4
|
+
* These are **hardcoded technical limits** from Salesforce that should NOT be configurable by users.
|
|
5
|
+
* These limits are based on official Salesforce Metadata API documentation and real-world production constraints.
|
|
6
|
+
*
|
|
7
|
+
* @see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm
|
|
8
|
+
* @see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_size.htm
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Maximum number of components per deployment wave.
|
|
12
|
+
*
|
|
13
|
+
* **Real-World Limit: 300 components**
|
|
14
|
+
* - Official Salesforce API limit is 10,000 files, but UNKNOWN_EXCEPTION occurs at ~300-500 components
|
|
15
|
+
* - This is a proven safe limit based on production deployments
|
|
16
|
+
* - Exceeding this causes UNKNOWN_EXCEPTION (not API rejection)
|
|
17
|
+
* - This limit is per wave, not per deployment
|
|
18
|
+
*
|
|
19
|
+
* **Why not 10,000?**
|
|
20
|
+
* - Salesforce has undocumented transactional limits that cause UNKNOWN_EXCEPTION
|
|
21
|
+
* - Large deployments (>300 components) hit internal timeout/memory limits
|
|
22
|
+
* - 300 is the safe upper bound for reliable deployments
|
|
23
|
+
*
|
|
24
|
+
* @constant
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAX_COMPONENTS_PER_WAVE = 300;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of files per deployment operation.
|
|
30
|
+
*
|
|
31
|
+
* **Real-World Limit: 400-500 files**
|
|
32
|
+
* - Official Salesforce API limit is higher, but practical limit is ~400-500 files
|
|
33
|
+
* - Exceeding this causes UNKNOWN_EXCEPTION
|
|
34
|
+
* - This includes all metadata XML files and source files (Apex, LWC, static resources, etc.)
|
|
35
|
+
*
|
|
36
|
+
* @constant
|
|
37
|
+
* @type {number}
|
|
38
|
+
*/
|
|
39
|
+
export declare const MAX_FILES_PER_DEPLOYMENT = 500;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum compressed size of deployment package (ZIP).
|
|
42
|
+
*
|
|
43
|
+
* **Official Salesforce Limit: 39 MB compressed**
|
|
44
|
+
* - Applies to the ZIP file sent to Salesforce Metadata API
|
|
45
|
+
* - Exceeding this causes API rejection before deployment starts
|
|
46
|
+
* - Use this to estimate if a wave needs to be split based on size
|
|
47
|
+
*
|
|
48
|
+
* @constant
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
export declare const MAX_DEPLOYMENT_SIZE_COMPRESSED_MB = 39;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum uncompressed size of deployment package.
|
|
54
|
+
*
|
|
55
|
+
* **Official Salesforce Limit: 600 MB uncompressed**
|
|
56
|
+
* - Applies to the total size of all files in the deployment
|
|
57
|
+
* - Useful for pre-validation before compression
|
|
58
|
+
* - Exceeding this causes deployment failures
|
|
59
|
+
*
|
|
60
|
+
* @constant
|
|
61
|
+
* @type {number}
|
|
62
|
+
*/
|
|
63
|
+
export declare const MAX_DEPLOYMENT_SIZE_UNCOMPRESSED_MB = 600;
|
|
64
|
+
/**
|
|
65
|
+
* Maximum number of Custom Metadata Records per deployment wave.
|
|
66
|
+
*
|
|
67
|
+
* **Why 200?**
|
|
68
|
+
* - CustomMetadataType records have a **lower transactional limit** than general metadata
|
|
69
|
+
* - Salesforce enforces ~200-250 records per transaction due to row locking
|
|
70
|
+
* - 200 is a proven safe limit in production deployments with heavy CMT usage
|
|
71
|
+
* - Exceeding this causes "UNABLE_TO_LOCK_ROW" errors, not UNKNOWN_EXCEPTION
|
|
72
|
+
*
|
|
73
|
+
* @constant
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
export declare const MAX_CMT_RECORDS_PER_WAVE = 200;
|
|
77
|
+
/**
|
|
78
|
+
* Timeout for Salesforce API calls in milliseconds.
|
|
79
|
+
*
|
|
80
|
+
* **Why 10 minutes?**
|
|
81
|
+
* - Salesforce API calls can be long-running, especially for large deployments
|
|
82
|
+
* - Prevents premature timeouts for legitimate long-running operations
|
|
83
|
+
* - Aligns with common CI/CD timeout practices
|
|
84
|
+
*
|
|
85
|
+
* @constant
|
|
86
|
+
* @type {number}
|
|
87
|
+
*/
|
|
88
|
+
export declare const API_TIMEOUT_MS = 600000;
|
|
89
|
+
/**
|
|
90
|
+
* Consolidated Salesforce Limits Object (for backward compatibility)
|
|
91
|
+
*
|
|
92
|
+
* @deprecated Use individual named exports instead (e.g., MAX_FILES_PER_DEPLOYMENT)
|
|
93
|
+
* @constant
|
|
94
|
+
* @readonly
|
|
95
|
+
*/
|
|
96
|
+
export declare const SALESFORCE_LIMITS: Readonly<{
|
|
97
|
+
readonly MAX_COMPONENTS_PER_WAVE: 300;
|
|
98
|
+
readonly MAX_FILES_PER_DEPLOYMENT: 500;
|
|
99
|
+
readonly MAX_DEPLOYMENT_SIZE_COMPRESSED_MB: 39;
|
|
100
|
+
readonly MAX_DEPLOYMENT_SIZE_UNCOMPRESSED_MB: 600;
|
|
101
|
+
readonly MAX_CMT_RECORDS_PER_WAVE: 200;
|
|
102
|
+
readonly API_TIMEOUT_MS: 600000;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Type helper for Salesforce Limits
|
|
106
|
+
*/
|
|
107
|
+
export type SalesforceLimits = typeof SALESFORCE_LIMITS;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salesforce API and Deployment Limits
|
|
3
|
+
*
|
|
4
|
+
* These are **hardcoded technical limits** from Salesforce that should NOT be configurable by users.
|
|
5
|
+
* These limits are based on official Salesforce Metadata API documentation and real-world production constraints.
|
|
6
|
+
*
|
|
7
|
+
* @see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm
|
|
8
|
+
* @see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_size.htm
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Maximum number of components per deployment wave.
|
|
12
|
+
*
|
|
13
|
+
* **Real-World Limit: 300 components**
|
|
14
|
+
* - Official Salesforce API limit is 10,000 files, but UNKNOWN_EXCEPTION occurs at ~300-500 components
|
|
15
|
+
* - This is a proven safe limit based on production deployments
|
|
16
|
+
* - Exceeding this causes UNKNOWN_EXCEPTION (not API rejection)
|
|
17
|
+
* - This limit is per wave, not per deployment
|
|
18
|
+
*
|
|
19
|
+
* **Why not 10,000?**
|
|
20
|
+
* - Salesforce has undocumented transactional limits that cause UNKNOWN_EXCEPTION
|
|
21
|
+
* - Large deployments (>300 components) hit internal timeout/memory limits
|
|
22
|
+
* - 300 is the safe upper bound for reliable deployments
|
|
23
|
+
*
|
|
24
|
+
* @constant
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
export const MAX_COMPONENTS_PER_WAVE = 300;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of files per deployment operation.
|
|
30
|
+
*
|
|
31
|
+
* **Real-World Limit: 400-500 files**
|
|
32
|
+
* - Official Salesforce API limit is higher, but practical limit is ~400-500 files
|
|
33
|
+
* - Exceeding this causes UNKNOWN_EXCEPTION
|
|
34
|
+
* - This includes all metadata XML files and source files (Apex, LWC, static resources, etc.)
|
|
35
|
+
*
|
|
36
|
+
* @constant
|
|
37
|
+
* @type {number}
|
|
38
|
+
*/
|
|
39
|
+
export const MAX_FILES_PER_DEPLOYMENT = 500;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum compressed size of deployment package (ZIP).
|
|
42
|
+
*
|
|
43
|
+
* **Official Salesforce Limit: 39 MB compressed**
|
|
44
|
+
* - Applies to the ZIP file sent to Salesforce Metadata API
|
|
45
|
+
* - Exceeding this causes API rejection before deployment starts
|
|
46
|
+
* - Use this to estimate if a wave needs to be split based on size
|
|
47
|
+
*
|
|
48
|
+
* @constant
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
export const MAX_DEPLOYMENT_SIZE_COMPRESSED_MB = 39;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum uncompressed size of deployment package.
|
|
54
|
+
*
|
|
55
|
+
* **Official Salesforce Limit: 600 MB uncompressed**
|
|
56
|
+
* - Applies to the total size of all files in the deployment
|
|
57
|
+
* - Useful for pre-validation before compression
|
|
58
|
+
* - Exceeding this causes deployment failures
|
|
59
|
+
*
|
|
60
|
+
* @constant
|
|
61
|
+
* @type {number}
|
|
62
|
+
*/
|
|
63
|
+
export const MAX_DEPLOYMENT_SIZE_UNCOMPRESSED_MB = 600;
|
|
64
|
+
/**
|
|
65
|
+
* Maximum number of Custom Metadata Records per deployment wave.
|
|
66
|
+
*
|
|
67
|
+
* **Why 200?**
|
|
68
|
+
* - CustomMetadataType records have a **lower transactional limit** than general metadata
|
|
69
|
+
* - Salesforce enforces ~200-250 records per transaction due to row locking
|
|
70
|
+
* - 200 is a proven safe limit in production deployments with heavy CMT usage
|
|
71
|
+
* - Exceeding this causes "UNABLE_TO_LOCK_ROW" errors, not UNKNOWN_EXCEPTION
|
|
72
|
+
*
|
|
73
|
+
* @constant
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
export const MAX_CMT_RECORDS_PER_WAVE = 200;
|
|
77
|
+
/**
|
|
78
|
+
* Timeout for Salesforce API calls in milliseconds.
|
|
79
|
+
*
|
|
80
|
+
* **Why 10 minutes?**
|
|
81
|
+
* - Salesforce API calls can be long-running, especially for large deployments
|
|
82
|
+
* - Prevents premature timeouts for legitimate long-running operations
|
|
83
|
+
* - Aligns with common CI/CD timeout practices
|
|
84
|
+
*
|
|
85
|
+
* @constant
|
|
86
|
+
* @type {number}
|
|
87
|
+
*/
|
|
88
|
+
export const API_TIMEOUT_MS = 600_000; // 10 minutes
|
|
89
|
+
/**
|
|
90
|
+
* Consolidated Salesforce Limits Object (for backward compatibility)
|
|
91
|
+
*
|
|
92
|
+
* @deprecated Use individual named exports instead (e.g., MAX_FILES_PER_DEPLOYMENT)
|
|
93
|
+
* @constant
|
|
94
|
+
* @readonly
|
|
95
|
+
*/
|
|
96
|
+
export const SALESFORCE_LIMITS = Object.freeze({
|
|
97
|
+
MAX_COMPONENTS_PER_WAVE,
|
|
98
|
+
MAX_FILES_PER_DEPLOYMENT,
|
|
99
|
+
MAX_DEPLOYMENT_SIZE_COMPRESSED_MB,
|
|
100
|
+
MAX_DEPLOYMENT_SIZE_UNCOMPRESSED_MB,
|
|
101
|
+
MAX_CMT_RECORDS_PER_WAVE,
|
|
102
|
+
API_TIMEOUT_MS,
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=salesforce-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"salesforce-limits.js","sourceRoot":"","sources":["../../src/constants/salesforce-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,CAAC,aAAa;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,uBAAuB;IACvB,wBAAwB;IACxB,iCAAiC;IACjC,mCAAmC;IACnC,wBAAwB;IACxB,cAAc;CACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Circular Dependency Detector
|
|
3
|
+
* Detects and reports circular dependencies in the dependency graph
|
|
4
|
+
*
|
|
5
|
+
* @ac US-030-AC-1: Detect simple cycles (A→B→A)
|
|
6
|
+
* @ac US-030-AC-2: Detect complex cycles (A→B→C→A)
|
|
7
|
+
* @ac US-030-AC-3: Report all nodes in cycle
|
|
8
|
+
* @ac US-030-AC-4: Suggest where to break cycle
|
|
9
|
+
* @ac US-030-AC-5: Support user-defined cycle breaks
|
|
10
|
+
* @ac US-030-AC-6: Handle multiple separate cycles
|
|
11
|
+
*
|
|
12
|
+
* @issue #30
|
|
13
|
+
*/
|
|
14
|
+
import type { NodeId, DependencyGraph, CircularDependency } from '../types/dependency.js';
|
|
15
|
+
/**
|
|
16
|
+
* Cycle break suggestion
|
|
17
|
+
*/
|
|
18
|
+
export type CycleBreakSuggestion = {
|
|
19
|
+
from: NodeId;
|
|
20
|
+
to: NodeId;
|
|
21
|
+
reason: string;
|
|
22
|
+
priority: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Detected cycle with break suggestions
|
|
26
|
+
*/
|
|
27
|
+
export type DetectedCycle = CircularDependency & {
|
|
28
|
+
id: string;
|
|
29
|
+
breakSuggestions: CycleBreakSuggestion[];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Options for cycle detection
|
|
33
|
+
*/
|
|
34
|
+
export type CycleDetectionOptions = {
|
|
35
|
+
/** Maximum depth to search for cycles */
|
|
36
|
+
maxDepth?: number;
|
|
37
|
+
/** User-defined edges to ignore (cycle breaks) */
|
|
38
|
+
ignoreEdges?: Array<{
|
|
39
|
+
from: NodeId;
|
|
40
|
+
to: NodeId;
|
|
41
|
+
}>;
|
|
42
|
+
/** Generate break suggestions */
|
|
43
|
+
generateSuggestions?: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Circular Dependency Detector
|
|
47
|
+
*
|
|
48
|
+
* Uses depth-first search (DFS) to detect cycles in the dependency graph.
|
|
49
|
+
* Supports both simple (A→B→A) and complex (A→B→C→A) cycles.
|
|
50
|
+
*
|
|
51
|
+
* Performance: O(V + E) where V = vertices, E = edges
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const detector = new CircularDependencyDetector(graph);
|
|
55
|
+
* const cycles = detector.detectCycles();
|
|
56
|
+
* if (cycles.length > 0) {
|
|
57
|
+
* console.log(`Found ${cycles.length} circular dependencies`);
|
|
58
|
+
* console.log('Suggestion:', cycles[0].breakSuggestions[0]);
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
export declare class CircularDependencyDetector {
|
|
62
|
+
private graph;
|
|
63
|
+
private options;
|
|
64
|
+
private ignoredEdges;
|
|
65
|
+
constructor(graph: DependencyGraph, options?: CycleDetectionOptions);
|
|
66
|
+
/**
|
|
67
|
+
* Calculate priority for breaking an edge
|
|
68
|
+
* Higher = better candidate to break
|
|
69
|
+
*/
|
|
70
|
+
private static calculateBreakPriority;
|
|
71
|
+
/**
|
|
72
|
+
* Get human-readable reason for break suggestion
|
|
73
|
+
*/
|
|
74
|
+
private static getBreakReason;
|
|
75
|
+
/**
|
|
76
|
+
* Check if a class is a utility/helper class
|
|
77
|
+
*/
|
|
78
|
+
private static isUtilityClass;
|
|
79
|
+
/**
|
|
80
|
+
* Check if a class is core domain logic
|
|
81
|
+
*/
|
|
82
|
+
private static isCoreDomainClass;
|
|
83
|
+
/**
|
|
84
|
+
* Generate a unique ID for a cycle (order-independent)
|
|
85
|
+
*/
|
|
86
|
+
private static generateCycleId;
|
|
87
|
+
/**
|
|
88
|
+
* Check if a cycle is a duplicate of already found cycles
|
|
89
|
+
*/
|
|
90
|
+
private static isDuplicateCycle;
|
|
91
|
+
/**
|
|
92
|
+
* Detect all circular dependencies in the graph
|
|
93
|
+
*
|
|
94
|
+
* @ac US-030-AC-1: Detect simple cycles (A→B→A)
|
|
95
|
+
* @ac US-030-AC-2: Detect complex cycles (A→B→C→A)
|
|
96
|
+
* @ac US-030-AC-6: Handle multiple separate cycles
|
|
97
|
+
*/
|
|
98
|
+
detectCycles(): DetectedCycle[];
|
|
99
|
+
/**
|
|
100
|
+
* Detect cycles starting from a specific node
|
|
101
|
+
*/
|
|
102
|
+
detectCyclesFromNode(startNode: NodeId): DetectedCycle[];
|
|
103
|
+
/**
|
|
104
|
+
* Check if a specific path creates a cycle
|
|
105
|
+
*/
|
|
106
|
+
wouldCreateCycle(from: NodeId, to: NodeId): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* @ac US-030-AC-3: Report all nodes in cycle
|
|
109
|
+
*
|
|
110
|
+
* Create a detected cycle with full information
|
|
111
|
+
*/
|
|
112
|
+
private createDetectedCycle;
|
|
113
|
+
/**
|
|
114
|
+
* @ac US-030-AC-4: Suggest where to break cycle
|
|
115
|
+
*
|
|
116
|
+
* Generate suggestions for breaking the cycle
|
|
117
|
+
* Priority based on:
|
|
118
|
+
* - Test classes (high priority to break)
|
|
119
|
+
* - Utility classes (medium priority)
|
|
120
|
+
* - Core business logic (low priority)
|
|
121
|
+
*/
|
|
122
|
+
private static generateBreakSuggestions;
|
|
123
|
+
/**
|
|
124
|
+
* @ac US-030-AC-5: Support user-defined cycle breaks
|
|
125
|
+
*
|
|
126
|
+
* Check if an edge is in the ignore list
|
|
127
|
+
*/
|
|
128
|
+
private isEdgeIgnored;
|
|
129
|
+
/**
|
|
130
|
+
* Get summary statistics
|
|
131
|
+
*/
|
|
132
|
+
getStats(): {
|
|
133
|
+
totalNodes: number;
|
|
134
|
+
totalEdges: number;
|
|
135
|
+
ignoredEdges: number;
|
|
136
|
+
};
|
|
137
|
+
}
|