@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,105 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
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
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Deployer = void 0;
37
+ const path = __importStar(require("path"));
38
+ const shell = __importStar(require("shelljs"));
39
+ const sfProject_1 = require("../utils/sfcli/project/sfProject");
40
+ const logger_1 = require("../utils/logger");
41
+ const omniscriptPackageManager_1 = require("../utils/omniscriptPackageManager");
42
+ const deploymentErrors_1 = require("../error/deploymentErrors");
43
+ class Deployer {
44
+ constructor(projectPath, messages, username, authKey) {
45
+ this.omniscriptCustomizationPackage = '@omnistudio/omniscript_customization';
46
+ this.omniscriptCustomizationPackageVersion = '250.0.0';
47
+ this.projectPath = projectPath;
48
+ this.username = username;
49
+ this.messages = messages;
50
+ this.authKey = authKey;
51
+ // Configure omniscript package settings
52
+ this.omniscriptPackageConfig = {
53
+ packageName: this.omniscriptCustomizationPackage,
54
+ version: this.omniscriptCustomizationPackageVersion,
55
+ };
56
+ }
57
+ async deploy() {
58
+ const pwd = shell.pwd();
59
+ shell.cd(this.projectPath);
60
+ try {
61
+ // Install dependencies including omniscript customization package
62
+ if (this.authKey) {
63
+ sfProject_1.sfProject.createNPMConfigFile(this.authKey);
64
+ logger_1.Logger.logVerbose(this.messages.getMessage('installingRequiredDependencies'));
65
+ sfProject_1.sfProject.installDependency();
66
+ sfProject_1.sfProject.installDependency(`${this.omniscriptCustomizationPackage}@${this.omniscriptCustomizationPackageVersion}`);
67
+ // Deploy omniscript customization package separately first
68
+ await this.deployOmniscriptPackage();
69
+ }
70
+ // Deploy the main project after omniscript package deployment succeeds
71
+ logger_1.Logger.log(path.join(pwd.toString(), 'package.xml'));
72
+ sfProject_1.sfProject.deployFromManifest(path.join(pwd.toString(), 'package.xml'), this.username);
73
+ }
74
+ finally {
75
+ shell.cd(pwd);
76
+ }
77
+ }
78
+ async deployOmniscriptPackage() {
79
+ try {
80
+ this.omniscriptPackageManager = new omniscriptPackageManager_1.OmniscriptPackageManager(this.projectPath, this.omniscriptPackageConfig, this.username);
81
+ const success = await this.omniscriptPackageManager.deployPackageAsync();
82
+ if (success) {
83
+ logger_1.Logger.log(this.messages.getMessage('omniscriptPackageIntegrated'));
84
+ }
85
+ else {
86
+ const errorMsg = this.messages.getMessage('omniscriptPackageDeploymentFailedReturnedFalse');
87
+ logger_1.Logger.error(errorMsg);
88
+ throw new deploymentErrors_1.OmniscriptPackageDeploymentError(this.messages.getMessage('omniscriptPackageDeploymentFailedWithMessage', [errorMsg]));
89
+ }
90
+ }
91
+ catch (error) {
92
+ const errorMessage = error instanceof Error ? error.message : String(error);
93
+ logger_1.Logger.error(this.messages.getMessage('errorIntegratingOmniscriptPackage'), error);
94
+ // Re-throw as OmniscriptPackageDeploymentError for consistent error handling upstream
95
+ if (error instanceof deploymentErrors_1.OmniscriptPackageDeploymentError) {
96
+ throw error;
97
+ }
98
+ else {
99
+ throw new deploymentErrors_1.OmniscriptPackageDeploymentError(this.messages.getMessage('omniscriptPackageDeploymentFailedWithMessage', [errorMessage]));
100
+ }
101
+ }
102
+ }
103
+ }
104
+ exports.Deployer = Deployer;
105
+ //# sourceMappingURL=deployer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployer.js","sourceRoot":"","sources":["../../src/migration/deployer.ts"],"names":[],"mappings":";;;;;;;;;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AAmC,CAAC,EAAE,KAAK,CAAC,CAAC;YAEnF,sFAAsF;YACtF,IAAI,KAAK,YAAY,mDAAgC,EAAE,CAAC;gBACtD,MAAM,KAAK,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,mDAAgC,CACxC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,8CAA8C,EAAE,CAAC,YAAY,CAAC,CAAC,CACzF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAjFD,4BAiFC"}
@@ -1,16 +1,19 @@
1
1
  import { AnyJson } from '@salesforce/ts-types';
