@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
package/README.md CHANGED
@@ -1,13 +1,23 @@
1
- # OmniStudio Migration Assistant
1
+ # Omnistudio Migration Assistant
2
2
 
3
- The Omnistudio Migration Assistant is a command-line interface (CLI) plugin that you install via Salesforce CLI. It creates records for your omnistudio components on the Salesforce standard objects.
3
+ The Omnistudio Migration Assistant is a Salesforce CLI plugin that automates the migration of Omnistudio components. When run on a custom data model with managed package runtime, it migrates components to the standard data model and switches them to the Omnistudio standard runtime. When run on a standard data model with managed package, it cleans record names, enables the metadata API, and switches to the Omnistudio standard runtime.
4
4
 
5
- ### Before You Begin
5
+ ## 🚀 Before You Begin
6
+
7
+ > **Note:** The `sfdx` CLI has been deprecated. Please use `sf` CLI commands instead. The deprecated `sfdx` command aliases (`-u`, `--targetusername`) are still supported.
8
+
9
+ ⚠️ IMPORTANT: Before installing and using the Omnistudio Migration Assistant, contact Salesforce support.
6
10
 
7
11
  - Review the migration phases in [Migration Process from Omnistudio for Managed Packages to Omnistudio](https://help.salesforce.com/s/articleView?id=xcloud.os_migrate_omnistudio_custom_objects_to_standard_objects.htm&language=en_US&type=5)
8
12
 
9
13
  - Install Salesforce CLI on your computer. See : [Install Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm).
10
14
 
15
+ - To deploy LWC as part of auto-deployment process, environment variable 'OMA_AUTH_KEY' should be set with requested NPM repository access key from Salesforce Customer Support.
16
+
17
+ - This tool requires Node Version 18+.
18
+
19
+ - LWC migration auto-deployment needs minimum node version of 18.17.1
20
+
11
21
  ## Install and Run the Omnistudio Migration Assistant
12
22
 
13
23
  1. Install SF cli using the official documentation located [here](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm).
@@ -28,60 +38,63 @@ You can also authenticate using a consumer key (client ID) and secret key throug
28
38
  3. In a new terminal session, Install the Omnistudio Migration Assistant by running the `sf plugins install` command. For example
29
39
 
30
40
  ```
31
- sf plugins install @salesforce/plugin-omnistudio-migration-tool@2.0.0-beta.13
41
+ sf plugins install @salesforce/plugin-omnistudio-migration-tool@2.0.0-dev.1
32
42
  ```
33
43
 
34
44
  4. Run the Omnistudio Migration Assistant from the Salesforce CLI:
35
45
 
36
46
  ```
37
47
  // To assess everything without migrating
38
- sfdx omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM
48
+ sf omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM
39
49
 
40
50
  // To migrate everything
41
- sfdx omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM
51
+ sf omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM
42
52
 
43
53
 
44
- // To migrate/assess specific components: FlexCards, DataMappers, Integration Procedures, OmniScripts, or Global Auto Numbers, add the following parameters:
45
- --only=dr // DataMappers (DataRaptors)
46
- --only=ip // Integration Procedures
47
- --only=os // OmniScripts
48
- --only=fc // FlexCards
49
- --only=autonumber // Global Auto Numbers
54
+ // To migrate/assess specific components: Flexcards, Data Mappers, Integration Procedures, Omniscripts, Omni Global Auto Numbers or Custom Labels, add the following parameters:
55
+ --only=dm // Data Mappers
56
+ --only=ip // Integration Procedures
57
+ --only=os // Omniscripts
58
+ --only=fc // Flexcards
59
+ --only=autonumber // Omni Global Auto Numbers
60
+ --only=cl // Custom Labels
50
61
 
51
62
  // To migrate all versions of the components and not just the active ones:
52
63
  --allversions
53
64
 
54
- // To assess specific related objects:
55
- --relatedobjects=apex // for Apex classes only
65
+ // To assess specific set of related objects:
66
+ --relatedobjects=apex // for Apex classes only
67
+ --relatedobjects=lwc // for Lightning Web Components only
68
+ --relatedobjects=expsites // for Experience Sites only
69
+ --relatedobjects=flexipage // for FlexiPages only
70
+ --relatedobjects=apex,lwc,expsites,flexipage // for all related objects
56
71
 
57
- // To specify the Velocity Namespace (Optional)
58
- --namespace=VLOCITY_PACKAGE_NAMESPACE
59
72
  ```
60
73
 
61
74
  5. An HTML page will be open in your default browser with the results of your migration/assessment reports.
62
75
 
63
- ## Global Auto Number Migration
76
+ ## Omni Global Auto Number Migration
64
77
 
65
- Global Auto Numbers are components that generate sequential numbers across your Omnistudio org. The migration tool supports both assessment and migration of these components.
78
+ Omni Global Auto Numbers are components that generate sequential numbers across your Omnistudio org. The migration tool supports both assessment and migration of these components.
66
79
 
67
- ### Prerequisites for Global Auto Number Migration
80
+ ### Prerequisites for Omni Global Auto Number Migration
68
81
 
69
- Before migrating Global Auto Numbers, ensure that:
82
+ Before migrating Omni Global Auto Numbers, ensure that:
70
83
 
71
84
  1. **Org Preference is Disabled**: The `OmniGlobalAutoNumberPref` org preference must be disabled before migration
72
85
  2. **Rollback Flags are Disabled**: Both `RollbackIPChanges` and `RollbackDRChanges` flags must be disabled
73
86
  3. **Namespace is Specified**: Provide the correct namespace for your OmniStudio package
74
87
 
75
- ### Global Auto Number Migration Process
88
+ ### Omni Global Auto Number Migration Process
76
89
 
77
- The migration process for Global Auto Numbers includes:
90
+ The migration process for Omni Global Auto Numbers includes:
78
91
 
79
92
  1. **Pre-migration Checks**: Validates that org preferences and rollback flags are properly configured
80
- 2. **Data Migration**: Transforms Global Auto Number settings from custom objects to standard Business Process Objects (BPO)
93
+ 2. **Data Migration**: Transforms Omni Global Auto Number settings from custom objects to standard Business Process Objects (BPO)
81
94
  3. **Post-migration Cleanup**: Removes source objects and enables the `OmniGlobalAutoNumberPref` org preference
82
95
  4. **Validation**: Ensures all records are successfully migrated before cleanup
83
96
 
84
- ### Global Auto Number Assessment
97
+ ### Omni Global Auto Number Assessment
85
98
 
86
99
  Assessment provides detailed information about:
87
100
 
@@ -89,91 +102,170 @@ Assessment provides detailed information about:
89
102
  - **Migration Readiness**: Determines if components can be automatically migrated or require manual intervention
90
103
  - **Warnings**: Highlights potential issues that may affect migration success
91
104
 
92
- ### Usage Examples for Global Auto Numbers
105
+ ### Usage Examples for Omni Global Auto Numbers
93
106
 
94
107
  ```bash
95
- # Assess Global Auto Numbers only
96
- sfdx omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
108
+ # Assess Omni Global Auto Numbers only
109
+ sf omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
97
110
 
98
- # Migrate Global Auto Numbers only
99
- sfdx omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
111
+ # Migrate Omni Global Auto Numbers only
112
+ sf omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
100
113
  ```
101
114
 
102
115
  5. An HTML page will be open in your default browser with the results of your migration/assessment job.
103
116
 
104
- ### Assess Usage & parameters
117
+ ## Clean Command
118
+
119
+ Deactivates and deletes Omnistudio records (Omniscripts, Integration Procedures, Flexcards, and Data Mappers) that blocks enabling the Omnistudio Metadata API. Removes records with special characters in unique name fields or missing unique names.
120
+
121
+ > ⚠️ **Warning:** This action is permanent. Always run in a testing sandbox first and verify results before running in production.
122
+
123
+ ### Prerequisites
124
+
125
+ - ✅ Org uses **standard data model** (not custom data model)
126
+ - ✅ **Metadata API not enabled** in your org
127
+ - ✅ All Omnistudio components **backed up** or deployed to testing sandbox
128
+ - ✅ Run in **testing sandbox first** to verify results
129
+
130
+ ### Quick Start
105
131
 
132
+ ```bash
133
+ # Step 1: Preview what would be cleaned (recommended)
134
+ sf omnistudio:migration:clean -u orguser@domain.com --assess
135
+
136
+ # Step 2: Review assessment reports in clean_assessment/ folder
137
+
138
+ # Step 3: Run actual cleanup (requires confirmation)
139
+ sf omnistudio:migration:clean -u orguser@domain.com
106
140
  ```
107
- USAGE
108
- $ sf omnistudio:migration:assess [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
109
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
110
141
 
111
- OPTIONS
112
- -n, --namespace=namespace the namespace of the vertical package
142
+ ### Command Options
113
143
 
114
- -u, --targetusername=targetusername username or alias for the target
115
- org; overrides default target org
144
+ | Option | Description |
145
+ | ----------------------------- | ------------------------------------------------------- |
146
+ | `-u, --target-org=<username>` | (required) Username or alias for target org |
147
+ | `--assess` | Preview records that would be removed (no changes made) |
116
148
 
117
- -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
118
- org; overrides default dev hub org
149
+ ### Usage Examples
119
150
 
120
- --apiversion=apiversion override the api version used for
121
- api requests made by this command
151
+ #### Preview Mode (Assessment)
122
152
 
123
- --json format output as json
153
+ ```bash
154
+ # Preview without making changes
155
+ sf omnistudio:migration:clean -u orguser@domain.com --assess
156
+ ```
124
157
 
125
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
126
- this command invocation
158
+ **Assessment Output:**
127
159
 
128
- -a, --allversions migrate all versions and not
129
- and not just the active ones.
160
+ - Reports saved to `clean_assessment/` folder
161
+ - JSON files for each component type (Omniscripts, Integration Procedures, Flexcards, Data Mappers)
162
+ - Each file contains:
163
+ - `specialCharacterRecords`: Records with special characters in unique names
164
+ - `orphanRecords`: Records without deployment references (missing unique names)
165
+ - `totalToDelete`: Total records that would be removed
130
166
 
131
- --only=only specify components to assess:
132
- dr (DataRaptors), ip (Integration Procedures),
133
- os (OmniScripts), fc (FlexCards), autonumber (Global Auto Numbers)
167
+ #### Cleanup Mode
134
168
 
135
- --relatedobjects=relatedobjects specify related objects to assess:
136
- 'apex' for Apex classes
169
+ ```bash
170
+ # Run cleanup (requires confirmation)
171
+ sf omnistudio:migration:clean -u orguser@domain.com
137
172
  ```
138
173
 
139
- ### Migrate Usage & parameters
174
+ **What Happens:**
175
+
176
+ 1. Validates prerequisites (standard data model, Metadata API not enabled)
177
+ 2. Shows warning and prompts for confirmation
178
+ 3. **Phase 1**: Deactivates and deletes records with special characters
179
+ 4. **Phase 2**: Deactivates and deletes records without unique names
180
+ 5. Displays completion message
181
+
182
+ ### Cleanup Process
183
+
184
+ The clean command runs in two phases:
185
+
186
+ 1. **Phase 1: Special Character Cleanup**
187
+
188
+ - Removes records with special characters in unique name fields
189
+ - These records are incompatible with Metadata API
190
+
191
+ 2. **Phase 2: Missing Unique Name Cleanup**
192
+ - Removes records without deployment references (missing unique names)
193
+ - These records blocks enabling Metadata API
194
+
195
+ ### Full Command Reference
140
196
 
141
197
  ```
142
198
  USAGE
143
- $ sf omnistudio:migration:migrate [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
144
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
199
+ $ sf omnistudio:migration:clean -u <username> [--assess]
145
200
 
146
201
  OPTIONS
147
- -n, --namespace=namespace the namespace of the vertical package
202
+ -u, --target-org=<username> (required) username or alias for the target org
203
+ --assess preview which records would be removed without making changes
204
+ ```
148
205
 
149
- -u, --targetusername=targetusername username or alias for the target
150
- org; overrides default target org
206
+ ### Assess Usage & parameters
151
207
 
152
- -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
153
- org; overrides default dev hub org
208
+ ```
209
+ USAGE
210
+ $ sf omnistudio:migration:assess -u <username> [--only <component>] [--allversions]
211
+ [--relatedobjects <objects>] [--verbose]
154
212
 
155
- --apiversion=apiversion override the api version used for
156
- api requests made by this command
213
+ OPTIONS
214
+ -u, --target-org=<username> (required) username or alias for the target org
215
+ (alias: --targetusername - deprecated)
157
216
 
158
- --json format output as json
217
+ -o, --only=<component> specify a single component to assess:
218
+ dm (Data Mappers),
219
+ ip (Integration Procedures),
220
+ os (Omniscripts),
221
+ fc (Flexcards),
222
+ autonumber (Omni Global Auto Numbers),
223
+ cl (Custom Labels)
159
224
 
160
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
161
- this command invocation
225
+ -a, --allversions assess all versions, not just the active ones
162
226
 
163
- -a, --allversions migrate all versions and not
164
- and not just the active ones.
227
+ -r, --relatedobjects=<objects> specify one or more related objects to assess (comma separated):
228
+ apex - Apex classes
229
+ lwc - Lightning Web Components
230
+ expsites - Experience Sites
231
+ flexipage - FlexiPages
165
232
 
166
- --only=only specify components to migrate:
167
- dr (DataRaptors), ip (Integration Procedures),
168
- os (OmniScripts), fc (FlexCards)
233
+ --verbose enable verbose output
169
234
 
170
- --relatedobjects=relatedobjects specify related objects to assess:
171
- 'apex' for Apex classes
235
+ --loglevel=<level> (deprecated) use --verbose instead
172
236
  ```
173
237
 
174
- > **Note:** LWC (Lightning Web Components) assessment/migration functionality is temporarily disabled in the current version. LWC features will be re-enabled in a future releases.
238
+ ### Migrate Usage & parameters
175
239
 
176
- > Apex migration functionality remains fully available. The `--relatedobjects` flag only accepts values ('apex')
240
+ ```
241
+ USAGE
242
+ $ sf omnistudio:migration:migrate -u <username> [--only <component>] [--allversions]
243
+ [--relatedobjects <objects>] [--verbose]
244
+
245
+ OPTIONS
246
+ -u, --target-org=<username> (required) username or alias for the target org
247
+ (aliases: --targetusername - deprecated)
248
+
249
+ -o, --only=<component> specify a single component to migrate:
250
+ dm (Data Mappers),
251
+ ip (Integration Procedures),
252
+ os (Omniscripts),
253
+ fc (Flexcards),
254
+ autonumber (Omni Global Auto Numbers),
255
+ cl (Custom Labels)
256
+
257
+ -a, --allversions migrate all versions, not just the active ones
258
+
259
+ -r, --relatedobjects=<objects> specify one or more related objects to migrate (comma separated):
260
+ apex - Apex classes
261
+ lwc - Lightning Web Components
262
+ expsites - Experience Sites
263
+ flexipage - FlexiPages
264
+
265
+ --verbose enable verbose output
266
+
267
+ --loglevel=<level> (deprecated) use --verbose instead
268
+ ```
177
269
 
178
270
  Terms:
179
271
  Notwithstanding anything stated in the terms and conditions agreed between Salesforce (‘SFDC’) and you (‘Customer’), the use of the OmniStudio Migration Assistant (‘Assistant’) is designed to facilitate the migration and it’s going to modify your custom code and by deploying and using the Assistant you hereby provide your consent to automate the migration process and enable a smooth transition. Customer shall access and use the Assistant only as permitted to the Customer and shall not compromise, break or circumvent any technical processes or security measures associated with the services provided by SFDC.
@@ -1,23 +1,31 @@
1
- import { flags } from '@salesforce/command';
2
- import OmniStudioBaseCommand from '../../basecommand';
3
- export default class Assess extends OmniStudioBaseCommand {
1
+ import { Org, Logger as CoreLogger } from '@salesforce/core';
2
+ import { SfCommand, Ux } from '@salesforce/sf-plugins-core';
3
+ import { AssessmentInfo } from '../../../utils/interfaces';
4
+ interface AssessFlags {
5
+ 'target-org'?: Org;
6
+ only?: string;
7
+ allversions?: boolean;
8
+ relatedobjects?: string;
9
+ verbose?: boolean;
10
+ }
11
+ export default class Assess extends SfCommand<AssessmentInfo> {
4
12
  static description: string;
5
13
  static examples: string[];
6
- static args: {
7
- name: string;
8
- }[];
9
- protected static flagsConfig: {
10
- namespace: flags.Discriminated<flags.String>;
11
- only: flags.Discriminated<flags.String>;
12
- allversions: flags.Discriminated<flags.Boolean<boolean>>;
13
- relatedobjects: flags.Discriminated<flags.String>;
14
- verbose: flags.Builtin;
15
- };
16
- run(): Promise<any>;
17
- runAssess(): Promise<any>;
14
+ static args: any;
15
+ static readonly flags: any;
16
+ run(): Promise<AssessmentInfo>;
17
+ runAssess(parsedFlags: AssessFlags, ux: Ux, logger: CoreLogger): Promise<AssessmentInfo>;
18
18
  private assessOmniStudioComponents;
19
19
  private assessDataRaptors;
20
20
  private assessFlexCards;
21
21
  private assessOmniScripts;
22
+ private assessSaveForLater;
22
23
  private assessGlobalAutoNumbers;
24
+ private assessCustomLabels;
25
+ /**
26
+ * Logs assessment completion with count and completion message if needed
27
+ * Skips logging when standard data model with metadata API is enabled
28
+ */
29
+ private logAssessmentCompletionIfNeeded;
23
30
  }
31
+ export {};