@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.
Files changed (395) hide show
  1. package/README.md +193 -0
  2. package/lib/ai/agentforce-error-handler.d.ts +81 -0
  3. package/lib/ai/agentforce-error-handler.js +196 -0
  4. package/lib/ai/agentforce-error-handler.js.map +1 -0
  5. package/lib/ai/agentforce-priority-service.d.ts +82 -0
  6. package/lib/ai/agentforce-priority-service.js +257 -0
  7. package/lib/ai/agentforce-priority-service.js.map +1 -0
  8. package/lib/ai/agentforce-service.d.ts +99 -0
  9. package/lib/ai/agentforce-service.js +300 -0
  10. package/lib/ai/agentforce-service.js.map +1 -0
  11. package/lib/ai/circuit-breaker.d.ts +115 -0
  12. package/lib/ai/circuit-breaker.js +277 -0
  13. package/lib/ai/circuit-breaker.js.map +1 -0
  14. package/lib/ai/dependency-inference-service.d.ts +76 -0
  15. package/lib/ai/dependency-inference-service.js +220 -0
  16. package/lib/ai/dependency-inference-service.js.map +1 -0
  17. package/lib/ai/llm-provider-factory.d.ts +15 -0
  18. package/lib/ai/llm-provider-factory.js +36 -0
  19. package/lib/ai/llm-provider-factory.js.map +1 -0
  20. package/lib/ai/llm-provider.d.ts +27 -0
  21. package/lib/ai/llm-provider.js +2 -0
  22. package/lib/ai/llm-provider.js.map +1 -0
  23. package/lib/ai/openai-service.d.ts +20 -0
  24. package/lib/ai/openai-service.js +89 -0
  25. package/lib/ai/openai-service.js.map +1 -0
  26. package/lib/ai/prompt-builder.d.ts +79 -0
  27. package/lib/ai/prompt-builder.js +180 -0
  28. package/lib/ai/prompt-builder.js.map +1 -0
  29. package/lib/ai/response-parser.d.ts +67 -0
  30. package/lib/ai/response-parser.js +234 -0
  31. package/lib/ai/response-parser.js.map +1 -0
  32. package/lib/ai/wave-validation-service.d.ts +111 -0
  33. package/lib/ai/wave-validation-service.js +381 -0
  34. package/lib/ai/wave-validation-service.js.map +1 -0
  35. package/lib/analysis/analysis-reporter.d.ts +56 -0
  36. package/lib/analysis/analysis-reporter.js +170 -0
  37. package/lib/analysis/analysis-reporter.js.map +1 -0
  38. package/lib/analytics/error-analytics.d.ts +80 -0
  39. package/lib/analytics/error-analytics.js +162 -0
  40. package/lib/analytics/error-analytics.js.map +1 -0
  41. package/lib/commands/analyze.d.ts +49 -0
  42. package/lib/commands/analyze.js +232 -0
  43. package/lib/commands/analyze.js.map +1 -0
  44. package/lib/commands/config.d.ts +42 -0
  45. package/lib/commands/config.js +219 -0
  46. package/lib/commands/config.js.map +1 -0
  47. package/lib/commands/resume.d.ts +26 -0
  48. package/lib/commands/resume.js +69 -0
  49. package/lib/commands/resume.js.map +1 -0
  50. package/lib/commands/start.d.ts +70 -0
  51. package/lib/commands/start.js +659 -0
  52. package/lib/commands/start.js.map +1 -0
  53. package/lib/commands/status.d.ts +37 -0
  54. package/lib/commands/status.js +69 -0
  55. package/lib/commands/status.js.map +1 -0
  56. package/lib/commands/validate.d.ts +33 -0
  57. package/lib/commands/validate.js +66 -0
  58. package/lib/commands/validate.js.map +1 -0
  59. package/lib/config/repo-config.d.ts +22 -0
  60. package/lib/config/repo-config.js +31 -0
  61. package/lib/config/repo-config.js.map +1 -0
  62. package/lib/constants/agentforce-limits.d.ts +174 -0
  63. package/lib/constants/agentforce-limits.js +262 -0
  64. package/lib/constants/agentforce-limits.js.map +1 -0
  65. package/lib/constants/api-version.d.ts +70 -0
  66. package/lib/constants/api-version.js +122 -0
  67. package/lib/constants/api-version.js.map +1 -0
  68. package/lib/constants/deployment-order.d.ts +68 -0
  69. package/lib/constants/deployment-order.js +162 -0
  70. package/lib/constants/deployment-order.js.map +1 -0
  71. package/lib/constants/salesforce-limits.d.ts +107 -0
  72. package/lib/constants/salesforce-limits.js +104 -0
  73. package/lib/constants/salesforce-limits.js.map +1 -0
  74. package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
  75. package/lib/dependencies/circular-dependency-detector.js +329 -0
  76. package/lib/dependencies/circular-dependency-detector.js.map +1 -0
  77. package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
  78. package/lib/dependencies/cycle-remediation-planner.js +192 -0
  79. package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
  80. package/lib/dependencies/dependency-cache.d.ts +134 -0
  81. package/lib/dependencies/dependency-cache.js +303 -0
  82. package/lib/dependencies/dependency-cache.js.map +1 -0
  83. package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
  84. package/lib/dependencies/dependency-depth-calculator.js +368 -0
  85. package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
  86. package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
  87. package/lib/dependencies/dependency-graph-builder.js +411 -0
  88. package/lib/dependencies/dependency-graph-builder.js.map +1 -0
  89. package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
  90. package/lib/dependencies/dependency-impact-analyzer.js +330 -0
  91. package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
  92. package/lib/dependencies/dependency-merger.d.ts +122 -0
  93. package/lib/dependencies/dependency-merger.js +245 -0
  94. package/lib/dependencies/dependency-merger.js.map +1 -0
  95. package/lib/dependencies/dependency-resolver.d.ts +157 -0
  96. package/lib/dependencies/dependency-resolver.js +298 -0
  97. package/lib/dependencies/dependency-resolver.js.map +1 -0
  98. package/lib/dependencies/dependency-validator.d.ts +123 -0
  99. package/lib/dependencies/dependency-validator.js +291 -0
  100. package/lib/dependencies/dependency-validator.js.map +1 -0
  101. package/lib/dependencies/graph-visualizer.d.ts +110 -0
  102. package/lib/dependencies/graph-visualizer.js +262 -0
  103. package/lib/dependencies/graph-visualizer.js.map +1 -0
  104. package/lib/dependencies/heuristic-inference.d.ts +136 -0
  105. package/lib/dependencies/heuristic-inference.js +430 -0
  106. package/lib/dependencies/heuristic-inference.js.map +1 -0
  107. package/lib/deployment/cycle-source-editor.d.ts +34 -0
  108. package/lib/deployment/cycle-source-editor.js +121 -0
  109. package/lib/deployment/cycle-source-editor.js.map +1 -0
  110. package/lib/deployment/deployment-error-handler.d.ts +38 -0
  111. package/lib/deployment/deployment-error-handler.js +79 -0
  112. package/lib/deployment/deployment-error-handler.js.map +1 -0
  113. package/lib/deployment/deployment-reporter.d.ts +63 -0
  114. package/lib/deployment/deployment-reporter.js +150 -0
  115. package/lib/deployment/deployment-reporter.js.map +1 -0
  116. package/lib/deployment/deployment-state-summary.d.ts +38 -0
  117. package/lib/deployment/deployment-state-summary.js +209 -0
  118. package/lib/deployment/deployment-state-summary.js.map +1 -0
  119. package/lib/deployment/deployment-status-service.d.ts +36 -0
  120. package/lib/deployment/deployment-status-service.js +128 -0
  121. package/lib/deployment/deployment-status-service.js.map +1 -0
  122. package/lib/deployment/deployment-tracker.d.ts +42 -0
  123. package/lib/deployment/deployment-tracker.js +79 -0
  124. package/lib/deployment/deployment-tracker.js.map +1 -0
  125. package/lib/deployment/deployment-validation-service.d.ts +28 -0
  126. package/lib/deployment/deployment-validation-service.js +161 -0
  127. package/lib/deployment/deployment-validation-service.js.map +1 -0
  128. package/lib/deployment/retry-handler.d.ts +37 -0
  129. package/lib/deployment/retry-handler.js +86 -0
  130. package/lib/deployment/retry-handler.js.map +1 -0
  131. package/lib/deployment/sf-cli-integration.d.ts +42 -0
  132. package/lib/deployment/sf-cli-integration.js +105 -0
  133. package/lib/deployment/sf-cli-integration.js.map +1 -0
  134. package/lib/deployment/state-manager.d.ts +61 -0
  135. package/lib/deployment/state-manager.js +83 -0
  136. package/lib/deployment/state-manager.js.map +1 -0
  137. package/lib/deployment/test-executor.d.ts +41 -0
  138. package/lib/deployment/test-executor.js +87 -0
  139. package/lib/deployment/test-executor.js.map +1 -0
  140. package/lib/errors/base-error.d.ts +24 -0
  141. package/lib/errors/base-error.js +66 -0
  142. package/lib/errors/base-error.js.map +1 -0
  143. package/lib/errors/dependency-error.d.ts +37 -0
  144. package/lib/errors/dependency-error.js +76 -0
  145. package/lib/errors/dependency-error.js.map +1 -0
  146. package/lib/errors/deployment-error.d.ts +55 -0
  147. package/lib/errors/deployment-error.js +132 -0
  148. package/lib/errors/deployment-error.js.map +1 -0
  149. package/lib/errors/index.d.ts +45 -0
  150. package/lib/errors/index.js +71 -0
  151. package/lib/errors/index.js.map +1 -0
  152. package/lib/errors/network-error.d.ts +53 -0
  153. package/lib/errors/network-error.js +111 -0
  154. package/lib/errors/network-error.js.map +1 -0
  155. package/lib/errors/parsing-error.d.ts +41 -0
  156. package/lib/errors/parsing-error.js +69 -0
  157. package/lib/errors/parsing-error.js.map +1 -0
  158. package/lib/errors/validation-error-reporter.d.ts +34 -0
  159. package/lib/errors/validation-error-reporter.js +99 -0
  160. package/lib/errors/validation-error-reporter.js.map +1 -0
  161. package/lib/errors/validation-error.d.ts +58 -0
  162. package/lib/errors/validation-error.js +131 -0
  163. package/lib/errors/validation-error.js.map +1 -0
  164. package/lib/index.d.ts +2 -0
  165. package/lib/index.js +2 -0
  166. package/lib/index.js.map +1 -0
  167. package/lib/monitoring/performance-monitor.d.ts +98 -0
  168. package/lib/monitoring/performance-monitor.js +260 -0
  169. package/lib/monitoring/performance-monitor.js.map +1 -0
  170. package/lib/parsers/apex-class-parser.d.ts +47 -0
  171. package/lib/parsers/apex-class-parser.js +368 -0
  172. package/lib/parsers/apex-class-parser.js.map +1 -0
  173. package/lib/parsers/apex-trigger-parser.d.ts +48 -0
  174. package/lib/parsers/apex-trigger-parser.js +229 -0
  175. package/lib/parsers/apex-trigger-parser.js.map +1 -0
  176. package/lib/parsers/aura-parser.d.ts +55 -0
  177. package/lib/parsers/aura-parser.js +229 -0
  178. package/lib/parsers/aura-parser.js.map +1 -0
  179. package/lib/parsers/bot-parser.d.ts +65 -0
  180. package/lib/parsers/bot-parser.js +225 -0
  181. package/lib/parsers/bot-parser.js.map +1 -0
  182. package/lib/parsers/custom-metadata-parser.d.ts +94 -0
  183. package/lib/parsers/custom-metadata-parser.js +199 -0
  184. package/lib/parsers/custom-metadata-parser.js.map +1 -0
  185. package/lib/parsers/custom-object-parser.d.ts +62 -0
  186. package/lib/parsers/custom-object-parser.js +297 -0
  187. package/lib/parsers/custom-object-parser.js.map +1 -0
  188. package/lib/parsers/email-template-parser.d.ts +64 -0
  189. package/lib/parsers/email-template-parser.js +238 -0
  190. package/lib/parsers/email-template-parser.js.map +1 -0
  191. package/lib/parsers/error-resilient-parser.d.ts +110 -0
  192. package/lib/parsers/error-resilient-parser.js +277 -0
  193. package/lib/parsers/error-resilient-parser.js.map +1 -0
  194. package/lib/parsers/flexipage-parser.d.ts +64 -0
  195. package/lib/parsers/flexipage-parser.js +196 -0
  196. package/lib/parsers/flexipage-parser.js.map +1 -0
  197. package/lib/parsers/flow-parser.d.ts +54 -0
  198. package/lib/parsers/flow-parser.js +287 -0
  199. package/lib/parsers/flow-parser.js.map +1 -0
  200. package/lib/parsers/genai-prompt-parser.d.ts +67 -0
  201. package/lib/parsers/genai-prompt-parser.js +160 -0
  202. package/lib/parsers/genai-prompt-parser.js.map +1 -0
  203. package/lib/parsers/layout-parser.d.ts +64 -0
  204. package/lib/parsers/layout-parser.js +267 -0
  205. package/lib/parsers/layout-parser.js.map +1 -0
  206. package/lib/parsers/lwc-parser.d.ts +60 -0
  207. package/lib/parsers/lwc-parser.js +264 -0
  208. package/lib/parsers/lwc-parser.js.map +1 -0
  209. package/lib/parsers/permission-set-parser.d.ts +86 -0
  210. package/lib/parsers/permission-set-parser.js +152 -0
  211. package/lib/parsers/permission-set-parser.js.map +1 -0
  212. package/lib/parsers/profile-parser.d.ts +81 -0
  213. package/lib/parsers/profile-parser.js +141 -0
  214. package/lib/parsers/profile-parser.js.map +1 -0
  215. package/lib/parsers/visualforce-parser.d.ts +47 -0
  216. package/lib/parsers/visualforce-parser.js +180 -0
  217. package/lib/parsers/visualforce-parser.js.map +1 -0
  218. package/lib/provisioning/data-provisioner.d.ts +88 -0
  219. package/lib/provisioning/data-provisioner.js +257 -0
  220. package/lib/provisioning/data-provisioner.js.map +1 -0
  221. package/lib/scanner/custom-structure-scanner.d.ts +66 -0
  222. package/lib/scanner/custom-structure-scanner.js +229 -0
  223. package/lib/scanner/custom-structure-scanner.js.map +1 -0
  224. package/lib/scanner/forceignore-parser.d.ts +69 -0
  225. package/lib/scanner/forceignore-parser.js +195 -0
  226. package/lib/scanner/forceignore-parser.js.map +1 -0
  227. package/lib/scanner/metadata-format-scanner.d.ts +77 -0
  228. package/lib/scanner/metadata-format-scanner.js +282 -0
  229. package/lib/scanner/metadata-format-scanner.js.map +1 -0
  230. package/lib/scanner/monorepo-scanner.d.ts +71 -0
  231. package/lib/scanner/monorepo-scanner.js +225 -0
  232. package/lib/scanner/monorepo-scanner.js.map +1 -0
  233. package/lib/scanner/project-validator.d.ts +55 -0
  234. package/lib/scanner/project-validator.js +235 -0
  235. package/lib/scanner/project-validator.js.map +1 -0
  236. package/lib/scanner/sfdx-project-detector.d.ts +86 -0
  237. package/lib/scanner/sfdx-project-detector.js +240 -0
  238. package/lib/scanner/sfdx-project-detector.js.map +1 -0
  239. package/lib/scanner/structure-validator.d.ts +64 -0
  240. package/lib/scanner/structure-validator.js +296 -0
  241. package/lib/scanner/structure-validator.js.map +1 -0
  242. package/lib/services/metadata-scanner-service.d.ts +64 -0
  243. package/lib/services/metadata-scanner-service.js +651 -0
  244. package/lib/services/metadata-scanner-service.js.map +1 -0
  245. package/lib/types/agentforce.d.ts +157 -0
  246. package/lib/types/agentforce.js +2 -0
  247. package/lib/types/agentforce.js.map +1 -0
  248. package/lib/types/dependency.d.ts +98 -0
  249. package/lib/types/dependency.js +5 -0
  250. package/lib/types/dependency.js.map +1 -0
  251. package/lib/types/deployment-plan.d.ts +81 -0
  252. package/lib/types/deployment-plan.js +6 -0
  253. package/lib/types/deployment-plan.js.map +1 -0
  254. package/lib/types/deployment.d.ts +88 -0
  255. package/lib/types/deployment.js +5 -0
  256. package/lib/types/deployment.js.map +1 -0
  257. package/lib/types/graph.d.ts +35 -0
  258. package/lib/types/graph.js +5 -0
  259. package/lib/types/graph.js.map +1 -0
  260. package/lib/types/index.d.ts +12 -0
  261. package/lib/types/index.js +17 -0
  262. package/lib/types/index.js.map +1 -0
  263. package/lib/types/metadata.d.ts +101 -0
  264. package/lib/types/metadata.js +13 -0
  265. package/lib/types/metadata.js.map +1 -0
  266. package/lib/types/project.d.ts +156 -0
  267. package/lib/types/project.js +56 -0
  268. package/lib/types/project.js.map +1 -0
  269. package/lib/types/salesforce/apex.d.ts +94 -0
  270. package/lib/types/salesforce/apex.js +6 -0
  271. package/lib/types/salesforce/apex.js.map +1 -0
  272. package/lib/types/salesforce/aura.d.ts +150 -0
  273. package/lib/types/salesforce/aura.js +6 -0
  274. package/lib/types/salesforce/aura.js.map +1 -0
  275. package/lib/types/salesforce/bot.d.ts +293 -0
  276. package/lib/types/salesforce/bot.js +6 -0
  277. package/lib/types/salesforce/bot.js.map +1 -0
  278. package/lib/types/salesforce/common.d.ts +15 -0
  279. package/lib/types/salesforce/common.js +5 -0
  280. package/lib/types/salesforce/common.js.map +1 -0
  281. package/lib/types/salesforce/custom-metadata.d.ts +92 -0
  282. package/lib/types/salesforce/custom-metadata.js +6 -0
  283. package/lib/types/salesforce/custom-metadata.js.map +1 -0
  284. package/lib/types/salesforce/email.d.ts +56 -0
  285. package/lib/types/salesforce/email.js +6 -0
  286. package/lib/types/salesforce/email.js.map +1 -0
  287. package/lib/types/salesforce/flexipage.d.ts +149 -0
  288. package/lib/types/salesforce/flexipage.js +6 -0
  289. package/lib/types/salesforce/flexipage.js.map +1 -0
  290. package/lib/types/salesforce/flow.d.ts +516 -0
  291. package/lib/types/salesforce/flow.js +6 -0
  292. package/lib/types/salesforce/flow.js.map +1 -0
  293. package/lib/types/salesforce/genai.d.ts +67 -0
  294. package/lib/types/salesforce/genai.js +6 -0
  295. package/lib/types/salesforce/genai.js.map +1 -0
  296. package/lib/types/salesforce/index.d.ts +27 -0
  297. package/lib/types/salesforce/index.js +43 -0
  298. package/lib/types/salesforce/index.js.map +1 -0
  299. package/lib/types/salesforce/layout.d.ts +236 -0
  300. package/lib/types/salesforce/layout.js +6 -0
  301. package/lib/types/salesforce/layout.js.map +1 -0
  302. package/lib/types/salesforce/lwc.d.ts +123 -0
  303. package/lib/types/salesforce/lwc.js +6 -0
  304. package/lib/types/salesforce/lwc.js.map +1 -0
  305. package/lib/types/salesforce/object.d.ts +427 -0
  306. package/lib/types/salesforce/object.js +6 -0
  307. package/lib/types/salesforce/object.js.map +1 -0
  308. package/lib/types/salesforce/parser-types.d.ts +79 -0
  309. package/lib/types/salesforce/parser-types.js +80 -0
  310. package/lib/types/salesforce/parser-types.js.map +1 -0
  311. package/lib/types/salesforce/permission.d.ts +289 -0
  312. package/lib/types/salesforce/permission.js +6 -0
  313. package/lib/types/salesforce/permission.js.map +1 -0
  314. package/lib/types/salesforce/resource.d.ts +93 -0
  315. package/lib/types/salesforce/resource.js +6 -0
  316. package/lib/types/salesforce/resource.js.map +1 -0
  317. package/lib/types/salesforce/visualforce.d.ts +70 -0
  318. package/lib/types/salesforce/visualforce.js +6 -0
  319. package/lib/types/salesforce/visualforce.js.map +1 -0
  320. package/lib/utils/cache-manager.d.ts +158 -0
  321. package/lib/utils/cache-manager.js +429 -0
  322. package/lib/utils/cache-manager.js.map +1 -0
  323. package/lib/utils/deployment-plan-manager.d.ts +40 -0
  324. package/lib/utils/deployment-plan-manager.js +183 -0
  325. package/lib/utils/deployment-plan-manager.js.map +1 -0
  326. package/lib/utils/error-aggregator.d.ts +117 -0
  327. package/lib/utils/error-aggregator.js +268 -0
  328. package/lib/utils/error-aggregator.js.map +1 -0
  329. package/lib/utils/file-system.d.ts +62 -0
  330. package/lib/utils/file-system.js +167 -0
  331. package/lib/utils/file-system.js.map +1 -0
  332. package/lib/utils/functional.d.ts +52 -0
  333. package/lib/utils/functional.js +61 -0
  334. package/lib/utils/functional.js.map +1 -0
  335. package/lib/utils/graph-algorithms.d.ts +53 -0
  336. package/lib/utils/graph-algorithms.js +177 -0
  337. package/lib/utils/graph-algorithms.js.map +1 -0
  338. package/lib/utils/logger.d.ts +154 -0
  339. package/lib/utils/logger.js +327 -0
  340. package/lib/utils/logger.js.map +1 -0
  341. package/lib/utils/network-handler.d.ts +64 -0
  342. package/lib/utils/network-handler.js +147 -0
  343. package/lib/utils/network-handler.js.map +1 -0
  344. package/lib/utils/performance.d.ts +148 -0
  345. package/lib/utils/performance.js +294 -0
  346. package/lib/utils/performance.js.map +1 -0
  347. package/lib/utils/string.d.ts +197 -0
  348. package/lib/utils/string.js +331 -0
  349. package/lib/utils/string.js.map +1 -0
  350. package/lib/utils/xml.d.ts +97 -0
  351. package/lib/utils/xml.js +227 -0
  352. package/lib/utils/xml.js.map +1 -0
  353. package/lib/validators/xml-metadata-validator.d.ts +106 -0
  354. package/lib/validators/xml-metadata-validator.js +509 -0
  355. package/lib/validators/xml-metadata-validator.js.map +1 -0
  356. package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
  357. package/lib/waves/priority-wave-generator-ai.js +191 -0
  358. package/lib/waves/priority-wave-generator-ai.js.map +1 -0
  359. package/lib/waves/priority-wave-generator.d.ts +47 -0
  360. package/lib/waves/priority-wave-generator.js +88 -0
  361. package/lib/waves/priority-wave-generator.js.map +1 -0
  362. package/lib/waves/test-optimizer.d.ts +155 -0
  363. package/lib/waves/test-optimizer.js +290 -0
  364. package/lib/waves/test-optimizer.js.map +1 -0
  365. package/lib/waves/wave-builder.d.ts +147 -0
  366. package/lib/waves/wave-builder.js +286 -0
  367. package/lib/waves/wave-builder.js.map +1 -0
  368. package/lib/waves/wave-diff-generator.d.ts +17 -0
  369. package/lib/waves/wave-diff-generator.js +6 -0
  370. package/lib/waves/wave-diff-generator.js.map +1 -0
  371. package/lib/waves/wave-executor.d.ts +33 -0
  372. package/lib/waves/wave-executor.js +50 -0
  373. package/lib/waves/wave-executor.js.map +1 -0
  374. package/lib/waves/wave-merger.d.ts +96 -0
  375. package/lib/waves/wave-merger.js +181 -0
  376. package/lib/waves/wave-merger.js.map +1 -0
  377. package/lib/waves/wave-metadata-generator.d.ts +13 -0
  378. package/lib/waves/wave-metadata-generator.js +12 -0
  379. package/lib/waves/wave-metadata-generator.js.map +1 -0
  380. package/lib/waves/wave-splitter.d.ts +154 -0
  381. package/lib/waves/wave-splitter.js +307 -0
  382. package/lib/waves/wave-splitter.js.map +1 -0
  383. package/lib/waves/wave-validator.d.ts +17 -0
  384. package/lib/waves/wave-validator.js +15 -0
  385. package/lib/waves/wave-validator.js.map +1 -0
  386. package/messages/analyze.json +18 -0
  387. package/messages/config.json +29 -0
  388. package/messages/resume.json +9 -0
  389. package/messages/start.json +24 -0
  390. package/messages/status.json +8 -0
  391. package/messages/validate.json +9 -0
  392. package/npm-shrinkwrap.json +25676 -0
  393. package/oclif.lock +11988 -0
  394. package/oclif.manifest.json +589 -0
  395. package/package.json +224 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Test Execution Management - US-087