2
2
  import { BaseMigrationTool } from './base';
3
- import { MigrationResult, MigrationTool, ObjectMapping } from './interfaces';
3
+ import { MigrationResult, MigrationTool, ObjectMapping, FlexcardStorage } from './interfaces';
4
4
  import { Connection, Messages } from '@salesforce/core';
5
- import { UX } from '@salesforce/command';
5
+ import { Ux } from '@salesforce/sf-plugins-core';
6
6
  import { FlexCardAssessmentInfo } from '../../src/utils';
7
7
  import { Logger } from '../utils/logger';
8
8
  export declare class CardMigrationTool extends BaseMigrationTool implements MigrationTool {
9
+ private readonly apexNamespaceRegistry;
9
10
  static readonly VLOCITYCARD_NAME = "VlocityCard__c";
10
11
  static readonly OMNIUICARD_NAME = "OmniUiCard";
11
12
  static readonly VERSION_PROP = "Version__c";
13
+ private static readonly URL_PARSE_BASE;
14
+ private IS_STANDARD_DATA_MODEL;
12
15
  private readonly allVersions;
13
- constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages, ux: UX, allVersions: boolean);
16
+ constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages<string>, ux: Ux, allVersions: boolean);
14
17
  getName(): string;
15
18
  getRecordName(record: string): any;
16
19
  getMappings(): ObjectMapping[];
@@ -19,17 +22,264 @@ export declare class CardMigrationTool extends BaseMigrationTool implements Migr
19
22
  assess(): Promise<FlexCardAssessmentInfo[]>;
20
23
  processCardComponents(flexCards: AnyJson[]): Promise<FlexCardAssessmentInfo[]>;
21
24
  private processFlexCard;
25
+ /**
26
+ * Scan a FlexCard for two distinct kinds of namespace-bound custom CSS:
27
+ *
28
+ * 1. **StaticResource-backed stylesheet** — `Definition__c.customStyleSheet`
29
+ * stores the *Name* of a Static Resource. We look it up, fetch its body,
30
+ * and substring-check for the org's managed-package namespace. Same flow
31
+ * and same warning message as the OmniScript implementation; resource
32
+ * scans are cached by name in {@link CustomCssRegistry}, so a stylesheet
33
+ * shared between OmniScripts and FlexCards is only fetched once per run.
34
+ *
35
+ * 2. **Inline CSS** — `Styles__c.customStyles` stores raw CSS text. We
36
+ * substring-check the namespace directly against that string. No
37
+ * SOQL/REST traffic and no caching (the CSS is per-FlexCard and not
38
+ * shared across records).
39
+ *
40
+ * Both checks emit a warning into `flexCardAssessmentInfo.warnings` and bump
41
+ * `migrationStatus` to 'Needs manual intervention' (via
42
+ * `getUpdatedAssessmentStatus`, which never downgrades a stricter status).
43
+ */
44
+ private collectStylesheetNamespaceDependencies;
22
45
  private updateDependencies;
