@salesforce/plugin-omnistudio-migration-tool 2.0.0-rc.6 → 2.0.0-rc.61

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 (252) hide show
  1. package/README.md +165 -73
  2. package/lib/commands/omnistudio/migration/assess.d.ts +23 -15
  3. package/lib/commands/omnistudio/migration/assess.js +250 -89
  4. package/lib/commands/omnistudio/migration/assess.js.map +1 -1
  5. package/lib/commands/omnistudio/migration/clean.d.ts +13 -0
  6. package/lib/commands/omnistudio/migration/clean.js +162 -0
  7. package/lib/commands/omnistudio/migration/clean.js.map +1 -0
  8. package/lib/commands/omnistudio/migration/info.d.ts +10 -16
  9. package/lib/commands/omnistudio/migration/info.js +53 -35
  10. package/lib/commands/omnistudio/migration/info.js.map +1 -1
  11. package/lib/commands/omnistudio/migration/migrate.d.ts +78 -18
  12. package/lib/commands/omnistudio/migration/migrate.js +461 -175
  13. package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
  14. package/lib/error/deploymentErrors.d.ts +15 -0
  15. package/lib/error/deploymentErrors.js +35 -0
  16. package/lib/error/deploymentErrors.js.map +1 -0
  17. package/lib/error/errorInterfaces.d.ts +5 -0
  18. package/lib/error/errorInterfaces.js +9 -1
  19. package/lib/error/errorInterfaces.js.map +1 -1
  20. package/lib/javascripts/reportGeneratorUtility.js +585 -22
  21. package/lib/migration/ApexNamespaceRegistry.d.ts +49 -0
  22. package/lib/migration/ApexNamespaceRegistry.js +130 -0
  23. package/lib/migration/ApexNamespaceRegistry.js.map +1 -0
  24. package/lib/migration/CustomCssRegistry.d.ts +117 -0
  25. package/lib/migration/CustomCssRegistry.js +234 -0
  26. package/lib/migration/CustomCssRegistry.js.map +1 -0
  27. package/lib/migration/NameMappingRegistry.d.ts +134 -0
  28. package/lib/migration/NameMappingRegistry.js +411 -0
  29. package/lib/migration/NameMappingRegistry.js.map +1 -0
  30. package/lib/migration/base.d.ts +8 -6
  31. package/lib/migration/base.js +25 -8
  32. package/lib/migration/base.js.map +1 -1
  33. package/lib/migration/customLabels.d.ts +70 -0
  34. package/lib/migration/customLabels.js +177 -0
  35. package/lib/migration/customLabels.js.map +1 -0
  36. package/lib/migration/dataraptor.d.ts +13 -0
  37. package/lib/migration/dataraptor.js +205 -80
  38. package/lib/migration/dataraptor.js.map +1 -1
  39. package/lib/migration/deployer.d.ts +14 -0
  40. package/lib/migration/deployer.js +105 -0
  41. package/lib/migration/deployer.js.map +1 -0
  42. package/lib/migration/flexcard.d.ts +256 -6
  43. package/lib/migration/flexcard.js +1808 -268
  44. package/lib/migration/flexcard.js.map +1 -1
  45. package/lib/migration/globalautonumber.d.ts +8 -8
  46. package/lib/migration/globalautonumber.js +49 -24
  47. package/lib/migration/globalautonumber.js.map +1 -1
  48. package/lib/migration/interfaces.d.ts +14 -0
  49. package/lib/migration/interfaces.js.map +1 -1
  50. package/lib/migration/metadataobjnamecheck.js.map +1 -1
  51. package/lib/migration/omniscript.d.ts +218 -4
  52. package/lib/migration/omniscript.js +1709 -247
  53. package/lib/migration/omniscript.js.map +1 -1
  54. package/lib/migration/omniscriptInstance.d.ts +90 -0
  55. package/lib/migration/omniscriptInstance.js +755 -0
  56. package/lib/migration/omniscriptInstance.js.map +1 -0
  57. package/lib/migration/postMigrate.d.ts +20 -4
  58. package/lib/migration/postMigrate.js +199 -12
  59. package/lib/migration/postMigrate.js.map +1 -1
  60. package/lib/migration/premigrate.d.ts +51 -0
  61. package/lib/migration/premigrate.js +325 -0
  62. package/lib/migration/premigrate.js.map +1 -0
  63. package/lib/migration/related/ApexMigration.d.ts +3 -0
  64. package/lib/migration/related/ApexMigration.js +222 -56
  65. package/lib/migration/related/ApexMigration.js.map +1 -1
  66. package/lib/migration/related/ExperienceSiteMigration.d.ts +30 -5
  67. package/lib/migration/related/ExperienceSiteMigration.js +263 -73
  68. package/lib/migration/related/ExperienceSiteMigration.js.map +1 -1
  69. package/lib/migration/related/FlexipageMigration.d.ts +5 -5
  70. package/lib/migration/related/FlexipageMigration.js +60 -38
  71. package/lib/migration/related/FlexipageMigration.js.map +1 -1
  72. package/lib/migration/related/LwcMigration.js +45 -26
  73. package/lib/migration/related/LwcMigration.js.map +1 -1
  74. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js +48 -32
  75. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js.map +1 -1
  76. package/lib/styles/reportGenerator.css +241 -16
  77. package/lib/templates/assessmentReport.template +78 -8
  78. package/lib/templates/dashboard.template +86 -57
  79. package/lib/templates/migrationReport.template +151 -0
  80. package/lib/utils/OmnistudioSettingsPrefManager.d.ts +14 -0
  81. package/lib/utils/OmnistudioSettingsPrefManager.js +112 -0
  82. package/lib/utils/OmnistudioSettingsPrefManager.js.map +1 -0
  83. package/lib/utils/XMLUtil.js +2 -1
  84. package/lib/utils/XMLUtil.js.map +1 -1
  85. package/lib/utils/apex/executor/AnonymousApexRunner.d.ts +1 -1
  86. package/lib/utils/apex/parser/apexparser.d.ts +8 -1
  87. package/lib/utils/apex/parser/apexparser.js +79 -13
  88. package/lib/utils/apex/parser/apexparser.js.map +1 -1
  89. package/lib/utils/config/ExistingRecordCleanupService.d.ts +30 -0
  90. package/lib/utils/config/ExistingRecordCleanupService.js +266 -0
  91. package/lib/utils/config/ExistingRecordCleanupService.js.map +1 -0
  92. package/lib/utils/config/OmniStudioMetadataCleanupService.d.ts +36 -0
  93. package/lib/utils/config/OmniStudioMetadataCleanupService.js +123 -0
  94. package/lib/utils/config/OmniStudioMetadataCleanupService.js.map +1 -0
  95. package/lib/utils/config/SpecialCharacterRecordCleanupService.d.ts +17 -0
  96. package/lib/utils/config/SpecialCharacterRecordCleanupService.js +186 -0
  97. package/lib/utils/config/SpecialCharacterRecordCleanupService.js.map +1 -0
  98. package/lib/utils/constants/documentRegistry.d.ts +9 -17
  99. package/lib/utils/constants/documentRegistry.js +9 -17
  100. package/lib/utils/constants/documentRegistry.js.map +1 -1
  101. package/lib/utils/constants/stringContants.d.ts +78 -0
  102. package/lib/utils/constants/stringContants.js +91 -4
  103. package/lib/utils/constants/stringContants.js.map +1 -1
  104. package/lib/utils/customLabels.d.ts +35 -0
  105. package/lib/utils/customLabels.js +100 -0
  106. package/lib/utils/customLabels.js.map +1 -0
  107. package/lib/utils/dataModelService.d.ts +18 -0
  108. package/lib/utils/dataModelService.js +72 -0
  109. package/lib/utils/dataModelService.js.map +1 -0
  110. package/lib/utils/file/fileUtil.d.ts +3 -1
  111. package/lib/utils/file/fileUtil.js +30 -13
  112. package/lib/utils/file/fileUtil.js.map +1 -1
  113. package/lib/utils/flexipage/flexiPageTransformer.js +119 -23
  114. package/lib/utils/flexipage/flexiPageTransformer.js.map +1 -1
  115. package/lib/utils/formula/FormulaUtil.d.ts +1 -1
  116. package/lib/utils/formula/FormulaUtil.js +17 -9
  117. package/lib/utils/formula/FormulaUtil.js.map +1 -1
  118. package/lib/utils/formula/Stack.js.map +1 -1
  119. package/lib/utils/generatePackageXml.d.ts +6 -2
  120. package/lib/utils/generatePackageXml.js +73 -33
  121. package/lib/utils/generatePackageXml.js.map +1 -1
  122. package/lib/utils/index.d.ts +1 -0
  123. package/lib/utils/index.js +1 -0
  124. package/lib/utils/index.js.map +1 -1
  125. package/lib/utils/interfaces.d.ts +69 -8
  126. package/lib/utils/json/jsonutil.js.map +1 -1
  127. package/lib/utils/logger/fileLogger.js +17 -7
  128. package/lib/utils/logger/fileLogger.js.map +1 -1
  129. package/lib/utils/logger.d.ts +3 -3
  130. package/lib/utils/logger.js +10 -6
  131. package/lib/utils/logger.js.map +1 -1
  132. package/lib/utils/logging/debugtimer.js.map +1 -1
  133. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js +30 -22
  134. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js.map +1 -1
  135. package/lib/utils/lwcparser/fileutils/FileProcessorFactory.js.map +1 -1
  136. package/lib/utils/lwcparser/fileutils/HtmlFileProcessor.js.map +1 -1
  137. package/lib/utils/lwcparser/fileutils/JavascriptFileProcessor.js.map +1 -1
  138. package/lib/utils/lwcparser/fileutils/XmlFileProcessor.js.map +1 -1
  139. package/lib/utils/lwcparser/htmlParser/HTMLParser.js +29 -10
  140. package/lib/utils/lwcparser/htmlParser/HTMLParser.js.map +1 -1
  141. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js +29 -11
  142. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js.map +1 -1
  143. package/lib/utils/lwcparser/xmlParser/XmlParser.js +19 -8
  144. package/lib/utils/lwcparser/xmlParser/XmlParser.js.map +1 -1
  145. package/lib/utils/net/index.d.ts +5 -0
  146. package/lib/utils/net/index.js +40 -2
  147. package/lib/utils/net/index.js.map +1 -1
  148. package/lib/utils/omniscriptPackageManager.d.ts +31 -0
  149. package/lib/utils/omniscriptPackageManager.js +215 -0
  150. package/lib/utils/omniscriptPackageManager.js.map +1 -0
  151. package/lib/utils/orgPreferences.d.ts +25 -0
  152. package/lib/utils/orgPreferences.js +124 -8
  153. package/lib/utils/orgPreferences.js.map +1 -1
  154. package/lib/utils/orgUtils/index.d.ts +12 -5
  155. package/lib/utils/orgUtils/index.js +52 -22
  156. package/lib/utils/orgUtils/index.js.map +1 -1
  157. package/lib/utils/projectPathUtil.d.ts +1 -1
  158. package/lib/utils/projectPathUtil.js +27 -10
  159. package/lib/utils/projectPathUtil.js.map +1 -1
  160. package/lib/utils/promptUtil.d.ts +11 -1
  161. package/lib/utils/promptUtil.js +92 -0
  162. package/lib/utils/promptUtil.js.map +1 -1
  163. package/lib/utils/query/index.d.ts +1 -0
  164. package/lib/utils/query/index.js +18 -1
  165. package/lib/utils/query/index.js.map +1 -1
  166. package/lib/utils/recordPrioritization.d.ts +44 -0
  167. package/lib/utils/recordPrioritization.js +69 -0
  168. package/lib/utils/recordPrioritization.js.map +1 -0
  169. package/lib/utils/reportGenerator/reportInterfaces.d.ts +12 -0
  170. package/lib/utils/reportGenerator/reportUtil.d.ts +6 -1
  171. package/lib/utils/reportGenerator/reportUtil.js +22 -7
  172. package/lib/utils/reportGenerator/reportUtil.js.map +1 -1
  173. package/lib/utils/resultsbuilder/ApexAssessmentReporter.d.ts +1 -0
  174. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js +40 -17
  175. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js.map +1 -1
  176. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.d.ts +13 -0
  177. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js +179 -0
  178. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js.map +1 -0
  179. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.d.ts +27 -0
  180. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js +262 -0
  181. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js.map +1 -0
  182. package/lib/utils/resultsbuilder/DRAssessmentReporter.js +38 -70
  183. package/lib/utils/resultsbuilder/DRAssessmentReporter.js.map +1 -1
  184. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.d.ts +14 -0
  185. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js +143 -0
  186. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js.map +1 -0
  187. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +46 -85
  188. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -1
  189. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.d.ts +1 -0
  190. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js +37 -19
  191. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js.map +1 -1
  192. package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js +22 -14
  193. package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js.map +1 -1
  194. package/lib/utils/resultsbuilder/IPAssessmentReporter.js +38 -71
  195. package/lib/utils/resultsbuilder/IPAssessmentReporter.js.map +1 -1
  196. package/lib/utils/resultsbuilder/LWCAssessmentReporter.d.ts +14 -0
  197. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js +143 -139
  198. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js.map +1 -1
  199. package/lib/utils/resultsbuilder/OSAssessmentReporter.js +41 -88
  200. package/lib/utils/resultsbuilder/OSAssessmentReporter.js.map +1 -1
  201. package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.d.ts +12 -0
  202. package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.js +109 -0
  203. package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.js.map +1 -0
  204. package/lib/utils/resultsbuilder/assessmentReporter.d.ts +16 -6
  205. package/lib/utils/resultsbuilder/assessmentReporter.js +96 -152
  206. package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
  207. package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.d.ts +104 -0
  208. package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.js +380 -0
  209. package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.js.map +1 -0
  210. package/lib/utils/resultsbuilder/index.d.ts +37 -1
  211. package/lib/utils/resultsbuilder/index.js +582 -151
  212. package/lib/utils/resultsbuilder/index.js.map +1 -1
  213. package/lib/utils/resultsbuilder/reportingHelper.d.ts +2 -7
  214. package/lib/utils/resultsbuilder/reportingHelper.js +0 -43
  215. package/lib/utils/resultsbuilder/reportingHelper.js.map +1 -1
  216. package/lib/utils/sfcli/project/sfProject.d.ts +29 -0
  217. package/lib/utils/sfcli/project/sfProject.js +220 -2
  218. package/lib/utils/sfcli/project/sfProject.js.map +1 -1
  219. package/lib/utils/shell/cli.js +20 -14
  220. package/lib/utils/shell/cli.js.map +1 -1
  221. package/lib/utils/storageUtil.d.ts +14 -1
  222. package/lib/utils/storageUtil.js +31 -1
  223. package/lib/utils/storageUtil.js.map +1 -1
  224. package/lib/utils/stringUtils.d.ts +24 -0
  225. package/lib/utils/stringUtils.js +76 -9
  226. package/lib/utils/stringUtils.js.map +1 -1
  227. package/lib/utils/templateParser/__tests__/test.js +1 -2
  228. package/lib/utils/templateParser/__tests__/test.js.map +1 -1
  229. package/lib/utils/templateParser/generate.d.ts +1 -1
  230. package/lib/utils/templateParser/generate.js.map +1 -1
  231. package/lib/utils/templateParser/model/elementNode.d.ts +2 -2
  232. package/lib/utils/templateParser/model/elementNode.js +11 -2
  233. package/lib/utils/templateParser/model/elementNode.js.map +1 -1
  234. package/lib/utils/templateParser/model/nodeTypes.js +1 -1
  235. package/lib/utils/templateParser/model/nodeTypes.js.map +1 -1
  236. package/lib/utils/templateParser/util.d.ts +2 -2
  237. package/lib/utils/templateParser/util.js.map +1 -1
  238. package/lib/utils/validatorService.d.ts +14 -0
  239. package/lib/utils/validatorService.js +136 -0
  240. package/lib/utils/validatorService.js.map +1 -0
  241. package/messages/assess.json +220 -103
  242. package/messages/clean.json +40 -0
  243. package/messages/info.json +2 -1
  244. package/messages/migrate.json +314 -102
  245. package/oclif.manifest.json +1 -1
  246. package/package.json +49 -13
  247. package/lib/commands/basecommand.d.ts +0 -8
  248. package/lib/commands/basecommand.js +0 -13
  249. package/lib/commands/basecommand.js.map +0 -1
  250. package/lib/utils/OmniGlobalAutoNumberPrefManager.d.ts +0 -40
  251. package/lib/utils/OmniGlobalAutoNumberPrefManager.js +0 -65
  252. package/lib/utils/OmniGlobalAutoNumberPrefManager.js.map +0 -1
