@jterrats/smart-deployment 1.0.3 → 1.0.4

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 (257) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +6 -0
  3. package/lib/ai/wave-validation-service.d.ts +21 -0
  4. package/lib/ai/wave-validation-service.js +189 -114
  5. package/lib/ai/wave-validation-service.js.map +1 -1
  6. package/lib/analysis/analysis-reporter.d.ts +12 -0
  7. package/lib/analysis/analysis-reporter.js +61 -0
  8. package/lib/analysis/analysis-reporter.js.map +1 -1
  9. package/lib/analysis/analyze-artifact-service.d.ts +25 -0
  10. package/lib/analysis/analyze-artifact-service.js +50 -0
  11. package/lib/analysis/analyze-artifact-service.js.map +1 -0
  12. package/lib/analysis/analyze-context-service.d.ts +25 -0
  13. package/lib/analysis/analyze-context-service.js +28 -0
  14. package/lib/analysis/analyze-context-service.js.map +1 -0
  15. package/lib/analysis/project-analysis-service.d.ts +48 -0
  16. package/lib/analysis/project-analysis-service.js +134 -0
  17. package/lib/analysis/project-analysis-service.js.map +1 -0
  18. package/lib/commands/analyze.d.ts +0 -2
  19. package/lib/commands/analyze.js +31 -162
  20. package/lib/commands/analyze.js.map +1 -1
  21. package/lib/commands/config.d.ts +0 -4
  22. package/lib/commands/config.js +25 -95
  23. package/lib/commands/config.js.map +1 -1
  24. package/lib/commands/resume.js +6 -16
  25. package/lib/commands/resume.js.map +1 -1
  26. package/lib/commands/start.d.ts +0 -11
  27. package/lib/commands/start.js +38 -550
  28. package/lib/commands/start.js.map +1 -1
  29. package/lib/commands/status.js +36 -12
  30. package/lib/commands/status.js.map +1 -1
  31. package/lib/commands/validate.d.ts +3 -0
  32. package/lib/commands/validate.js +5 -7
  33. package/lib/commands/validate.js.map +1 -1
  34. package/lib/config/config-mutation-service.d.ts +21 -0
  35. package/lib/config/config-mutation-service.js +61 -0
  36. package/lib/config/config-mutation-service.js.map +1 -0
  37. package/lib/dependencies/circular-dependency-detector.d.ts +5 -0
  38. package/lib/dependencies/circular-dependency-detector.js +67 -72
  39. package/lib/dependencies/circular-dependency-detector.js.map +1 -1
  40. package/lib/dependencies/dependency-depth-calculator.d.ts +28 -0
  41. package/lib/dependencies/dependency-depth-calculator.js +86 -39
  42. package/lib/dependencies/dependency-depth-calculator.js.map +1 -1
  43. package/lib/dependencies/dependency-graph-builder.d.ts +45 -13
  44. package/lib/dependencies/dependency-graph-builder.js +228 -123
  45. package/lib/dependencies/dependency-graph-builder.js.map +1 -1
  46. package/lib/dependencies/dependency-impact-analyzer.d.ts +13 -0
  47. package/lib/dependencies/dependency-impact-analyzer.js +146 -102
  48. package/lib/dependencies/dependency-impact-analyzer.js.map +1 -1
  49. package/lib/dependencies/dependency-merger.d.ts +10 -0
  50. package/lib/dependencies/dependency-merger.js +123 -61
  51. package/lib/dependencies/dependency-merger.js.map +1 -1
  52. package/lib/dependencies/dependency-resolver.d.ts +34 -9
  53. package/lib/dependencies/dependency-resolver.js +181 -112
  54. package/lib/dependencies/dependency-resolver.js.map +1 -1
  55. package/lib/dependencies/dependency-semantics.d.ts +20 -0
  56. package/lib/dependencies/dependency-semantics.js +55 -0
  57. package/lib/dependencies/dependency-semantics.js.map +1 -0
  58. package/lib/dependencies/graph-visualizer.d.ts +6 -1
  59. package/lib/dependencies/graph-visualizer.js +38 -4
  60. package/lib/dependencies/graph-visualizer.js.map +1 -1
  61. package/lib/dependencies/heuristic-inference.d.ts +2 -53
  62. package/lib/dependencies/heuristic-inference.js +8 -317
  63. package/lib/dependencies/heuristic-inference.js.map +1 -1
  64. package/lib/dependencies/heuristic-patterns.d.ts +14 -0
  65. package/lib/dependencies/heuristic-patterns.js +247 -0
  66. package/lib/dependencies/heuristic-patterns.js.map +1 -0
  67. package/lib/deployment/cycle-remediation-runner.d.ts +36 -0
  68. package/lib/deployment/cycle-remediation-runner.js +262 -0
  69. package/lib/deployment/cycle-remediation-runner.js.map +1 -0
  70. package/lib/deployment/deployment-context-service.d.ts +24 -0
  71. package/lib/deployment/deployment-context-service.js +17 -0
  72. package/lib/deployment/deployment-context-service.js.map +1 -0
  73. package/lib/deployment/deployment-runner.d.ts +37 -0
  74. package/lib/deployment/deployment-runner.js +94 -0
  75. package/lib/deployment/deployment-runner.js.map +1 -0
  76. package/lib/deployment/deployment-status-service.d.ts +5 -0
  77. package/lib/deployment/deployment-status-service.js +39 -18
  78. package/lib/deployment/deployment-status-service.js.map +1 -1
  79. package/lib/deployment/deployment-validation-service.d.ts +5 -2
  80. package/lib/deployment/deployment-validation-service.js +48 -45
  81. package/lib/deployment/deployment-validation-service.js.map +1 -1
  82. package/lib/deployment/resume-deployment-service.d.ts +14 -0
  83. package/lib/deployment/resume-deployment-service.js +25 -0
  84. package/lib/deployment/resume-deployment-service.js.map +1 -0
  85. package/lib/deployment/start-execution-service.d.ts +44 -0
  86. package/lib/deployment/start-execution-service.js +94 -0
  87. package/lib/deployment/start-execution-service.js.map +1 -0
  88. package/lib/deployment/test-executor.d.ts +60 -1
  89. package/lib/deployment/test-executor.js +180 -12
  90. package/lib/deployment/test-executor.js.map +1 -1
  91. package/lib/deployment/test-plan-service.d.ts +8 -0
  92. package/lib/deployment/test-plan-service.js +26 -0
  93. package/lib/deployment/test-plan-service.js.map +1 -0
  94. package/lib/deployment/wave-manifest-service.d.ts +11 -0
  95. package/lib/deployment/wave-manifest-service.js +41 -0
  96. package/lib/deployment/wave-manifest-service.js.map +1 -0
  97. package/lib/parsers/apex-class-parser.js +180 -98
  98. package/lib/parsers/apex-class-parser.js.map +1 -1
  99. package/lib/parsers/apex-trigger-parser.js +56 -7
  100. package/lib/parsers/apex-trigger-parser.js.map +1 -1
  101. package/lib/parsers/aura-parser.js +2 -2
  102. package/lib/parsers/aura-parser.js.map +1 -1
  103. package/lib/parsers/bot-parser.js +31 -4
  104. package/lib/parsers/bot-parser.js.map +1 -1
  105. package/lib/parsers/custom-metadata-parser.js +37 -3
  106. package/lib/parsers/custom-metadata-parser.js.map +1 -1
  107. package/lib/parsers/custom-object-parser.js +284 -150
  108. package/lib/parsers/custom-object-parser.js.map +1 -1
  109. package/lib/parsers/email-template-parser.js +115 -58
  110. package/lib/parsers/email-template-parser.js.map +1 -1
  111. package/lib/parsers/flexipage-parser.js +41 -16
  112. package/lib/parsers/flexipage-parser.js.map +1 -1
  113. package/lib/parsers/flow-parser.js +73 -63
  114. package/lib/parsers/flow-parser.js.map +1 -1
  115. package/lib/parsers/genai-prompt-parser.js +16 -4
  116. package/lib/parsers/genai-prompt-parser.js.map +1 -1
  117. package/lib/parsers/layout-parser.d.ts +11 -0
  118. package/lib/parsers/layout-parser.js +143 -68
  119. package/lib/parsers/layout-parser.js.map +1 -1
  120. package/lib/parsers/lwc-parser.d.ts +0 -9
  121. package/lib/parsers/lwc-parser.js +245 -100
  122. package/lib/parsers/lwc-parser.js.map +1 -1
  123. package/lib/parsers/parser-utils.d.ts +3 -0
  124. package/lib/parsers/parser-utils.js +16 -0
  125. package/lib/parsers/parser-utils.js.map +1 -0
  126. package/lib/parsers/permission-set-parser.d.ts +6 -0
  127. package/lib/parsers/permission-set-parser.js +31 -40
  128. package/lib/parsers/permission-set-parser.js.map +1 -1
  129. package/lib/parsers/profile-parser.d.ts +13 -0
  130. package/lib/parsers/profile-parser.js +39 -34
  131. package/lib/parsers/profile-parser.js.map +1 -1
  132. package/lib/parsers/visualforce-parser.js +2 -1
  133. package/lib/parsers/visualforce-parser.js.map +1 -1
  134. package/lib/presentation/analyze-command-presenter.d.ts +10 -0
  135. package/lib/presentation/analyze-command-presenter.js +30 -0
  136. package/lib/presentation/analyze-command-presenter.js.map +1 -0
  137. package/lib/presentation/config-command-presenter.d.ts +15 -0
  138. package/lib/presentation/config-command-presenter.js +50 -0
  139. package/lib/presentation/config-command-presenter.js.map +1 -0
  140. package/lib/presentation/project-analysis-presenter.d.ts +9 -0
  141. package/lib/presentation/project-analysis-presenter.js +9 -0
  142. package/lib/presentation/project-analysis-presenter.js.map +1 -0
  143. package/lib/presentation/resume-command-presenter.d.ts +7 -0
  144. package/lib/presentation/resume-command-presenter.js +12 -0
  145. package/lib/presentation/resume-command-presenter.js.map +1 -0
  146. package/lib/presentation/start-command-presenter.d.ts +15 -0
  147. package/lib/presentation/start-command-presenter.js +29 -0
  148. package/lib/presentation/start-command-presenter.js.map +1 -0
  149. package/lib/presentation/status-command-presenter.d.ts +7 -0
  150. package/lib/presentation/status-command-presenter.js +16 -0
  151. package/lib/presentation/status-command-presenter.js.map +1 -0
  152. package/lib/presentation/validate-command-presenter.d.ts +9 -0
  153. package/lib/presentation/validate-command-presenter.js +50 -0
  154. package/lib/presentation/validate-command-presenter.js.map +1 -0
  155. package/lib/services/metadata-scanner-service.d.ts +8 -12
  156. package/lib/services/metadata-scanner-service.js +55 -533
  157. package/lib/services/metadata-scanner-service.js.map +1 -1
  158. package/lib/services/scanners/automation-ai-metadata-scanner.d.ts +4 -0
  159. package/lib/services/scanners/automation-ai-metadata-scanner.js +61 -0
  160. package/lib/services/scanners/automation-ai-metadata-scanner.js.map +1 -0
  161. package/lib/services/scanners/code-metadata-scanner.d.ts +23 -0
  162. package/lib/services/scanners/code-metadata-scanner.js +149 -0
  163. package/lib/services/scanners/code-metadata-scanner.js.map +1 -0
  164. package/lib/services/scanners/data-metadata-scanner.d.ts +3 -0
  165. package/lib/services/scanners/data-metadata-scanner.js +82 -0
  166. package/lib/services/scanners/data-metadata-scanner.js.map +1 -0
  167. package/lib/services/scanners/experience-metadata-scanner.d.ts +5 -0
  168. package/lib/services/scanners/experience-metadata-scanner.js +123 -0
  169. package/lib/services/scanners/experience-metadata-scanner.js.map +1 -0
  170. package/lib/services/scanners/scanner-runtime.d.ts +11 -0
  171. package/lib/services/scanners/scanner-runtime.js +115 -0
  172. package/lib/services/scanners/scanner-runtime.js.map +1 -0
  173. package/lib/services/scanners/security-metadata-scanner.d.ts +3 -0
  174. package/lib/services/scanners/security-metadata-scanner.js +71 -0
  175. package/lib/services/scanners/security-metadata-scanner.js.map +1 -0
  176. package/lib/types/dependency.d.ts +11 -1
  177. package/lib/types/metadata.d.ts +17 -0
  178. package/lib/types/salesforce/flow/actions.d.ts +108 -0
  179. package/lib/types/salesforce/flow/actions.js +2 -0
  180. package/lib/types/salesforce/flow/actions.js.map +1 -0
  181. package/lib/types/salesforce/flow/common.d.ts +36 -0
  182. package/lib/types/salesforce/flow/common.js +5 -0
  183. package/lib/types/salesforce/flow/common.js.map +1 -0
  184. package/lib/types/salesforce/flow/metadata.d.ts +37 -0
  185. package/lib/types/salesforce/flow/metadata.js +2 -0
  186. package/lib/types/salesforce/flow/metadata.js.map +1 -0
  187. package/lib/types/salesforce/flow/records.d.ts +38 -0
  188. package/lib/types/salesforce/flow/records.js +2 -0
  189. package/lib/types/salesforce/flow/records.js.map +1 -0
  190. package/lib/types/salesforce/flow/resources.d.ts +44 -0
  191. package/lib/types/salesforce/flow/resources.js +2 -0
  192. package/lib/types/salesforce/flow/resources.js.map +1 -0
  193. package/lib/types/salesforce/flow/screens.d.ts +56 -0
  194. package/lib/types/salesforce/flow/screens.js +2 -0
  195. package/lib/types/salesforce/flow/screens.js.map +1 -0
  196. package/lib/types/salesforce/flow/start.d.ts +24 -0
  197. package/lib/types/salesforce/flow/start.js +2 -0
  198. package/lib/types/salesforce/flow/start.js.map +1 -0
  199. package/lib/types/salesforce/flow.d.ts +9 -514
  200. package/lib/types/salesforce/flow.js +1 -1
  201. package/lib/types/salesforce/object/core.d.ts +68 -0
  202. package/lib/types/salesforce/object/core.js +5 -0
  203. package/lib/types/salesforce/object/core.js.map +1 -0
  204. package/lib/types/salesforce/object/field.d.ts +155 -0
  205. package/lib/types/salesforce/object/field.js +5 -0
  206. package/lib/types/salesforce/object/field.js.map +1 -0
  207. package/lib/types/salesforce/object/filter.d.ts +16 -0
  208. package/lib/types/salesforce/object/filter.js +5 -0
  209. package/lib/types/salesforce/object/filter.js.map +1 -0
  210. package/lib/types/salesforce/object/policy.d.ts +27 -0
  211. package/lib/types/salesforce/object/policy.js +5 -0
  212. package/lib/types/salesforce/object/policy.js.map +1 -0
  213. package/lib/types/salesforce/object/record.d.ts +44 -0
  214. package/lib/types/salesforce/object/record.js +5 -0
  215. package/lib/types/salesforce/object/record.js.map +1 -0
  216. package/lib/types/salesforce/object/view.d.ts +71 -0
  217. package/lib/types/salesforce/object/view.js +5 -0
  218. package/lib/types/salesforce/object/view.js.map +1 -0
  219. package/lib/types/salesforce/object/weblink.d.ts +70 -0
  220. package/lib/types/salesforce/object/weblink.js +5 -0
  221. package/lib/types/salesforce/object/weblink.js.map +1 -0
  222. package/lib/types/salesforce/object.d.ts +7 -423
  223. package/lib/types/salesforce/object.js +7 -1
  224. package/lib/types/salesforce/object.js.map +1 -1
  225. package/lib/utils/cache-manager.d.ts +16 -15
  226. package/lib/utils/cache-manager.js +290 -188
  227. package/lib/utils/cache-manager.js.map +1 -1
  228. package/lib/utils/logger.d.ts +8 -0
  229. package/lib/utils/logger.js +82 -69
  230. package/lib/utils/logger.js.map +1 -1
  231. package/lib/validators/xml/xml-reference-rules.d.ts +3 -0
  232. package/lib/validators/xml/xml-reference-rules.js +173 -0
  233. package/lib/validators/xml/xml-reference-rules.js.map +1 -0
  234. package/lib/validators/xml/xml-report-formatter.d.ts +2 -0
  235. package/lib/validators/xml/xml-report-formatter.js +47 -0
  236. package/lib/validators/xml/xml-report-formatter.js.map +1 -0
  237. package/lib/validators/xml/xml-schema-rules.d.ts +3 -0
  238. package/lib/validators/xml/xml-schema-rules.js +75 -0
  239. package/lib/validators/xml/xml-schema-rules.js.map +1 -0
  240. package/lib/validators/xml/xml-validation-types.d.ts +25 -0
  241. package/lib/validators/xml/xml-validation-types.js +2 -0
  242. package/lib/validators/xml/xml-validation-types.js.map +1 -0
  243. package/lib/validators/xml-metadata-validator.d.ts +2 -63
  244. package/lib/validators/xml-metadata-validator.js +7 -338
  245. package/lib/validators/xml-metadata-validator.js.map +1 -1
  246. package/lib/waves/test-optimizer.d.ts +13 -0
  247. package/lib/waves/test-optimizer.js +124 -63
  248. package/lib/waves/test-optimizer.js.map +1 -1
  249. package/lib/waves/wave-builder.d.ts +17 -21
  250. package/lib/waves/wave-builder.js +199 -135
  251. package/lib/waves/wave-builder.js.map +1 -1
  252. package/lib/waves/wave-splitter.d.ts +12 -8
  253. package/lib/waves/wave-splitter.js +156 -115
  254. package/lib/waves/wave-splitter.js.map +1 -1
  255. package/npm-shrinkwrap.json +2 -2
  256. package/oclif.manifest.json +1 -1
  257. package/package.json +1 -1