46
+ /**
47
+ * Check events array for dependencies (Assessment)
48
+ * Handles: events[].actionList[].stateAction references
49
+ */
50
+ private checkEventsForDependencies;
51
+ /**
52
+ * Shared helper to check if a "cf" prefixed LWC name references a FlexCard and add dependency (assessment phase)
53
+ * @param cfPrefixedLwcName LWC name with "cf" prefix (e.g., "cfMyFlexCard")
54
+ * @param flexCardAssessmentInfo Assessment info to add dependencies and warnings
55
+ */
56
+ private addCfPrefixedFlexCardDependency;
57
+ /**
58
+ * Shared helper to update a "cf" prefixed LWC name with registry (migration phase)
59
+ * @param cfPrefixedLwcName LWC name with "cf" prefix (e.g., "cfMyFlexCard")
60
+ * @returns Updated LWC name with "cf" prefix
61
+ */
62
+ private updateCfPrefixedFlexCardName;
63
+ /**
64
+ * Shared helper to check Custom LWC component for FlexCard dependencies (assessment phase)
65
+ * Handles customlwcname with "cf" prefix indicating FlexCard reference
66
+ */
67
+ private checkCustomLwcForDependencies;
68
+ /**
69
+ * Shared helper to update Custom LWC component with registry (migration phase)
70
+ * Handles customlwcname with "cf" prefix indicating FlexCard reference
71
+ */
72
+ private updateCustomLwcWithRegistry;
73
+ /**
74
+ * Shared helper to update flyoutLwc value with registry (migration phase)
75
+ * Handles FlexCard child cards references
76
+ */
77
+ private updateFlyoutLwcValue;
78
+ /**
79
+ * Shared helper to process stateAction.message JSON for dependencies
80
+ * Handles DataRaptor bundle and Integration Procedure ipMethod references
81
+ */
82
+ private processStateActionMessageForDependencies;
83
+ /**
84
+ * Shared helper to process stateAction.message JSON with registry updates
85
+ * Handles DataRaptor bundle and Integration Procedure ipMethod references
86
+ */
87
+ private processStateActionMessageWithRegistry;
88
+ private handleAssessmentForStdDataModelOrgsWithMetadataAPIEnabled;
89
+ private handleMigrationForStdDataModelOrgsWithMetadataAPIEnabled;
23
90
  private readChildCardsFromDefinition;
24
91
  private checkComponentForDependencies;
25
- private getAllActiveCards;
92
+ private addOmniScriptNavigateURLAssessmentWarning;
93
+ /**
94
+ * Build the customer-facing warning shown when a Web Page action URL contains
95
+ * fragment tokens that decodeURIComponent couldn't parse. Centralised here so
96
+ * the assessment and migration paths emit byte-identical text.
97
+ *
98
+ * Returns an empty string when the helper is called with no malformed tokens
99
+ * (defense in depth: callers already guard, but a future caller that forgets
100
+ * shouldn't be able to produce a degenerate warning with an empty bracket).
101
+ * Non-string entries are coerced via String() so a misbehaving caller can't
102
+ * surface "undefined" / "[object Object]" to customers; duplicates are
103
+ * suppressed so a fragment like `#/Foo%/Bar/Foo%/Baz` doesn't render as
104
+ * `["Foo%", "Foo%"]`.
105
+ */
106
+ private formatMalformedFragmentTokenWarning;
107
+ private getAllCards;
26
108
  private uploadAllCards;
27
109
  private uploadCard;
28
- private addToAssessmentStorage;
110
+ private prepareStorageForRelatedObjectsWhenMetadataAPIEnabled;
111
+ private prepareAssessmentStorageForFlexcards;
112
+ private addKeyToStorage;
113
+ private markDuplicateKeyInStorage;
114
+ isDifferentFlexcard(storedValue: FlexcardStorage, originalName: string): boolean;
29
115
  private prepareStorageForFlexcards;
30
116
  private getChildCards;
31
117
  private updateChildCards;
32
118
  private mapVlocityCardRecord;