@@ -0,0 +1,134 @@
1
+ export interface ComponentNameMapping {
2
+ originalName: string;
3
+ cleanedName: string;
4
+ componentType: 'DataMapper' | 'OmniScript' | 'IntegrationProcedure' | 'FlexCard';
5
+ recordId: string;
6
+ migratedId?: string;
7
+ }
8
+ export interface DependencyReference {
9
+ parentComponentId: string;
10
+ parentComponentType: string;
11
+ fieldPath: string;
12
+ referencedOriginalName: string;
13
+ referencedComponentType: string;
14
+ }
15
+ /**
16
+ * Centralized registry for tracking name mappings and managing dependency updates
17
+ * during Omnistudio component migration.
18
+ */
19
+ export declare class NameMappingRegistry {
20
+ private static instance;
21
+ private nameMappings;
22
+ private dependencyReferences;
23
+ private dataMapperMappings;
24
+ private omniScriptMappings;
25
+ private integrationProcedureMappings;
26
+ private flexCardMappings;
27
+ private angularOmniScriptRefs;
28
+ static getInstance(): NameMappingRegistry;
29
+ /**
30
+ * Register a component name mapping before migration
31
+ */
32
+ registerNameMapping(mapping: ComponentNameMapping): void;
33
+ /**
34
+ * Register a dependency reference that needs to be updated
35
+ */
36
+ registerDependencyReference(reference: DependencyReference): void;
37
+ /**
38
+ * Get the cleaned name for a component
39
+ */
40
+ getCleanedName(originalName: string, componentType: string): string;
41
+ /**
42
+ * Check if a DataMapper mapping exists in the registry
43
+ */
44
+ hasDataMapperMapping(originalName: string): boolean;
45
+ /**
46
+ * Check if an Integration Procedure mapping exists in the registry
47
+ */
48
+ hasIntegrationProcedureMapping(originalName: string): boolean;
49
+ /**
50
+ * Check if an OmniScript mapping exists in the registry
51
+ */
52
+ hasOmniScriptMapping(originalName: string): boolean;
53
+ /**
54
+ * Check if a FlexCard mapping exists in the registry
55
+ */
56
+ hasFlexCardMapping(originalName: string): boolean;
57
+ /**
58
+ * Get available Integration Procedure mapping keys for debugging
59
+ */
60
+ getIntegrationProcedureMappingKeys(): string[];
61
+ /**
62
+ * Get available OmniScript mapping keys for debugging
63
+ */
64
+ getOmniScriptMappingKeys(): string[];
65
+ /**
66
+ * Get DataMapper cleaned name
67
+ */
68
+ getDataMapperCleanedName(originalName: string): string;
69
+ /**
70
+ * Get OmniScript cleaned name (Type_SubType_Language format)
71
+ */
72
+ getOmniScriptCleanedName(type: string, subType: string, language: string | 'English'): string;
73
+ /**
74
+ * Get Integration Procedure cleaned name
75
+ */
76
+ getIntegrationProcedureCleanedName(originalName: string): string;
77
+ /**
78
+ * Get FlexCard cleaned name
79
+ */
80
+ getFlexCardCleanedName(originalName: string): string;
81
+ /**
82
+ * Get all name mappings for reporting
83
+ */
84
+ getAllNameMappings(): ComponentNameMapping[];
85
+ /**
86
+ * Get warnings for name changes
87
+ */
88
+ getNameChangeWarnings(): string[];
89
+ /**
90
+ * Get warnings for a specific component type
91
+ */
92
+ getNameChangeWarningsForType(componentType: string): string[];
93
+ /**
94
+ * Get count of components with name changes by type
95
+ */
96
+ getNameChangeCountByType(): Record<string, number>;
97
+ /**
98
+ * Clear all mappings (for testing or new migration runs)
99
+ */
100
+ clear(): void;
101
+ /**
102
+ * Register an Angular OmniScript that should be skipped during migration
103
+ */
104
+ registerAngularOmniScript(omniScriptRef: string): void;
105
+ /**
106
+ * Check if an OmniScript reference is Angular (should be skipped)
107
+ */
108
+ isAngularOmniScript(omniScriptRef: string): boolean;
109
+ /**
110
+ * Get all Angular OmniScript references
111
+ */
112
+ getAngularOmniScriptRefs(): Set<string>;
113
+ /**
114
+ * Pre-process all components to register their name mappings
115
+ */
116
+ preProcessComponents(dataMappers: any[], lwcOmniScripts: any[], angularOmniScripts: any[], integrationProcedures: any[], flexCards: any[]): void;
117
+ /**
118
+ * Update all dependency references with cleaned names
119
+ */
120
+ updateDependencyReferences<T>(componentDefinition: T): T;
121
+ private registerDataMappersMapping;
122
+ private registerLwcOmniscriptsMapping;
123
+ private registerAngularOmniscriptsMapping;
124
+ private registerIntegrationProceduresMapping;
125
+ private registerFlexcardsMapping;
126
+ /**
127
+ * Recursively update references in an object
128
+ */
129
+ private updateObjectReferences;
130
+ /**
131
+ * Update a string reference if it matches a known component name
132
+ */
133
+ private updateStringReference;
134
+ }
@@ -0,0 +1,411 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.NameMappingRegistry = void 0;
10
+ const dataModelService_1 = require("../utils/dataModelService");
11
+ const stringutil_1 = require("../utils/StringValue/stringutil");
12
+ /**
13
+ * Centralized registry for tracking name mappings and managing dependency updates
14
+ * during Omnistudio component migration.
15
+ */
16
+ class NameMappingRegistry {
17
+ constructor() {
18
+ this.nameMappings = new Map();
19
+ this.dependencyReferences = [];
20
+ // Type-specific mappings for quick lookup
21
+ this.dataMapperMappings = new Map(); // original -> cleaned
22
+ this.omniScriptMappings = new Map(); // original -> cleaned
23
+ this.integrationProcedureMappings = new Map(); // original -> cleaned
24
+ this.flexCardMappings = new Map(); // original -> cleaned
25
+ // Track Angular OmniScripts that should be skipped (Type_SubType_Language format)
26
+ this.angularOmniScriptRefs = new Set();
27
+ }
28
+ static getInstance() {
29
+ if (!NameMappingRegistry.instance) {
30
+ NameMappingRegistry.instance = new NameMappingRegistry();
31
+ }
32
+ return NameMappingRegistry.instance;
33
+ }
34
+ /**
35
+ * Register a component name mapping before migration
36
+ */
37
+ registerNameMapping(mapping) {
38
+ const key = `${mapping.componentType}:${mapping.originalName}`;
39
+ this.nameMappings.set(key, mapping);
40
+ // Store in type-specific maps for quick lookup
41
+ switch (mapping.componentType) {
42
+ case 'DataMapper':
43
+ this.dataMapperMappings.set(mapping.originalName, mapping.cleanedName);
44
+ break;
45
+ case 'OmniScript':
46
+ this.omniScriptMappings.set(mapping.originalName, mapping.cleanedName);
47
+ break;
48
+ case 'IntegrationProcedure':
49
+ this.integrationProcedureMappings.set(mapping.originalName, mapping.cleanedName);
50
+ break;
51
+ case 'FlexCard':
52
+ this.flexCardMappings.set(mapping.originalName, mapping.cleanedName);
53
+ break;
54
+ }
55
+ }
56
+ /**
57
+ * Register a dependency reference that needs to be updated
58
+ */
59
+ registerDependencyReference(reference) {
60
+ this.dependencyReferences.push(reference);
61
+ }
62
+ /**
63
+ * Get the cleaned name for a component
64
+ */
65
+ getCleanedName(originalName, componentType) {
66
+ const key = `${componentType}:${originalName}`;
67
+ const mapping = this.nameMappings.get(key);
68
+ if (mapping) {
69
+ return mapping.cleanedName;
70
+ }
71
+ // Fallback to direct cleaning if not registered
72
+ return stringutil_1.Stringutil.cleanName(originalName);
73
+ }
74
+ /**
75
+ * Check if a DataMapper mapping exists in the registry
76
+ */
77
+ hasDataMapperMapping(originalName) {
78
+ return this.dataMapperMappings.has(originalName);
79
+ }
80
+ /**
81
+ * Check if an Integration Procedure mapping exists in the registry
82
+ */
83
+ hasIntegrationProcedureMapping(originalName) {
84
+ return this.integrationProcedureMappings.has(originalName);
85
+ }
86
+ /**
87
+ * Check if an OmniScript mapping exists in the registry
88
+ */
89
+ hasOmniScriptMapping(originalName) {
90
+ return this.omniScriptMappings.has(originalName);
91
+ }
92
+ /**
93
+ * Check if a FlexCard mapping exists in the registry
94
+ */
95
+ hasFlexCardMapping(originalName) {
96
+ return this.flexCardMappings.has(originalName);
97
+ }
98
+ /**
99
+ * Get available Integration Procedure mapping keys for debugging
100
+ */
101
+ getIntegrationProcedureMappingKeys() {
102
+ return Array.from(this.integrationProcedureMappings.keys());
103
+ }
104
+ /**
105
+ * Get available OmniScript mapping keys for debugging
106
+ */
107
+ getOmniScriptMappingKeys() {
108
+ return Array.from(this.omniScriptMappings.keys());
109
+ }
110
+ /**
111
+ * Get DataMapper cleaned name
112
+ */
113
+ getDataMapperCleanedName(originalName) {
114
+ return this.dataMapperMappings.get(originalName) || stringutil_1.Stringutil.cleanName(originalName);
115
+ }
116
+ /**
117
+ * Get OmniScript cleaned name (Type_SubType_Language format)
118
+ */
119
+ getOmniScriptCleanedName(type, subType, language) {
120
+ const originalName = `${type}_${subType}_${language}`;
121
+ // Check if we have a mapping for this OmniScript first
122
+ const mappedName = this.omniScriptMappings.get(originalName);
123
+ if (mappedName) {
124
+ return mappedName;
125
+ }
126
+ // Fallback to cleaning individual parts
127
+ const cleanedType = stringutil_1.Stringutil.cleanName(type);
128
+ const cleanedSubType = stringutil_1.Stringutil.cleanName(subType);
129
+ return `${cleanedType}_${cleanedSubType}_${language}`;
130
+ }
131
+ /**
132
+ * Get Integration Procedure cleaned name
133
+ */
134
+ getIntegrationProcedureCleanedName(originalName) {
135
+ return this.integrationProcedureMappings.get(originalName) || stringutil_1.Stringutil.cleanName(originalName, true);
136
+ }
137
+ /**
138
+ * Get FlexCard cleaned name
139
+ */
140
+ getFlexCardCleanedName(originalName) {
141
+ return this.flexCardMappings.get(originalName) || stringutil_1.Stringutil.cleanName(originalName);
142
+ }
143
+ /**
144
+ * Get all name mappings for reporting
145
+ */
146
+ getAllNameMappings() {
147
+ return Array.from(this.nameMappings.values());
148
+ }
149
+ /**
150
+ * Get warnings for name changes
151
+ */
152
+ getNameChangeWarnings() {
153
+ const warnings = [];
154
+ for (const mapping of this.nameMappings.values()) {
155
+ if (mapping.originalName !== mapping.cleanedName) {
156
+ warnings.push(`${mapping.componentType} name will change: "${mapping.originalName}" → "${mapping.cleanedName}"`);
157
+ }
158
+ }
159
+ return warnings;
160
+ }
161
+ /**
162
+ * Get warnings for a specific component type
163
+ */
164
+ getNameChangeWarningsForType(componentType) {
165
+ const warnings = [];
166
+ for (const mapping of this.nameMappings.values()) {
167
+ if (mapping.componentType === componentType && mapping.originalName !== mapping.cleanedName) {
168
+ warnings.push(`"${mapping.originalName}" → "${mapping.cleanedName}"`);
169
+ }
170
+ }
171
+ return warnings;
172
+ }
173
+ /**
174
+ * Get count of components with name changes by type
175
+ */
176
+ getNameChangeCountByType() {
177
+ const counts = {};
178
+ for (const mapping of this.nameMappings.values()) {
179
+ if (mapping.originalName !== mapping.cleanedName) {
180
+ counts[mapping.componentType] = (counts[mapping.componentType] || 0) + 1;
181
+ }
182
+ }
183
+ return counts;
184
+ }
185
+ /**
186
+ * Clear all mappings (for testing or new migration runs)
187
+ */
188
+ clear() {
189
+ this.nameMappings.clear();
190
+ this.dependencyReferences = [];
191
+ this.dataMapperMappings.clear();
192
+ this.omniScriptMappings.clear();
193
+ this.integrationProcedureMappings.clear();
194
+ this.flexCardMappings.clear();
195
+ this.angularOmniScriptRefs.clear();
196
+ }
197
+ /**
198
+ * Register an Angular OmniScript that should be skipped during migration
199
+ */
200
+ registerAngularOmniScript(omniScriptRef) {
201
+ this.angularOmniScriptRefs.add(omniScriptRef);
202
+ }
203
+ /**
204
+ * Check if an OmniScript reference is Angular (should be skipped)
205
+ */
206
+ isAngularOmniScript(omniScriptRef) {
207
+ return this.angularOmniScriptRefs.has(omniScriptRef);
208
+ }
209
+ /**
210
+ * Get all Angular OmniScript references
211
+ */
212
+ getAngularOmniScriptRefs() {
213
+ return new Set(this.angularOmniScriptRefs);
214
+ }
215
+ /**
216
+ * Pre-process all components to register their name mappings
217
+ */
218
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
+ preProcessComponents(
220
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
221
+ dataMappers,
222
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
223
+ lwcOmniScripts,
224
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
225
+ angularOmniScripts,
226
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
+ integrationProcedures,
228
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
229
+ flexCards) {
230
+ // Register DataMapper mappings
231
+ this.registerDataMappersMapping(dataMappers);
232
+ this.registerLwcOmniscriptsMapping(lwcOmniScripts);
233
+ this.registerAngularOmniscriptsMapping(angularOmniScripts);
234
+ this.registerIntegrationProceduresMapping(integrationProcedures);
235
+ this.registerFlexcardsMapping(flexCards);
236
+ }
237
+ /**
238
+ * Update all dependency references with cleaned names
239
+ */
240
+ updateDependencyReferences(componentDefinition) {
241
+ // This will be called for each component to update its dependencies
242
+ // Implementation depends on the specific structure of each component type
243
+ return this.updateObjectReferences(componentDefinition);
244
+ }
245
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
+ registerDataMappersMapping(dataMappers) {
247
+ for (const dr of dataMappers) {
248
+ this.registerNameMapping({
249
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
250
+ originalName: dr.Name,
251
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
252
+ cleanedName: stringutil_1.Stringutil.cleanName(dr.Name),
253
+ componentType: 'DataMapper',
254
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
255
+ recordId: dr.Id,
256
+ });
257
+ }
258
+ }
259
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
260
+ registerLwcOmniscriptsMapping(lwcOmniScripts) {
261
+ // Register OmniScript mappings
262
+ for (const os of lwcOmniScripts) {
263
+ // Extract namespace from field names (e.g., vlocity_ins__Type__c -> vlocity_ins)
264
+ let typeField = 'Type';
265
+ let subTypeField = 'SubType';
266
+ let languageField = 'Language';
267
+ if (!(0, dataModelService_1.isStandardDataModel)()) {
268
+ const fieldNames = Object.keys(os);
269
+ typeField = fieldNames.find((field) => field.endsWith('__Type__c')) || 'Type__c';
270
+ subTypeField = fieldNames.find((field) => field.endsWith('__SubType__c')) || 'SubType__c';
271
+ languageField = fieldNames.find((field) => field.endsWith('__Language__c')) || 'Language__c';
272
+ }
273
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
274
+ const type = os[typeField];
275
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
276
+ const subType = os[subTypeField];
277
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
278
+ const language = os[languageField] || 'English';
279
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
280
+ const originalName = `${type}_${subType}_${language}`;
281
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
282
+ const cleanedName = `${stringutil_1.Stringutil.cleanName(type)}_${stringutil_1.Stringutil.cleanName(subType)}_${language}`;
283
+ this.registerNameMapping({
284
+ originalName,
285
+ cleanedName,
286
+ componentType: 'OmniScript',
287
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
288
+ recordId: os.Id,
289
+ });
290
+ }
291
+ }
292
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
293
+ registerAngularOmniscriptsMapping(angularOmniScripts) {
294
+ // Register Angular OmniScript references (to be skipped during migration)
295
+ for (const angularOs of angularOmniScripts) {
296
+ // Extract namespace from field names (e.g., vlocity_ins__Type__c -> vlocity_ins)
297
+ let typeField = 'Type';
298
+ let subTypeField = 'SubType';
299
+ let languageField = 'Language';
300
+ if (!(0, dataModelService_1.isStandardDataModel)()) {
301
+ const fieldNames = Object.keys(angularOs);
302
+ typeField = fieldNames.find((field) => field.endsWith('__Type__c')) || 'Type__c';
303
+ subTypeField = fieldNames.find((field) => field.endsWith('__SubType__c')) || 'SubType__c';
304
+ languageField = fieldNames.find((field) => field.endsWith('__Language__c')) || 'Language__c';
305
+ }
306
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
307
+ const type = angularOs[typeField];
308
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
309
+ const subType = angularOs[subTypeField];
310
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
311
+ const language = angularOs[languageField] || 'English';
312
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
313
+ const angularRef = `${type}_${subType}_${language}`;
314
+ this.registerAngularOmniScript(angularRef);
315
+ }
316
+ }
317
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
318
+ registerIntegrationProceduresMapping(integrationProcedures) {
319
+ // Register Integration Procedure mappings
320
+ for (const ip of integrationProcedures) {
321
+ let typeField = 'Type';
322
+ let subTypeField = 'SubType';
323
+ if (!(0, dataModelService_1.isStandardDataModel)()) {
324
+ // Extract namespace from field names (e.g., vlocity_ins__Type__c -> vlocity_ins)
325
+ const fieldNames = Object.keys(ip);
326
+ typeField = fieldNames.find((field) => field.endsWith('__Type__c')) || 'Type__c';
327
+ subTypeField = fieldNames.find((field) => field.endsWith('__SubType__c')) || 'SubType__c';
328
+ }
329
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
330
+ const type = ip[typeField];
331
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
332
+ const subType = ip[subTypeField];
333
+ // Integration Procedures use only Type_SubType format (no language)
334
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
335
+ const originalName = `${type}_${subType}`;
336
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
337
+ const cleanedName = `${stringutil_1.Stringutil.cleanName(type)}_${stringutil_1.Stringutil.cleanName(subType)}`;
338
+ this.registerNameMapping({
339
+ originalName,
340
+ cleanedName,
341
+ componentType: 'IntegrationProcedure',
342
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
343
+ recordId: ip.Id,
344
+ });
345
+ }
346
+ }
347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
348
+ registerFlexcardsMapping(flexCards) {
349
+ // Register FlexCard mappings
350
+ for (const fc of flexCards) {
351
+ this.registerNameMapping({
352
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
353
+ originalName: fc.Name,
354
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
355
+ cleanedName: stringutil_1.Stringutil.cleanName(fc.Name),
356
+ componentType: 'FlexCard',
357
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
358
+ recordId: fc.Id,
359
+ });
360
+ }
361
+ }
362
+ /**
363
+ * Recursively update references in an object
364
+ */
365
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
366
+ updateObjectReferences(obj) {
367
+ if (typeof obj === 'string') {
368
+ return this.updateStringReference(obj);
369
+ }
370
+ if (Array.isArray(obj)) {
371
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
372
+ return obj.map((item) => this.updateObjectReferences(item));
373
+ }
374
+ if (obj && typeof obj === 'object') {
375
+ const updated = {};
376
+ for (const [key, value] of Object.entries(obj)) {
377
+ updated[key] = this.updateObjectReferences(value);
378
+ }
379
+ return updated;
380
+ }
381
+ return obj;
382
+ }
383
+ /**
384
+ * Update a string reference if it matches a known component name
385
+ */
386
+ updateStringReference(str) {
387
+ // Check if this string might be a DataMapper reference
388
+ if (this.dataMapperMappings.has(str)) {
389
+ return this.dataMapperMappings.get(str);
390
+ }
391
+ // Check if this string might be an Integration Procedure reference
392
+ if (this.integrationProcedureMappings.has(str)) {
393
+ return this.integrationProcedureMappings.get(str);
394
+ }
395
+ // Check if this string might be a FlexCard reference
396
+ if (this.flexCardMappings.has(str)) {
397
+ return this.flexCardMappings.get(str);
398
+ }
399
+ // Check if this string might be an OmniScript reference (Type_SubType_Language)
400
+ for (const [originalName, cleanedName] of this.omniScriptMappings.entries()) {
401
+ if (str === originalName) {
402
+ return cleanedName;
403
+ }
404
+ }
405
+ // Return original string unchanged if no mapping found
406
+ // Only registered component names should be cleaned
407
+ return str;
408
+ }
409
+ }
410
+ exports.NameMappingRegistry = NameMappingRegistry;
411
+ //# sourceMappingURL=NameMappingRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NameMappingRegistry.js","sourceRoot":"","sources":["../../src/migration/NameMappingRegistry.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,gEAAgE;AAChE,gEAA6D;AAkB7D;;;GAGG;AACH,MAAa,mBAAmB;IAAhC;QAEU,iBAAY,GAAsC,IAAI,GAAG,EAAE,CAAC;QAC5D,yBAAoB,GAA0B,EAAE,CAAC;QAEzD,0CAA0C;QAClC,uBAAkB,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,sBAAsB;QAC3E,uBAAkB,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,sBAAsB;QAC3E,iCAA4B,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,sBAAsB;QACrF,qBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,sBAAsB;QAEjF,kFAAkF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sB,CAAC,KAAK,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,GAAW;QACvC,uDAAuD;QACvD,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;QAED,mEAAmE;QACnE,IAAI,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;QAED,qDAAqD;QACrD,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,CAAC;QAED,gFAAgF;QAChF,KAAK,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC;YAC5E,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;gBACzB,OAAO,WAAW,CAAC;YACrB,CAAC;QACH,CAAC;QAED,uDAAuD;QACvD,oDAAoD;QACpD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AArcD,kDAqcC"}
@@ -1,10 +1,11 @@
1
- import { UX } from '@salesforce/command';
1
+ import { Ux } from '@salesforce/sf-plugins-core';
2
2
  import { Connection, Messages } from '@salesforce/core';