@@ -0,0 +1,115 @@
1
+ import * as fs from 'node:fs/promises';
2
+ import { glob as globAsync } from 'glob';
3
+ import { getLogger } from '../../utils/logger.js';
4
+ const logger = getLogger('ScannerRuntime');
5
+ function isDefined(value) {
6
+ return value !== undefined;
7
+ }
8
+ export async function fileExists(filePath) {
9
+ try {
10
+ await fs.access(filePath);
11
+ return true;
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ export async function findFiles(rootPath, pattern) {
18
+ return globAsync(pattern, {
19
+ cwd: rootPath,
20
+ absolute: true,
21
+ posix: false,
22
+ windowsPathsNoEscape: true,
23
+ ignore: ['**/node_modules/**', '**/.git/**'],
24
+ });
25
+ }
26
+ export async function findDirectories(rootPath, pattern) {
27
+ const allMatches = await globAsync(pattern, {
28
+ cwd: rootPath,
29
+ absolute: true,
30
+ posix: false,
31
+ windowsPathsNoEscape: true,
32
+ ignore: ['**/node_modules/**', '**/.git/**'],
33
+ });
34
+ const directoryMatches = await Promise.all(allMatches.map(async (match) => {
35
+ try {
36
+ const stat = await fs.stat(match);
37
+ return stat.isDirectory() ? match : undefined;
38
+ }
39
+ catch {
40
+ return undefined;
41
+ }
42
+ }));
43
+ return directoryMatches.filter(isDefined);
44
+ }
45
+ export function buildScannerError(entityLabel, location, error) {
46
+ return `Failed to parse ${entityLabel} ${location}: ${error instanceof Error ? error.message : String(error)}`;
47
+ }
48
+ export function createScannerContext(errors, shouldIgnore) {
49
+ return {
50
+ fileExists,
51
+ shouldIgnore,
52
+ readFile: fs.readFile,
53
+ errors,
54
+ };
55
+ }
56
+ export async function scanMetadataFiles(packagePath, pattern, errors, entityLabel, shouldIgnore, parser) {
57
+ const files = await findFiles(packagePath, pattern);
58
+ const components = await Promise.all(files
59
+ .filter((filePath) => !shouldIgnore(filePath))
60
+ .map(async (filePath) => {
61
+ try {
62
+ return await parser(filePath);
63
+ }
64
+ catch (error) {
65
+ const errorMsg = buildScannerError(entityLabel, filePath, error);
66
+ logger.warn(errorMsg);
67
+ errors.push(errorMsg);
68
+ return undefined;
69
+ }
70
+ }));
71
+ return components.filter(isDefined);
72
+ }
73
+ export async function scanMetadataDirectories(packagePath, pattern, errors, entityLabel, shouldIgnore, parser, formatPathForError = (directoryPath) => directoryPath) {
74
+ const directories = await findDirectories(packagePath, pattern);
75
+ const components = await Promise.all(directories
76
+ .filter((directoryPath) => !shouldIgnore(directoryPath))
77
+ .map(async (directoryPath) => {
78
+ try {
79
+ const parsed = await parser(directoryPath);
80
+ if (parsed === undefined) {
81
+ return [];
82
+ }
83
+ return Array.isArray(parsed) ? parsed : [parsed];
84
+ }
85
+ catch (error) {
86
+ const errorMsg = buildScannerError(entityLabel, formatPathForError(directoryPath), error);
87
+ logger.warn(errorMsg);
88
+ errors.push(errorMsg);
89
+ return [];
90
+ }
91
+ }));
92
+ return components.flat();
93
+ }
94
+ export async function scanRegisteredFileMetadata(packagePath, errors, shouldIgnore, scanners) {
95
+ const context = createScannerContext(errors, shouldIgnore);
96
+ const components = await Promise.all(scanners.flatMap(async (scanner) => {
97
+ const files = await findFiles(packagePath, scanner.pattern);
98
+ return Promise.all(files
99
+ .filter((filePath) => !shouldIgnore(filePath))
100
+ .filter((filePath) => scanner.shouldInclude?.(filePath) ?? true)
101
+ .map((filePath) => scanner.parse(filePath, context)));
102
+ }));
103
+ return components.flat().filter(isDefined);
104
+ }
105
+ export async function scanRegisteredDirectoryMetadata(packagePath, errors, shouldIgnore, scanners) {
106
+ const context = createScannerContext(errors, shouldIgnore);
107
+ const components = await Promise.all(scanners.flatMap(async (scanner) => {
108
+ const directories = await findDirectories(packagePath, scanner.pattern);
109
+ return Promise.all(directories
110
+ .filter((directoryPath) => !shouldIgnore(directoryPath))
111
+ .map((directoryPath) => scanner.parse(directoryPath, context)));
112
+ }));
113
+ return components.flat().filter(isDefined);
114
+ }
115
+ //# sourceMappingURL=scanner-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanner-runtime.js","sourceRoot":"","sources":["../../../src/services/scanners/scanner-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE3C,SAAS,SAAS,CAAI,KAAoB;IACxC,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IAC/D,OAAO,SAAS,CAAC,OAAO,EAAE;QACxB,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,KAAK;QACZ,oBAAoB,EAAE,IAAI;QAC1B,MAAM,EAAE,CAAC,oBAAoB,EAAE,YAAY,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,OAAe;IACrE,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE;QAC1C,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7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,WAAmB,EACnB,MAAgB,EAChB,YAAgD,EAChD,QAA4B;IAE5B,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAClC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACjC,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACxE,OAAO,OAAO,CAAC,GAAG,CAChB,WAAW;aACR,MAAM,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;aACvD,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CACjE,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { MetadataComponent } from '../../types/metadata.js';
2
+ export declare function parseProfileComponent(filePath: string): Promise<MetadataComponent | undefined>;
3
+ export declare function parsePermissionSetComponent(filePath: string): Promise<MetadataComponent | undefined>;
@@ -0,0 +1,71 @@
1
+ import * as path from 'node:path';
2
+ import { parsePermissionSet } from '../../parsers/permission-set-parser.js';
3
+ import { parseProfile } from '../../parsers/profile-parser.js';
4
+ function addAll(target, values, defaultType) {
5
+ for (const value of values) {
6
+ target.add(defaultType && !value.includes(':') ? `${defaultType}:${value}` : value);
7
+ }
8
+ }
9
+ export async function parseProfileComponent(filePath) {
10
+ const profileName = path.basename(filePath, '.profile-meta.xml');
11
+ const parsed = await parseProfile(filePath, profileName);
12
+ const deps = new Set();
13
+ const optionalDependencies = new Set();
14
+ addAll(deps, parsed.dependencies.objects);
15
+ addAll(deps, parsed.dependencies.fields);
16
+ addAll(deps, parsed.dependencies.apexClasses, 'ApexClass');
17
+ addAll(deps, parsed.dependencies.layouts, 'Layout');
18
+ addAll(deps, parsed.dependencies.visualforcePages, 'VisualforcePage');
19
+ addAll(deps, parsed.dependencies.recordTypes, 'RecordType');
20
+ addAll(deps, parsed.dependencies.applications, 'LightningApp');
21
+ addAll(deps, parsed.dependencies.tabs);
22
+ addAll(deps, parsed.dependencies.customPermissions, 'CustomPermission');
23
+ addAll(deps, parsed.dependencies.customMetadataTypes, 'CustomMetadata');
24
+ addAll(deps, parsed.dependencies.flows, 'Flow');
25
+ addAll(deps, parsed.dependencies.externalDataSources);
26
+ addAll(deps, parsed.dependencies.customSettings);
27
+ addAll(optionalDependencies, parsed.optionalDependencies.layouts, 'Layout');
28
+ addAll(optionalDependencies, parsed.optionalDependencies.visualforcePages, 'VisualforcePage');
29
+ addAll(optionalDependencies, parsed.optionalDependencies.applications, 'LightningApp');
30
+ addAll(optionalDependencies, parsed.optionalDependencies.tabs);
31
+ return {
32
+ name: profileName,
33
+ type: 'Profile',
34
+ filePath,
35
+ dependencies: deps,
36
+ optionalDependencies,
37
+ dependents: new Set(),
38
+ priorityBoost: 0,
39
+ };
40
+ }
41
+ export async function parsePermissionSetComponent(filePath) {
42
+ const permSetName = path.basename(filePath, '.permissionset-meta.xml');
43
+ const parsed = await parsePermissionSet(filePath, permSetName);
44
+ const deps = new Set();
45
+ const optionalDependencies = new Set();
46
+ addAll(deps, parsed.dependencies.objects);
47
+ addAll(deps, parsed.dependencies.fields);
48
+ addAll(deps, parsed.dependencies.apexClasses, 'ApexClass');
49
+ addAll(deps, parsed.dependencies.visualforcePages, 'VisualforcePage');
50
+ addAll(deps, parsed.dependencies.customPermissions, 'CustomPermission');
51
+ addAll(deps, parsed.dependencies.applications, 'LightningApp');
52
+ addAll(deps, parsed.dependencies.tabs);
53
+ addAll(deps, parsed.dependencies.customMetadataTypes, 'CustomMetadata');
54
+ addAll(deps, parsed.dependencies.flows, 'Flow');
55
+ addAll(deps, parsed.dependencies.externalDataSources);
56
+ addAll(deps, parsed.dependencies.customSettings);
57
+ addAll(deps, parsed.dependencies.recordTypes, 'RecordType');
58
+ addAll(optionalDependencies, parsed.optionalDependencies.visualforcePages, 'VisualforcePage');
59
+ addAll(optionalDependencies, parsed.optionalDependencies.applications, 'LightningApp');
60
+ addAll(optionalDependencies, parsed.optionalDependencies.tabs);
61
+ return {
62
+ name: permSetName,
63
+ type: 'PermissionSet',
64
+ filePath,
65
+ dependencies: deps,
66
+ optionalDependencies,
67
+ dependents: new Set(),
68
+ priorityBoost: 0,
69
+ };
70
+ }
71
+ //# sourceMappingURL=security-metadata-scanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-metadata-scanner.js","sourceRoot":"","sources":["../../../src/services/scanners/security-metadata-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG/D,SAAS,MAAM,CAAC,MAAmB,EAAE,MAAwB,EAAE,WAAoB;IACjF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,QAAgB;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAEzD,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,YAAY,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;IACxE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAC5D,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC9F,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACvF,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE/D,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,eAAwB;QAC9B,QAAQ;QACR,YAAY,EAAE,IAAI;QAClB,oBAAoB;QACpB,UAAU,EAAE,IAAI,GAAG,EAAU;QAC7B,aAAa,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Dependency Graph Type Definitions
3
3
  */
4
- import { type MetadataComponent } from './metadata.js';
4
+ import { type MetadataComponent, type MetadataDependencyKind } from './metadata.js';
5
5
  /**
6
6
  * Nodo en el grafo de dependencias
7
7
  */
@@ -21,6 +21,14 @@ export type DependencyGraph = Map<NodeId, Set<NodeId>>;
21
21
  * Map<to, Set<from>>
22
22
  */
23
23
  export type ReverseGraph = Map<NodeId, Set<NodeId>>;
24
+ export type DependencyEdge = {
25
+ from: NodeId;
26
+ to: NodeId;
27
+ type: MetadataDependencyKind;
28
+ source?: 'parser' | 'ai' | 'manual' | 'merged';
29
+ reason?: string;
30
+ confidence?: number;
31
+ };
24
32
  /**
25
33
  * Resultado del análisis de dependencias
26
34
  */
@@ -31,6 +39,8 @@ export type DependencyAnalysisResult = {
31
39
  graph: DependencyGraph;
32
40
  /** Grafo inverso (B ← A significa "B es dependido por A") */
33
41
  reverseGraph: ReverseGraph;
42
+ /** Edges enriquecidos con tipo/razón/confianza */
43
+ edges: DependencyEdge[];
34
44
  /** Componentes con dependencias circulares */
35
45
  circularDependencies: CircularDependency[];
36
46
  /** Componentes aislados (sin dependencias ni dependientes) */
@@ -10,6 +10,19 @@
10
10
  * @see https://developer.salesforce.com/docs/metadata-coverage/61
11
11
  */
12
12
  export type MetadataType = 'GlobalValueSet' | 'StandardValueSet' | 'CustomLabels' | 'Translations' | 'StandardValueSetTranslation' | 'CustomObject' | 'CustomSetting' | 'DataCategoryGroup' | 'CustomMetadata' | 'CustomMetadataRecord' | 'CustomField' | 'ObjectTranslation' | 'RecordType' | 'BusinessProcess' | 'ValidationRule' | 'WorkflowRule' | 'OrgSettings' | 'CorsWhitelistOrigin' | 'CspTrustedSite' | 'Role' | 'DelegateGroup' | 'Group' | 'CustomPermission' | 'ExternalCredential' | 'NamedCredential' | 'DataSourceObject' | 'StaticResource' | 'Document' | 'ContentAsset' | 'EmailTemplate' | 'ApexClass' | 'VisualforceComponent' | 'VisualforcePage' | 'LightningComponentBundle' | 'AuraDefinitionBundle' | 'ApexTrigger' | 'ServicePresenceStatus' | 'PresenceUserConfig' | 'Queue' | 'ServiceChannel' | 'QueueRoutingConfig' | 'ChannelLayout' | 'MilestoneType' | 'EntitlementProcess' | 'GenAiFunction' | 'GenAiPromptTemplate' | 'GenAiPlannerBundle' | 'Flow' | 'PathAssistant' | 'Layout' | 'Bot' | 'BotVersion' | 'GenAiPlugin' | 'FlexiPage' | 'QuickAction' | 'CompactLayout' | 'ListView' | 'WebLink' | 'LightningApp' | 'SearchCustomization' | 'CustomNotificationType' | 'BrandingSet' | 'DigitalExperienceConfig' | 'Site' | 'DigitalExperience' | 'NetworkBranding' | 'Network' | 'EmbeddedServiceConfig' | 'MessagingChannel' | 'OmniSupervisorConfig' | 'SharingRules' | 'PermissionSet' | 'MutingPermissionSet' | 'PermissionSetGroup' | 'Profile' | 'ApexTestSuite' | 'DataPackageKitDefinition' | 'DataPackageKitObject';
13
+ export type MetadataDependencyKind = 'hard' | 'soft' | 'inferred';
14
+ export type MetadataDependencyReference = {
15
+ /** Target node ID in the graph, e.g. Type:Name */
16
+ nodeId: string;
17
+ /** Relationship strength */
18
+ kind: MetadataDependencyKind;
19
+ /** Provenance of the dependency */
20
+ source?: 'parser' | 'ai' | 'manual' | 'merged';
21
+ /** Optional explanation */
22
+ reason?: string;
23
+ /** Optional confidence for inferred dependencies */
24
+ confidence?: number;
25
+ };
13
26
  /**
14
27
  * Base interface for all metadata components
15
28
  */
@@ -22,6 +35,10 @@ export type MetadataComponent = {
22
35
  filePath: string;
23
36
  /** Set of dependencies (node IDs: "Type:Name") */
24
37
  dependencies: Set<string>;
38
+ /** Structured dependency metadata preserving strength/source */
39
+ dependencyDetails?: MetadataDependencyReference[];
40
+ /** Set of optional/soft dependencies (subset of dependencies) */
41
+ optionalDependencies?: Set<string>;
25
42
  /** Set of dependents (node IDs) */
26
43
  dependents: Set<string>;
27
44
  /** Priority boost for heuristics (negative = deploy earlier) */
@@ -0,0 +1,108 @@
1
+ import type { FlowCondition, FlowConnector, FlowElementReferenceOrValue, FlowNode } from './common.js';
2
+ export type FlowActionType = 'apex' | 'emailAlert' | 'quickAction' | 'submit' | 'thanks' | 'chatterPost' | 'component' | 'contentWorkspaceEnableFolders' | 'customNotificationAction' | 'emailSimple' | 'externalService';
3
+ export type FlowActionCallInputParameter = {
4
+ name: string;
5
+ value: FlowElementReferenceOrValue;
6
+ };
7
+ export type FlowActionCallOutputParameter = {
8
+ assignToReference: string;
9
+ name: string;
10
+ };
11
+ export type FlowActionCall = FlowNode & {
12
+ actionName: string;
13
+ actionType: FlowActionType;
14
+ inputParameters?: FlowActionCallInputParameter[];
15
+ outputParameters?: FlowActionCallOutputParameter[];
16
+ storeOutputAutomatically?: boolean;
17
+ };
18
+ export type FlowApexPluginCallInputParameter = {
19
+ name: string;
20
+ value: FlowElementReferenceOrValue;
21
+ };
22
+ export type FlowApexPluginCallOutputParameter = {
23
+ assignToReference: string;
24
+ name: string;
25
+ };
26
+ export type FlowApexPluginCall = FlowNode & {
27
+ apexClass: string;
28
+ inputParameters?: FlowApexPluginCallInputParameter[];
29
+ outputParameters?: FlowApexPluginCallOutputParameter[];
30
+ };
31
+ export type FlowAssignmentOperator = 'Assign' | 'Add' | 'Subtract' | 'AddItem' | 'RemoveFirst' | 'RemoveBeforeFirst' | 'RemoveAfterFirst' | 'RemoveAll';
32
+ export type FlowAssignmentItem = {
33
+ assignToReference: string;
34
+ operator: FlowAssignmentOperator;
35
+ value: FlowElementReferenceOrValue;
36
+ };
37
+ export type FlowAssignment = FlowNode & {
38
+ assignmentItems: FlowAssignmentItem[];
39
+ };
40
+ export type FlowRule = {
41
+ name: string;
42
+ conditionLogic?: string;
43
+ conditions: FlowCondition[];
44
+ connector?: FlowConnector;
45
+ label: string;
46
+ };
47
+ export type FlowDecision = FlowNode & {
48
+ defaultConnector?: FlowConnector;
49
+ defaultConnectorLabel?: string;
50
+ rules: FlowRule[];
51
+ };
52
+ export type FlowIterationOrder = 'Asc' | 'Desc';
53
+ export type FlowLoop = FlowNode & {
54
+ collectionReference: string;
55
+ iterationOrder?: FlowIterationOrder;
56
+ nextValueConnector?: FlowConnector;
57
+ noMoreValuesConnector?: FlowConnector;
58
+ };
59
+ export type FlowSubflowInputAssignment = {
60
+ name: string;
61
+ value: FlowElementReferenceOrValue;
62
+ };
63
+ export type FlowSubflowOutputAssignment = {
64
+ assignToReference: string;
65
+ name: string;
66
+ };
67
+ export type FlowSubflow = FlowNode & {
68
+ flowName: string;
69
+ inputAssignments?: FlowSubflowInputAssignment[];
70
+ outputAssignments?: FlowSubflowOutputAssignment[];
71
+ storeOutputAutomatically?: boolean;
72
+ };
73
+ export type FlowTransformInputParameter = {
74
+ name: string;
75
+ value: FlowElementReferenceOrValue;
76
+ };
77
+ export type FlowTransformOutputParameter = {
78
+ assignToReference: string;
79
+ name: string;
80
+ };
81
+ export type FlowTransform = FlowNode & {
82
+ apexClass: string;
83
+ inputParameters?: FlowTransformInputParameter[];
84
+ outputParameters?: FlowTransformOutputParameter[];
85
+ };
86
+ export type FlowWaitEventInputParameter = {
87
+ name: string;
88
+ value: FlowElementReferenceOrValue;
89
+ };
90
+ export type FlowWaitEventOutputParameter = {
91
+ assignToReference: string;
92
+ name: string;
93
+ };
94
+ export type FlowWaitEvent = {
95
+ name: string;
96
+ label: string;
97
+ conditionLogic?: string;
98
+ conditions: FlowCondition[];
99
+ connector?: FlowConnector;
100
+ eventType: string;
101
+ inputParameters?: FlowWaitEventInputParameter[];
102
+ outputParameters?: FlowWaitEventOutputParameter[];
103
+ };
104
+ export type FlowWait = FlowNode & {
105
+ waitEvents: FlowWaitEvent[];
106
+ defaultConnector?: FlowConnector;
107
+ defaultConnectorLabel?: string;
108
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/actions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shared Flow type definitions used across Flow metadata subdomains.
3
+ */
4
+ export type FlowProcessType = 'AutoLaunchedFlow' | 'Flow' | 'Workflow' | 'CustomEvent' | 'InvocableProcess' | 'LoginFlow' | 'ActionPlan' | 'JourneyBuilderIntegration' | 'UserProvisioningFlow' | 'Survey' | 'SurveyEnrich' | 'Appointments' | 'FSCLending' | 'DigitalForm' | 'FieldServiceMobile' | 'OrchestrationFlow' | 'FieldServiceWeb' | 'TransactionSecurityFlow' | 'ContactRequestFlow' | 'ActionCadenceFlow' | 'ManagedContentFlow' | 'CheckoutFlow' | 'CartAsyncFlow' | 'SalesEntryExperienceFlow' | 'CustomerLifecycle' | 'Journey' | 'RecommendationStrategy' | 'Orchestrator' | 'RoutingFlow' | 'ServiceCatalogItemFlow' | 'EvaluationFlow' | 'ActionCadenceAutolaunchedFlow' | 'ActionCadenceStepFlow' | 'IndividualObjectLinkingFlow';
5
+ export type FlowStatus = 'Active' | 'Draft' | 'Obsolete' | 'InvalidDraft';
6
+ export type FlowElementReferenceOrValue = {
7
+ stringValue?: string;
8
+ numberValue?: number;
9
+ booleanValue?: boolean;
10
+ dateValue?: string;
11
+ dateTimeValue?: string;
12
+ elementReference?: string;
13
+ };
14
+ export type FlowMetadataValue = {
15
+ name: string;
16
+ value: FlowElementReferenceOrValue;
17
+ };
18
+ export type FlowConnector = {
19
+ targetReference: string;
20
+ };
21
+ export type FlowNode = {
22
+ name: string;
23
+ label?: string;
24
+ locationX: number;
25
+ locationY: number;
26
+ connector?: FlowConnector;
27
+ faultConnector?: FlowConnector;
28
+ };
29
+ export type FlowComparisonOperator = 'EqualTo' | 'NotEqualTo' | 'GreaterThan' | 'LessThan' | 'GreaterThanOrEqualTo' | 'LessThanOrEqualTo' | 'StartsWith' | 'EndsWith' | 'Contains' | 'IsNull' | 'IsChanged' | 'WasSelected' | 'WasSet';
30
+ export type FlowCondition = {
31
+ leftValueReference: string;
32
+ operator: FlowComparisonOperator;
33
+ rightValue?: FlowElementReferenceOrValue;
34
+ };
35
+ export type FlowDataType = 'Boolean' | 'Currency' | 'Date' | 'DateTime' | 'Number' | 'String' | 'Picklist' | 'MultiPicklist' | 'SObject' | 'Apex';
36
+ export type FlowSortOrder = 'Asc' | 'Desc';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared Flow type definitions used across Flow metadata subdomains.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/common.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,37 @@
1
+ import type { FlowCondition, FlowComparisonOperator, FlowConnector, FlowDataType, FlowElementReferenceOrValue, FlowMetadataValue, FlowNode, FlowProcessType, FlowSortOrder, FlowStatus } from './common.js';
2
+ import type { FlowActionCall, FlowActionCallInputParameter, FlowActionCallOutputParameter, FlowActionType, FlowApexPluginCall, FlowApexPluginCallInputParameter, FlowApexPluginCallOutputParameter, FlowAssignment, FlowAssignmentItem, FlowAssignmentOperator, FlowDecision, FlowIterationOrder, FlowLoop, FlowRule, FlowSubflow, FlowSubflowInputAssignment, FlowSubflowOutputAssignment, FlowTransform, FlowTransformInputParameter, FlowTransformOutputParameter, FlowWait, FlowWaitEvent, FlowWaitEventInputParameter, FlowWaitEventOutputParameter } from './actions.js';
3
+ import type { FlowInputFieldAssignment, FlowOutputFieldAssignment, FlowRecordCreate, FlowRecordDelete, FlowRecordLookup, FlowRecordUpdate } from './records.js';
4
+ import type { FlowConstant, FlowDynamicChoiceSet, FlowFormula, FlowStage, FlowTextTemplate, FlowVariable } from './resources.js';
5
+ import type { FlowInputValidationRule, FlowScreen, FlowScreenField, FlowScreenFieldInputParameter, FlowScreenFieldOutputParameter, FlowScreenFieldType, FlowScreenRule, FlowScreenRuleAction, FlowVisibilityRule } from './screens.js';
6
+ import type { FlowRecordFilter, FlowRecordTriggerType, FlowSchedule, FlowScheduleFrequency, FlowStart, FlowTriggerType } from './start.js';
7
+ export type FlowMetadata = {
8
+ apiVersion?: string;
9
+ description?: string;
10
+ label: string;
11
+ processType: FlowProcessType;
12
+ status: FlowStatus;
13
+ interviewLabel?: string;
14
+ isTemplate?: boolean;
15
+ processMetadataValues?: FlowMetadataValue[];
16
+ start?: FlowStart;
17
+ actionCalls?: FlowActionCall[];
18
+ apexPluginCalls?: FlowApexPluginCall[];
19
+ assignments?: FlowAssignment[];
20
+ decisions?: FlowDecision[];
21
+ loops?: FlowLoop[];
22
+ recordCreates?: FlowRecordCreate[];
23
+ recordDeletes?: FlowRecordDelete[];
24
+ recordLookups?: FlowRecordLookup[];
25
+ recordUpdates?: FlowRecordUpdate[];
26
+ screens?: FlowScreen[];
27
+ subflows?: FlowSubflow[];
28
+ variables?: FlowVariable[];
29
+ constants?: FlowConstant[];
30
+ formulas?: FlowFormula[];
31
+ dynamicChoiceSets?: FlowDynamicChoiceSet[];
32
+ textTemplates?: FlowTextTemplate[];
33
+ stages?: FlowStage[];
34
+ transforms?: FlowTransform[];
35
+ waits?: FlowWait[];
36
+ };
37
+ export type { FlowActionCall, FlowActionCallInputParameter, FlowActionCallOutputParameter, FlowActionType, FlowApexPluginCall, FlowApexPluginCallInputParameter, FlowApexPluginCallOutputParameter, FlowAssignment, FlowAssignmentItem, FlowAssignmentOperator, FlowComparisonOperator, FlowCondition, FlowConnector, FlowConstant, FlowDataType, FlowDecision, FlowDynamicChoiceSet, FlowElementReferenceOrValue, FlowFormula, FlowInputFieldAssignment, FlowInputValidationRule, FlowIterationOrder, FlowLoop, FlowMetadataValue, FlowNode, FlowOutputFieldAssignment, FlowProcessType, FlowRecordCreate, FlowRecordDelete, FlowRecordFilter, FlowRecordLookup, FlowRecordTriggerType, FlowRecordUpdate, FlowRule, FlowSchedule, FlowScheduleFrequency, FlowScreen, FlowScreenField, FlowScreenFieldInputParameter, FlowScreenFieldOutputParameter, FlowScreenFieldType, FlowScreenRule, FlowScreenRuleAction, FlowSortOrder, FlowStage, FlowStart, FlowStatus, FlowSubflow, FlowSubflowInputAssignment, FlowSubflowOutputAssignment, FlowTextTemplate, FlowTransform, FlowTransformInputParameter, FlowTransformOutputParameter, FlowTriggerType, FlowVariable, FlowVisibilityRule, FlowWait, FlowWaitEvent, FlowWaitEventInputParameter, FlowWaitEventOutputParameter, };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/metadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import type { FlowElementReferenceOrValue, FlowNode, FlowSortOrder } from './common.js';
2
+ import type { FlowRecordFilter } from './start.js';
3
+ export type FlowInputFieldAssignment = {
4
+ field: string;
5
+ value: FlowElementReferenceOrValue;
6
+ };
7
+ export type FlowOutputFieldAssignment = {
8
+ assignToReference: string;
9
+ field: string;
10
+ };
11
+ export type FlowRecordCreate = FlowNode & {
12
+ object: string;
13
+ inputAssignments?: FlowInputFieldAssignment[];
14
+ inputReference?: string;
15
+ storeOutputAutomatically?: boolean;
16
+ };
17
+ export type FlowRecordDelete = FlowNode & {
18
+ filters?: FlowRecordFilter[];
19
+ inputReference?: string;
20
+ object?: string;
21
+ };
22
+ export type FlowRecordLookup = FlowNode & {
23
+ object: string;
24
+ filters?: FlowRecordFilter[];
25
+ getFirstRecordOnly?: boolean;
26
+ outputAssignments?: FlowOutputFieldAssignment[];
27
+ outputReference?: string;
28
+ queriedFields?: string[];
29
+ sortField?: string;
30
+ sortOrder?: FlowSortOrder;
31
+ storeOutputAutomatically?: boolean;
32
+ };
33
+ export type FlowRecordUpdate = FlowNode & {
34
+ filters?: FlowRecordFilter[];
35
+ inputAssignments?: FlowInputFieldAssignment[];
36
+ inputReference?: string;
37
+ object?: string;
38
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/records.ts"],"names":[],"mappings":""}
@@ -0,0 +1,44 @@
1
+ import type { FlowDataType, FlowElementReferenceOrValue, FlowSortOrder } from './common.js';
2
+ import type { FlowOutputFieldAssignment } from './records.js';
3
+ export type FlowVariable = {
4
+ name: string;
5
+ dataType: FlowDataType;
6
+ isCollection?: boolean;
7
+ isInput?: boolean;
8
+ isOutput?: boolean;
9
+ objectType?: string;
10
+ scale?: number;
11
+ value?: FlowElementReferenceOrValue;
12
+ };
13
+ export type FlowConstant = {
14
+ name: string;
15
+ dataType: FlowDataType;
16
+ value: FlowElementReferenceOrValue;
17
+ };
18
+ export type FlowFormula = {
19
+ name: string;
20
+ dataType: FlowDataType;
21
+ expression: string;
22
+ scale?: number;
23
+ };
24
+ export type FlowDynamicChoiceSet = {
25
+ name: string;
26
+ dataType: FlowDataType;
27
+ displayField: string;
28
+ object: string;
29
+ outputAssignments?: FlowOutputFieldAssignment[];
30
+ picklistField?: string;
31
+ picklistObject?: string;
32
+ sortField?: string;
33
+ sortOrder?: FlowSortOrder;
34
+ valueField?: string;
35
+ };
36
+ export type FlowTextTemplate = {
37
+ name: string;
38
+ text: string;
39
+ };
40
+ export type FlowStage = {
41
+ name: string;
42
+ label: string;
43
+ isActive: boolean;
44
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/resources.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
1
+ import type { FlowCondition, FlowDataType, FlowElementReferenceOrValue, FlowNode } from './common.js';
2
+ export type FlowScreenFieldType = 'DisplayText' | 'InputField' | 'LargeTextArea' | 'PasswordField' | 'RadioButtons' | 'DropdownBox' | 'MultiSelectCheckboxes' | 'MultiSelectPicklist' | 'ComponentInstance';
3
+ export type FlowScreenFieldInputParameter = {
4
+ name: string;
5
+ value: FlowElementReferenceOrValue;
6
+ };
7
+ export type FlowScreenFieldOutputParameter = {
8
+ assignToReference: string;
9
+ name: string;
10
+ };
11
+ export type FlowInputValidationRule = {
12
+ errorMessage: string;
13
+ formulaExpression: string;
14
+ };
15
+ export type FlowVisibilityRule = {
16
+ conditionLogic?: string;
17
+ conditions: FlowCondition[];
18
+ };
19
+ export type FlowScreenField = {
20
+ name: string;
21
+ fieldType: FlowScreenFieldType;
22
+ dataType?: FlowDataType;
23
+ defaultValue?: FlowElementReferenceOrValue;
24
+ extensionName?: string;
25
+ fieldText?: string;
26
+ helpText?: string;
27
+ inputParameters?: FlowScreenFieldInputParameter[];
28
+ isRequired?: boolean;
29
+ outputParameters?: FlowScreenFieldOutputParameter[];
30
+ scale?: number;
31
+ validationRule?: FlowInputValidationRule;
32
+ visibilityRule?: FlowVisibilityRule;
33
+ };
34
+ export type FlowScreenRuleAction = {
35
+ attribute: string;
36
+ fieldReference: string;
37
+ value: FlowElementReferenceOrValue;
38
+ };
39
+ export type FlowScreenRule = {
40
+ name: string;
41
+ conditionLogic?: string;
42
+ conditions: FlowCondition[];
43
+ label: string;
44
+ ruleActions: FlowScreenRuleAction[];
45
+ };
46
+ export type FlowScreen = FlowNode & {
47
+ allowBack?: boolean;
48
+ allowFinish?: boolean;
49
+ allowPause?: boolean;
50
+ fields?: FlowScreenField[];
51
+ helpText?: string;
52
+ pausedText?: string;
53
+ rules?: FlowScreenRule[];
54
+ showFooter?: boolean;
55
+ showHeader?: boolean;
56
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=screens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.js","sourceRoot":"","sources":["../../../../src/types/salesforce/flow/screens.ts"],"names":[],"mappings":""}