3
+ * Manages intelligent test execution per wave
4
+ *
5
+ * @ac US-087-AC-1: Run tests only in Apex waves
6
+ * @ac US-087-AC-2: Support RunLocalTests
7
+ * @ac US-087-AC-3: Support RunSpecifiedTests
8
+ * @ac US-087-AC-4: Support NoTestRun (sandbox)
9
+ * @ac US-087-AC-5: Track test results
10
+ * @ac US-087-AC-6: Report coverage
11
+ * @issue #87
12
+ */
13
+ import { getLogger } from '../utils/logger.js';
14
+ const logger = getLogger('TestExecutor');
15
+ /**
16
+ * @ac US-087-AC-1: Run tests only in Apex waves
17
+ * @ac US-087-AC-2: Support RunLocalTests
18
+ * @ac US-087-AC-3: Support RunSpecifiedTests
19
+ * @ac US-087-AC-4: Support NoTestRun (sandbox)
20
+ */
21
+ export class TestExecutor {
22
+ determineTestLevel(wave, isSandbox) {
23
+ // AC-1: Only run tests in Apex waves
24
+ const hasApex = wave.metadata.types.some((type) => type === 'ApexClass' || type === 'ApexTrigger');
25
+ // AC-4: No tests in sandbox
26
+ if (isSandbox) {
27
+ return {
28
+ testLevel: 'NoTestRun',
29
+ tests: [],
30
+ reason: 'Sandbox deployment - tests not required',
31
+ };
32
+ }
33
+ if (!hasApex) {
34
+ return {
35
+ testLevel: 'NoTestRun',
36
+ tests: [],
37
+ reason: 'No Apex code in wave',
38
+ };
39
+ }
40
+ // AC-3: Run specified tests if available
41
+ const apexComponents = wave.components.filter((component) => component.startsWith('ApexClass:') || component.startsWith('ApexTrigger:'));
42
+ if (apexComponents.length > 0 && apexComponents.length <= 10) {
43
+ const tests = this.findRelatedTests(apexComponents);
44
+ if (tests.length > 0) {
45
+ return {
46
+ testLevel: 'RunSpecifiedTests',
47
+ tests,
48
+ reason: `Running ${tests.length} related tests`,
49
+ };
50
+ }
51
+ }
52
+ // AC-2: Default to RunLocalTests
53
+ return {
54
+ testLevel: 'RunLocalTests',
55
+ tests: [],
56
+ reason: 'Running all local tests',
57
+ };
58
+ }
59
+ findRelatedTests(apexComponents) {
60
+ // Placeholder: In real implementation, this would analyze test classes
61
+ // and match them to the components being deployed
62
+ return apexComponents
63
+ .filter((component) => component.startsWith('ApexClass:'))
64
+ .map((component) => component.replace('ApexClass:', '') + 'Test');
65
+ }
66
+ /**
67
+ * @ac US-087-AC-5: Track test results
68
+ * @ac US-087-AC-6: Report coverage
69
+ */
70
+ analyzeTestResults(testsRun, testFailures, coverage) {
71
+ logger.info('Analyzing test results', { testsRun, testFailures, coverage });
72
+ return {
73
+ testsRun,
74
+ testFailures,
75
+ coverage,
76
+ failedTests: [], // Would be populated from actual results
77
+ };
78
+ }
79
+ formatTestResults(results) {
80
+ const lines = [`Tests Run: ${results.testsRun}`, `Failures: ${results.testFailures}`];
81
+ if (results.coverage !== undefined) {
82
+ lines.push(`Coverage: ${results.coverage}%`);
83
+ }
84
+ return lines.join(' | ');
85
+ }
86
+ }
87
+ //# sourceMappingURL=test-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-executor.js","sourceRoot":"","sources":["../../src/deployment/test-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,MAAM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M,EAAE,yBAAyB;SAClC,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,cAAwB;QAC/C,uEAAuE;QACvE,kDAAkD;QAClD,OAAO,cAAc;aAClB,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;aACzD,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,kBAAkB,CAAC,QAAgB,EAAE,YAAoB,EAAE,QAAiB;QACjF,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE5E,OAAO;YACL,QAAQ;YACR,YAAY;YACZ,QAAQ;YACR,WAAW,EAAE,EAAE,EAAE,yCAAyC;SAC3D,CAAC;IACJ,CAAC;IAEM,iBAAiB,CAAC,OAAoB;QAC3C,MAAM,KAAK,GAAG,CAAC,cAAc,OAAO,CAAC,QAAQ,EAAE,EAAE,aAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;QAEtF,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Base custom error class with context and suggestions
3
+ *
4
+ * All plugin errors extend this base class to provide:
5
+ * - Structured error context
6
+ * - Actionable suggestions
7
+ * - JSON serialization
8
+ * - Stack trace preservation
9
+ */
10
+ export declare abstract class SmartDeploymentError extends Error {
11
+ readonly code: string;
12
+ readonly context: Record<string, unknown>;
13
+ readonly suggestions: string[];
14
+ readonly timestamp: Date;
15
+ constructor(message: string, code: string, context?: Record<string, unknown>, suggestions?: string[]);
16
+ /**
17
+ * Serialize error to JSON for logging/reporting
18
+ */
19
+ toJSON(): Record<string, unknown>;
20
+ /**
21
+ * Format error for display to user
22
+ */
23
+ toString(): string;
24
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Base custom error class with context and suggestions
3
+ *
4
+ * All plugin errors extend this base class to provide:
5
+ * - Structured error context
6
+ * - Actionable suggestions
7
+ * - JSON serialization
8
+ * - Stack trace preservation
9
+ */
10
+ export class SmartDeploymentError extends Error {
11
+ code;
12
+ context;
13
+ suggestions;
14
+ timestamp;
15
+ constructor(message, code, context = {}, suggestions = []) {
16
+ super(message);
17
+ // Maintain proper stack trace (V8 engines)
18
+ if (Error.captureStackTrace) {
19
+ Error.captureStackTrace(this, this.constructor);
20
+ }
21
+ this.name = this.constructor.name;
22
+ this.code = code;
23
+ this.context = context;
24
+ this.suggestions = suggestions;
25
+ this.timestamp = new Date();
26
+ // Ensure instanceof works correctly
27
+ Object.setPrototypeOf(this, new.target.prototype);
28
+ }
29
+ /**
30
+ * Serialize error to JSON for logging/reporting
31
+ */
32
+ toJSON() {
33
+ return {
34
+ name: this.name,
35
+ code: this.code,
36
+ message: this.message,
37
+ context: this.context,
38
+ suggestions: this.suggestions,
39
+ timestamp: this.timestamp.toISOString(),
40
+ stack: this.stack,
41
+ };
42
+ }
43
+ /**
44
+ * Format error for display to user
45
+ */
46
+ toString() {
47
+ const lines = [`${this.name} [${this.code}]: ${this.message}`, ''];
48
+ // Add context if present
49
+ if (Object.keys(this.context).length > 0) {
50
+ lines.push('Context:');
51
+ for (const [key, value] of Object.entries(this.context)) {
52
+ lines.push(` ${key}: ${JSON.stringify(value)}`);
53
+ }
54
+ lines.push('');
55
+ }
56
+ // Add suggestions if present
57
+ if (this.suggestions.length > 0) {
58
+ lines.push('Suggestions:');
59
+ for (const suggestion of this.suggestions) {
60
+ lines.push(` • ${suggestion}`);
61
+ }
62
+ }
63
+ return lines.join('\n');
64
+ }
65
+ }
66
+ //# sourceMappingURL=base-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-error.js","sourceRoot":"","sources":["../../src/errors/base-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAgB,oBAAqB,SAAQ,KAAK;IACtC,IAAI,CAAS;IACb,OAAO,CAA0B;IACjC,WAAW,CAAW;IACtB,SAAS,CAAO;IAEhC,YAAmB,OAAe,EAAE,IAAY,EAAE,UAAmC,EAAE,EAAE,cAAwB,EAAE;QACjH,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,2CAA2C;QAC3C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAE5B,oCAAoC;QACpC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YACvC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,MAAM,KAAK,GAAa,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAE7E,yBAAyB;QACzB,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBACxD,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACnD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,6BAA6B;QAC7B,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC3B,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,UAAU,EAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ import { SmartDeploymentError } from './base-error.js';
2
+ /**
3
+ * Error thrown when dependency analysis or resolution fails
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new DependencyError('Circular dependency detected', {
8
+ * cycle: ['ApexClass:A', 'ApexClass:B', 'ApexClass:C', 'ApexClass:A'],
9
+ * affectedComponents: 3
10
+ * });
11
+ * ```
12
+ */
13
+ export declare class DependencyError extends SmartDeploymentError {
14
+ constructor(message: string, context?: Record<string, unknown>);
15
+ }
16
+ /**
17
+ * Error thrown when circular dependencies are detected
18
+ */
19
+ export declare class CircularDependencyError extends DependencyError {
20
+ constructor(cycle: string[], context?: Record<string, unknown>);
21
+ }
22
+ /**
23
+ * Error thrown when a required dependency is missing
24
+ */
25
+ export declare class MissingDependencyError extends DependencyError {
26
+ constructor(component: string, missingDependency: string, context?: Record<string, unknown>);
27
+ }
28
+ /**
29
+ * Error thrown when dependency graph is too complex
30
+ */
31
+ export declare class DependencyComplexityError extends DependencyError {
32
+ constructor(message: string, context?: {
33
+ [key: string]: unknown;
34
+ totalComponents?: number;
35
+ maxDepth?: number;
36
+ });
37
+ }
@@ -0,0 +1,76 @@
1
+ import { SmartDeploymentError } from './base-error.js';
2
+ /**
3
+ * Error thrown when dependency analysis or resolution fails
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new DependencyError('Circular dependency detected', {
8
+ * cycle: ['ApexClass:A', 'ApexClass:B', 'ApexClass:C', 'ApexClass:A'],
9
+ * affectedComponents: 3
10
+ * });
11
+ * ```
12
+ */
13
+ export class DependencyError extends SmartDeploymentError {
14
+ constructor(message, context = {}) {
15
+ const suggestions = [];
16
+ // Add context-specific suggestions
17
+ if (context.cycle) {
18
+ suggestions.push('Break the circular dependency by refactoring shared logic');
19
+ suggestions.push('Consider using dependency injection or interfaces');
20
+ }
21
+ if (context.missingDependency) {
22
+ suggestions.push(`Add missing dependency: ${String(context.missingDependency)}`);
23
+ suggestions.push('Check if the component exists in your project');
24
+ }
25
+ if (context.affectedComponents) {
26
+ suggestions.push(`Review ${String(context.affectedComponents)} affected components`);
27
+ }
28
+ super(message, 'DEPENDENCY_ERROR', context, suggestions);
29
+ }
30
+ }
31
+ /**
32
+ * Error thrown when circular dependencies are detected
33
+ */
34
+ export class CircularDependencyError extends DependencyError {
35
+ constructor(cycle, context = {}) {
36
+ super(`Circular dependency detected: ${cycle.join(' → ')}`, {
37
+ ...context,
38
+ cycle,
39
+ cycleLength: cycle.length,
40
+ });
41
+ this.suggestions.push('Visualize the dependency graph to identify the cycle');
42
+ this.suggestions.push('Extract shared code into a common utility');
43
+ }
44
+ }
45
+ /**
46
+ * Error thrown when a required dependency is missing
47
+ */
48
+ export class MissingDependencyError extends DependencyError {
49
+ constructor(component, missingDependency, context = {}) {
50
+ super(`Component '${component}' depends on missing '${missingDependency}'`, {
51
+ ...context,
52
+ component,
53
+ missingDependency,
54
+ });
55
+ this.suggestions.push(`Include '${missingDependency}' in your deployment`);
56
+ this.suggestions.push('Check if the dependency was deleted or renamed');
57
+ this.suggestions.push('Verify metadata type spelling and casing');
58
+ }
59
+ }
60
+ /**
61
+ * Error thrown when dependency graph is too complex
62
+ */
63
+ export class DependencyComplexityError extends DependencyError {
64
+ constructor(message, context = {}) {
65
+ super(message, context);
66
+ if (context.maxDepth && context.maxDepth > 50) {
67
+ this.suggestions.push('Dependency depth > 50 indicates over-coupling');
68
+ this.suggestions.push('Refactor to reduce dependency chains');
69
+ }
70
+ if (context.totalComponents && context.totalComponents > 10_000) {
71
+ this.suggestions.push('Consider splitting into multiple deployments');
72
+ this.suggestions.push('Use selective deployment for changed components only');
73
+ }
74
+ }
75
+ }
76
+ //# sourceMappingURL=dependency-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-error.js","sourceRoot":"","sources":["../../src/errors/dependency-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACvD,YAAmB,OAAe,EAAE,UAAmC,EAAE;QACvE,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,mCAAmC;QACnC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;YAC9E,WAAW,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,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C,0CAA0C,CAAC,CAAC;IACpE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,eAAe;IAC5D,YACE,OAAe,EACf,UAII,EAAE;QAEN,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,GAAG,EAAE,EAAE,CAAC;YAC9C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YACvE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,GAAG,MAAM,EAAE,CAAC;YAChE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YACtE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,55 @@
1
+ import { SmartDeploymentError } from './base-error.js';
2
+ /**
3
+ * Error thrown when Salesforce deployment fails
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new DeploymentError('Deployment failed due to test failures', {
8
+ * deploymentId: '0Af...',
9
+ * failedTests: ['AccountServiceTest.testInsert'],
10
+ * testCoverage: 68
11
+ * });
12
+ * ```
13
+ */
14
+ export declare class DeploymentError extends SmartDeploymentError {
15
+ constructor(message: string, context?: Record<string, unknown>);
16
+ }
17
+ /**
18
+ * Error thrown when deployment validation fails
19
+ */
20
+ export declare class DeploymentValidationError extends DeploymentError {
21
+ constructor(message: string, context?: Record<string, unknown>);
22
+ }
23
+ /**
24
+ * Error thrown when test execution fails during deployment
25
+ */
26
+ export declare class TestFailureError extends DeploymentError {
27
+ constructor(failedTests: string[], context?: {
28
+ [key: string]: unknown;
29
+ totalTests?: number;
30
+ passedTests?: number;
31
+ testCoverage?: number;
32
+ });
33
+ }
34
+ /**
35
+ * Error thrown when deployment times out
36
+ */
37
+ export declare class DeploymentTimeoutError extends DeploymentError {
38
+ constructor(timeoutMs: number, context?: Record<string, unknown>);
39
+ }
40
+ /**
41
+ * Error thrown when deployment exceeds Salesforce limits
42
+ */
43
+ export declare class DeploymentLimitError extends DeploymentError {
44
+ constructor(limitType: 'files' | 'size' | 'components', limit: number, actual: number, context?: Record<string, unknown>);
45
+ }
46
+ /**
47
+ * Error thrown when Salesforce API returns an error
48
+ */
49
+ export declare class SalesforceApiError extends DeploymentError {
50
+ constructor(apiError: string, context?: {
51
+ [key: string]: unknown;
52
+ statusCode?: number;
53
+ errorCode?: string;
54
+ });
55
+ }
@@ -0,0 +1,132 @@
1
+ import { SmartDeploymentError } from './base-error.js';
2
+ /**
3
+ * Error thrown when Salesforce deployment fails
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new DeploymentError('Deployment failed due to test failures', {
8
+ * deploymentId: '0Af...',
9
+ * failedTests: ['AccountServiceTest.testInsert'],
10
+ * testCoverage: 68
11
+ * });
12
+ * ```
13
+ */
14
+ export class DeploymentError extends SmartDeploymentError {
15
+ constructor(message, context = {}) {
16
+ const suggestions = [];
17
+ // Add context-specific suggestions
18
+ if (context.deploymentId) {
19
+ suggestions.push(`Check deployment status: sf project deploy report -i ${String(context.deploymentId)}`);
20
+ }
21
+ if (context.failedTests) {
22
+ suggestions.push('Review and fix failing test classes');
23
+ suggestions.push('Run tests locally: sf apex run test');
24
+ }
25
+ if (context.testCoverage && typeof context.testCoverage === 'number' && context.testCoverage < 75) {
26
+ suggestions.push('Increase test coverage to at least 75%');
27
+ suggestions.push('Add test methods for untested code paths');
28
+ }
29
+ if (context.componentFailures) {
30
+ suggestions.push('Review component-specific errors in the deployment report');
31
+ }
32
+ super(message, 'DEPLOYMENT_ERROR', context, suggestions);
33
+ }
34
+ }
35
+ /**
36
+ * Error thrown when deployment validation fails
37
+ */
38
+ export class DeploymentValidationError extends DeploymentError {
39
+ constructor(message, context = {}) {
40
+ super(`Deployment validation failed: ${message}`, {
41
+ ...context,
42
+ validationError: true,
43
+ });
44
+ this.suggestions.push('Run validation before deploying: sf project deploy validate');
45
+ this.suggestions.push('Fix validation errors and retry');
46
+ }
47
+ }
48
+ /**
49
+ * Error thrown when test execution fails during deployment
50
+ */
51
+ export class TestFailureError extends DeploymentError {
52
+ constructor(failedTests, context = {}) {
53
+ super(`${failedTests.length} test(s) failed`, {
54
+ ...context,
55
+ failedTests,
56
+ });
57
+ this.suggestions.push('Review failed test methods:');
58
+ for (const test of failedTests.slice(0, 5)) {
59
+ // Show max 5
60
+ this.suggestions.push(` - ${test}`);
61
+ }
62
+ if (failedTests.length > 5) {
63
+ this.suggestions.push(` ... and ${failedTests.length - 5} more`);
64
+ }
65
+ this.suggestions.push('Run failed tests locally to debug');
66
+ }
67
+ }
68
+ /**
69
+ * Error thrown when deployment times out
70
+ */
71
+ export class DeploymentTimeoutError extends DeploymentError {
72
+ constructor(timeoutMs, context = {}) {
73
+ super(`Deployment timed out after ${timeoutMs}ms`, {
74
+ ...context,
75
+ timeoutMs,
76
+ });
77
+ this.suggestions.push('Large deployments may exceed timeout limits');
78
+ this.suggestions.push('Consider splitting into smaller waves');
79
+ this.suggestions.push('Increase timeout if appropriate for your org');
80
+ }
81
+ }
82
+ /**
83
+ * Error thrown when deployment exceeds Salesforce limits
84
+ */
85
+ export class DeploymentLimitError extends DeploymentError {
86
+ constructor(limitType, limit, actual, context = {}) {
87
+ super(`Deployment exceeds ${limitType} limit: ${actual} > ${limit}`, {
88
+ ...context,
89
+ limitType,
90
+ limit,
91
+ actual,
92
+ });
93
+ if (limitType === 'files') {
94
+ this.suggestions.push('Split deployment to stay under 10,000 file limit');
95
+ }
96
+ if (limitType === 'size') {
97
+ this.suggestions.push('Reduce deployment size (max 39MB compressed)');
98
+ this.suggestions.push('Remove unnecessary static resources or large files');
99
+ }
100
+ if (limitType === 'components') {
101
+ this.suggestions.push('Deploy in multiple waves');
102
+ this.suggestions.push('Use smart-deployment wave generation');
103
+ }
104
+ }
105
+ }
106
+ /**
107
+ * Error thrown when Salesforce API returns an error
108
+ */
109
+ export class SalesforceApiError extends DeploymentError {
110
+ constructor(apiError, context = {}) {
111
+ super(`Salesforce API error: ${apiError}`, {
112
+ ...context,
113
+ apiError,
114
+ });
115
+ if (context.statusCode === 401) {
116
+ this.suggestions.push('Authentication failed - check your credentials');
117
+ this.suggestions.push('Run: sf org login web');
118
+ }
119
+ if (context.statusCode === 403) {
120
+ this.suggestions.push('Insufficient permissions - check user permissions');
121
+ }
122
+ if (context.statusCode === 429) {
123
+ this.suggestions.push('API rate limit exceeded - wait and retry');
124
+ this.suggestions.push('Reduce concurrent API calls');
125
+ }
126
+ if (context.statusCode && context.statusCode >= 500) {
127
+ this.suggestions.push('Salesforce server error - retry later');
128
+ this.suggestions.push('Check Salesforce status: https://status.salesforce.com');
129
+ }
130
+ }
131
+ }
132
+ //# sourceMappingURL=deployment-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-error.js","sourceRoot":"","sources":["../../src/errors/deployment-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACvD,YAAmB,OAAe,EAAE,UAAmC,EAAE;QACvE,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,mCAAmC;QACnC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,WAAW,CAAC,IAAI,CAAC,wDAAwD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC3G,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,WAAW,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;YACxD,WAAW,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,OAAO,CAAC,YAAY,IAAI,O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,CAAC,WAAW,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACrD,YACE,QAAgB,EAChB,UAII,EAAE;QAEN,KAAK,CAAC,yBAAyB,QAAQ,EAAE,EAAE;YACzC,GAAG,OAAO;YACV,QAAQ;SACT,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;YACxE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;YAClE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;YAC/D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Custom Error Types for Smart Deployment Plugin
3
+ *
4
+ * All errors extend SmartDeploymentError and provide:
5
+ * - Error codes for programmatic handling
6
+ * - Contextual information about the failure
7
+ * - Actionable suggestions for resolution
8
+ * - JSON serialization for logging
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { ParsingError, DeploymentError } from './errors/index.js';
13
+ *
14
+ * try {
15
+ * await parseXml(file);
16
+ * } catch (error) {
17
+ * throw new ParsingError('Failed to parse XML', {
18
+ * filePath: file,
19
+ * originalError: error.message
20
+ * });
21
+ * }
22
+ * ```
23
+ */
24
+ import { SmartDeploymentError as BaseError } from './base-error.js';
25
+ export { SmartDeploymentError } from './base-error.js';
26
+ export { ParsingError, XmlParsingError, JsonParsingError, ProjectStructureError } from './parsing-error.js';
27
+ export { DependencyError, CircularDependencyError, MissingDependencyError, DependencyComplexityError, } from './dependency-error.js';
28
+ export { DeploymentError, DeploymentValidationError, TestFailureError, DeploymentTimeoutError, DeploymentLimitError, SalesforceApiError, } from './deployment-error.js';
29
+ export { ValidationError, ConfigurationError, ApiVersionError, UnknownMetadataTypeError, ComponentCountError, MissingMetadataError, FileNotFoundError, PermissionError, } from './validation-error.js';
30
+ /**
31
+ * Type guard to check if error is a SmartDeploymentError
32
+ */
33
+ export declare function isSmartDeploymentError(error: unknown): error is BaseError;
34
+ /**
35
+ * Extract error message safely from unknown error
36
+ */
37
+ export declare function getErrorMessage(error: unknown): string;
38
+ /**
39
+ * Extract error context safely
40
+ */
41
+ export declare function getErrorContext(error: unknown): Record<string, unknown>;
42
+ /**
43
+ * Get suggestions from error if available
44
+ */
45
+ export declare function getErrorSuggestions(error: unknown): string[];
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Custom Error Types for Smart Deployment Plugin
3
+ *
4
+ * All errors extend SmartDeploymentError and provide:
5
+ * - Error codes for programmatic handling
6
+ * - Contextual information about the failure
7
+ * - Actionable suggestions for resolution
8
+ * - JSON serialization for logging
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { ParsingError, DeploymentError } from './errors/index.js';
13
+ *
14
+ * try {
15
+ * await parseXml(file);
16
+ * } catch (error) {
17
+ * throw new ParsingError('Failed to parse XML', {
18
+ * filePath: file,
19
+ * originalError: error.message
20
+ * });
21
+ * }
22
+ * ```
23
+ */
24
+ // Base error
25
+ import { SmartDeploymentError as BaseError } from './base-error.js';
26
+ export { SmartDeploymentError } from './base-error.js';
27
+ // Parsing errors
28
+ export { ParsingError, XmlParsingError, JsonParsingError, ProjectStructureError } from './parsing-error.js';
29
+ // Dependency errors
30
+ export { DependencyError, CircularDependencyError, MissingDependencyError, DependencyComplexityError, } from './dependency-error.js';
31
+ // Deployment errors
32
+ export { DeploymentError, DeploymentValidationError, TestFailureError, DeploymentTimeoutError, DeploymentLimitError, SalesforceApiError, } from './deployment-error.js';
33
+ // Validation errors
34
+ export { ValidationError, ConfigurationError, ApiVersionError, UnknownMetadataTypeError, ComponentCountError, MissingMetadataError, FileNotFoundError, PermissionError, } from './validation-error.js';
35
+ /**
36
+ * Type guard to check if error is a SmartDeploymentError
37
+ */
38
+ export function isSmartDeploymentError(error) {
39
+ return error instanceof BaseError;
40
+ }
41
+ /**
42
+ * Extract error message safely from unknown error
43
+ */
44
+ export function getErrorMessage(error) {
45
+ if (error instanceof Error) {
46
+ return error.message;
47
+ }
48
+ if (typeof error === 'string') {
49
+ return error;
50
+ }
51
+ return 'Unknown error occurred';
52
+ }
53
+ /**
54
+ * Extract error context safely
55
+ */
56
+ export function getErrorContext(error) {
57
+ if (isSmartDeploymentError(error)) {
58
+ return error.context;
59
+ }
60
+ return {};
61
+ }
62
+ /**
63
+ * Get suggestions from error if available
64
+ */
65
+ export function getErrorSuggestions(error) {
66
+ if (isSmartDeploymentError(error)) {
67
+ return error.suggestions;
68
+ }
69
+ return [];
70
+ }
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,aAAa;AACb,OAAO,EAAE,oBAAoB,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,iBAAiB;AACjB,OAAO,EAAE,Y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