3
3
  import * as cliProgress from 'cli-progress';
4
4
  import { Logger } from '../utils/logger';
5
5
  import { TransformData, UploadRecordResult } from './interfaces';
6
- export type ComponentType = 'Data Mapper' | 'Flexcard' | 'Omniscript and Integration Procedure' | 'GlobalAutoNumber';
7
- export type RelatedObjectType = 'Flexipage';
6
+ import { NameMappingRegistry } from './NameMappingRegistry';
7
+ export type ComponentType = 'Data Mappers' | 'Flexcards' | 'Omniscripts' | 'Integration Procedures' | 'Omni Global Auto Numbers';
8
+ export type RelatedObjectType = 'Flexipage' | 'ExperienceSites' | 'Lightning Web Components' | 'Apex Classes';
8
9
  /**
9
10
  * Creates a progress bar for migration/assessment operations
10
11
  *
@@ -19,9 +20,10 @@ export declare class BaseMigrationTool {
19
20
  protected readonly connection: Connection;
20
21
  protected readonly namespacePrefix: string;
21
22
  protected readonly logger: Logger;
22
- protected readonly messages: Messages;
23
- protected readonly ux: UX;
24
- constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages, ux: UX);
23
+ protected readonly messages: Messages<string>;
24
+ protected readonly ux: Ux;
25
+ protected readonly nameRegistry: NameMappingRegistry;
26
+ constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages<string>, ux: Ux);
25
27
  protected uploadTransformedData(objectName: string, transformedData: TransformData): Promise<Map<string, UploadRecordResult>>;
26
28
  protected updateData(transformedData: TransformData): Promise<Map<string, UploadRecordResult>>;
27
29
  /**
@@ -15,19 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.BaseMigrationTool = exports.createProgressBar = void 0;
27
37
  const cliProgress = __importStar(require("cli-progress"));
28
38
  const utils_1 = require("../utils");
29
39
  const net_1 = require("../utils/net");
30
40
  const stringutil_1 = require("../utils/StringValue/stringutil");
41
+ const NameMappingRegistry_1 = require("./NameMappingRegistry");
31
42
  /**
32
43
  * Creates a progress bar for migration/assessment operations
33
44
  *
@@ -36,8 +47,13 @@ const stringutil_1 = require("../utils/StringValue/stringutil");
36
47
  * @returns A configured cliProgress.SingleBar instance
37
48
  */