33
- private fixChildren;
119
+ /**
120
+ * Comprehensive dependency update using NameMappingRegistry - mirrors assessment logic
121
+ */
122
+ private updateAllDependenciesWithRegistry;
123
+ /**
124
+ * Update events array references (Migration)
125
+ * Handles: events[].actionList[].stateAction references
126
+ */
127
+ private updateEventsWithRegistry;
128
+ /**
129
+ * Update dataSource (DataRaptor, Integration Procedures, Apex Remote) using registry
130
+ */
131
+ private updateDataSourceWithRegistry;
132
+ /**
133
+ * Update OmniScript reference using registry
134
+ */
135
+ private updateOmniScriptReferenceWithRegistry;
136
+ /**
137
+ * Update component dependencies comprehensively
138
+ */
139
+ private updateComponentDependenciesWithRegistry;
140
+ private applyOmniScriptURLRewrite;
141
+ /** Build a human-readable "before -> after" string for warning messages only. */
142
+ private formatURLRewriteSummary;
143
+ /**
144
+ * Decode a URL for DISPLAY purposes only (warning/log messages). The output
145
+ * is lossy with respect to URL parsing semantics (e.g. an encoded `%26`
146
+ * becomes a literal `&`) and must NOT be re-fed into a URL parser. Falls
147
+ * back to the raw input on malformed percent sequences.
148
+ */
149
+ private toReadableURL;
150
+ private getOmniScriptURLRewrite;
151
+ private isCustomWebPageAction;
152
+ /**
153
+ * Parse a URL string without throwing. Returns the parsed URL on success or
154
+ * undefined for:
155
+ * - syntactically invalid input (e.g. `https://[bad`, raw spaces in host,
156
+ * `http:///` with no host), or
157
+ * - URLs whose scheme is not `http:` or `https:` (e.g. `javascript:`,
158
+ * `data:`, `file:`, `mailto:`).
159
+ *
160
+ * See URL_PARSE_BASE for why a synthetic base is supplied.
161
+ */
162
+ private tryParseURL;
163
+ /**
164
+ * Verify a parsed URL has the OmniScript Navigate shape. We validate against
165
+ * the parsed components (pathname / searchParams / hash) rather than doing
166
+ * substring matches on the raw input so callers cannot smuggle the required
167
+ * tokens in unrelated positions (e.g. inside another query value).
168
+ *
169
+ * The pathname must START WITH `/apex/` and contain the universal-page
170
+ * token. Anchoring to the prefix rejects non-http(s) schemes such as
171
+ * `javascript:alert(1)//apex/...` whose parsed pathname does not begin
172
+ * with `/` (it begins with the opaque body of the scheme).
173
+ *
174
+ * Two legitimate shapes are accepted:
175
+ * 1. Path + query: /apex/<ns>__OmniScriptUniversalPage?OmniScriptType=...&OmniScriptSubType=...&OmniScriptLang=...
176
+ * 2. Path + fragment: /apex/<ns>__OmniScriptUniversalPage?...#/OmniScriptType/.../OmniScriptSubType/.../OmniScriptLang/...
177
+ */
178
+ private isValidOmniScriptNavigationURL;
179
+ private convertToStandardOmniScriptURL;
180
+ /**
181
+ * Parse a slash-separated OmniScript fragment of the form
182
+ * #/Key1/Value1/Key2/Value2/...
183
+ * into [key, value] pairs. Tolerates leading `#`, leading `/`, empty values
184
+ * (consecutive slashes), and a trailing orphan token (which is dropped).
185
+ *
186
+ * Tokens with malformed percent sequences (e.g. `Foo%`, `Bar%E2`) are kept
187
+ * as-is rather than throwing; decodeURIComponent raises URIError on invalid
188
+ * escape sequences and we don't want one bad token to crash the whole
189
+ * FlexCard's URL rewrite. The raw (still-encoded) tokens are also returned
190
+ * via `malformedTokens` so callers can surface them to customers as a
191
+ * "please verify" warning rather than silently shipping a best-effort guess.
192
+ */
193
+ private parseSlashFragmentParams;
194
+ /**
195
+ * Update omniType.Name using registry (handles Type/SubType/Language format)
196
+ */
197
+ private updateOmniTypeNameWithRegistry;
198
+ /**
199
+ * Update osName using registry (handles Type/SubType/Language format)
200
+ */
201
+ private updateOsNameWithRegistry;
202
+ /**
203
+ * Helper method to add OmniScript dependency and warnings during assessment
204
+ * Handles osName in format "Type/SubType/Language" or "Type/SubType"
205
+ * @param osName - OmniScript name in format "Type/SubType" or "Type/SubType/Language"
206
+ * @param flexCardAssessmentInfo - Assessment info to update
207
+ */
208
+ private addOmniScriptDependency;
209
+ /**
210
+ * Helper method to add OmniScript dependency from type/subtype/language fields
211
+ * @param type - OmniScript type
212
+ * @param subtype - OmniScript subtype
213
+ * @param language - OmniScript language (defaults to 'English')
214
+ * @param flexCardAssessmentInfo - Assessment info to update
215
+ */
216
+ private addOmniScriptDependencyFromParts;
217
+ /**
218
+ * Helper method to add DataRaptor dependency and warnings during assessment
219
+ * @param bundle - DataRaptor bundle name
220
+ * @param flexCardAssessmentInfo - Assessment info to update
221
+ */
222
+ private addDataRaptorDependency;
223
+ /**
224
+ * Helper method to add Integration Procedure dependency and warnings during assessment
225
+ * @param ipMethod - Integration Procedure method name (Type_SubType format)
226
+ * @param flexCardAssessmentInfo - Assessment info to update
227
+ */
228
+ private addIntegrationProcedureDependency;
229
+ /**
230
+ * Helper method to add FlexCard dependency and warnings during assessment
231
+ * @param cardName - FlexCard name
232
+ * @param flexCardAssessmentInfo - Assessment info to update
233
+ */
234
+ private addFlexCardDependency;
235
+ /**
236
+ * Helper method to flag a Vlocity Action dependency during assessment.
237
+ * Vlocity Actions are not supported in standard runtime FlexCards, so the
238
+ * FlexCard cannot be auto-migrated and must be manually reimplemented using
239
+ * the FlexCard Action (cardAction) feature.
240
+ */
241
+ private addVlocityActionDependency;
34
242
  private getCardFields;