38
49
  const createProgressBar = (action, type) => {
50
+ // Normalize type to string for comparison
51
+ const typeStr = String(type);
52
+ // Determine if space should be empty or tabs
53
+ const noSpaceTypes = ['Omniscript', 'Integration Procedure', 'ExperienceSites'];
54
+ const space = noSpaceTypes.includes(typeStr) ? '' : '\t\t\t\t';
39
55
  return new cliProgress.SingleBar({
40
- format: `${action} ${type} |${type === 'Omniscript and Integration Procedure' ? '' : '\t\t\t\t'} {bar} | {percentage}% || {value}/{total} Tasks`,
56
+ format: `${action} ${type} | ${space} {bar} | {percentage}% || {value}/{total} Tasks\n`,
41
57
  barCompleteChar: '\u2588',
42
58
  barIncompleteChar: '\u2591',
43
59
  hideCursor: true,
@@ -52,6 +68,7 @@ class BaseMigrationTool {
52
68
  this.logger = logger;
53
69
  this.messages = messages;
54
70
  this.ux = ux;
71
+ this.nameRegistry = NameMappingRegistry_1.NameMappingRegistry.getInstance();
55
72
  this.namespacePrefix = namespace ? namespace + '__' : '';
56
73
  }
57
74
  async uploadTransformedData(objectName, transformedData) {