243
+ private getFieldKey;
244
+ private getQueryNamespace;
245
+ private getCardObjectName;
246
+ /**
247
+ * Check if a FlexCard has dependencies on Angular OmniScripts
248
+ */
249
+ private hasAngularOmniScriptDependencies;
250
+ /**
251
+ * Check if events array has Angular OmniScript dependencies
252
+ */
253
+ private eventsHaveAngularOmniScriptDependency;
254
+ private hasOmniscriptFlyoutDependency;
255
+ private hasFlexCardFlyoutDependency;
256
+ private hasCustomLwcFlyoutDependency;
257
+ private hasFlyoutLwc;
258
+ /**
259
+ * Recursively check if a component has Angular Omniscript dependencies
260
+ */
261
+ private componentHasAngularOmniScriptDependency;
262
+ /**
263
+ * Check if an omniType references an Angular OmniScript
264
+ * Handles both string format and object with Name property
265
+ */
266
+ private checkOmniTypeForAngular;
267
+ /**
268
+ * Check if an osName string references an Angular OmniScript
269
+ * Handles Type/SubType/Language format in string
270
+ */
271
+ private checkOsNameForAngular;
272
+ /**
273
+ * Ensures that the FlexCard Definition includes required Lightning Community targets
274
+ * Adds "lightningCommunity__Page" and "lightningCommunity__Default" if missing
275
+ * This is needed as vlocity wrapper can have flexcard which is unpublished but omniwapper needs published card
276
+ */
277
+ private ensureCommunityTargets;
278
+ /**
279
+ * Prioritizes FlexCards by name characteristics:
280
+ * - Clean names (alphanumeric only) are processed first
281
+ * - Names with special characters are processed after
282
+ * This avoids naming conflicts during migration when special characters are cleaned
283
+ */
284
+ private prioritizeFlexCardsWithoutSpecialCharacters;
35
285
  }