@salesforce/plugin-omnistudio-migration-tool 2.0.0-beta.8 → 2.0.0-dev.2

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 (206) hide show
  1. package/README.md +137 -36
  2. package/lib/commands/omnistudio/migration/assess.d.ts +2 -2
  3. package/lib/commands/omnistudio/migration/assess.js +128 -123
  4. package/lib/commands/omnistudio/migration/assess.js.map +1 -1
  5. package/lib/commands/omnistudio/migration/info.js +2 -3
  6. package/lib/commands/omnistudio/migration/info.js.map +1 -1
  7. package/lib/commands/omnistudio/migration/migrate.d.ts +37 -4
  8. package/lib/commands/omnistudio/migration/migrate.js +378 -120
  9. package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
  10. package/lib/error/deploymentErrors.d.ts +15 -0
  11. package/lib/error/deploymentErrors.js +35 -0
  12. package/lib/error/deploymentErrors.js.map +1 -0
  13. package/lib/error/errorInterfaces.d.ts +14 -0
  14. package/lib/error/errorInterfaces.js +27 -0
  15. package/lib/error/errorInterfaces.js.map +1 -0
  16. package/lib/javascripts/reportGeneratorUtility.js +403 -25
  17. package/lib/mappings/GlobalAutoNumber.d.ts +10 -0
  18. package/lib/mappings/GlobalAutoNumber.js +14 -0
  19. package/lib/mappings/GlobalAutoNumber.js.map +1 -0
  20. package/lib/migration/NameMappingRegistry.d.ts +134 -0
  21. package/lib/migration/NameMappingRegistry.js +411 -0
  22. package/lib/migration/NameMappingRegistry.js.map +1 -0
  23. package/lib/migration/base.d.ts +7 -4
  24. package/lib/migration/base.js +34 -7
  25. package/lib/migration/base.js.map +1 -1
  26. package/lib/migration/customLabels.d.ts +70 -0
  27. package/lib/migration/customLabels.js +166 -0
  28. package/lib/migration/customLabels.js.map +1 -0
  29. package/lib/migration/dataraptor.d.ts +6 -0
  30. package/lib/migration/dataraptor.js +189 -82
  31. package/lib/migration/dataraptor.js.map +1 -1
  32. package/lib/migration/deployer.d.ts +14 -0
  33. package/lib/migration/deployer.js +95 -0
  34. package/lib/migration/deployer.js.map +1 -0
  35. package/lib/migration/flexcard.d.ts +60 -3
  36. package/lib/migration/flexcard.js +984 -169
  37. package/lib/migration/flexcard.js.map +1 -1
  38. package/lib/migration/globalautonumber.d.ts +60 -0
  39. package/lib/migration/globalautonumber.js +324 -0
  40. package/lib/migration/globalautonumber.js.map +1 -0
  41. package/lib/migration/interfaces.d.ts +100 -0
  42. package/lib/migration/interfaces.js +7 -0
  43. package/lib/migration/interfaces.js.map +1 -1
  44. package/lib/migration/omniscript.d.ts +53 -1
  45. package/lib/migration/omniscript.js +1115 -186
  46. package/lib/migration/omniscript.js.map +1 -1
  47. package/lib/migration/postMigrate.d.ts +29 -0
  48. package/lib/migration/postMigrate.js +221 -0
  49. package/lib/migration/postMigrate.js.map +1 -0
  50. package/lib/migration/premigrate.d.ts +49 -0
  51. package/lib/migration/premigrate.js +270 -0
  52. package/lib/migration/premigrate.js.map +1 -0
  53. package/lib/migration/related/ApexMigration.d.ts +3 -0
  54. package/lib/migration/related/ApexMigration.js +194 -47
  55. package/lib/migration/related/ApexMigration.js.map +1 -1
  56. package/lib/migration/related/ExperienceSiteMigration.d.ts +42 -0
  57. package/lib/migration/related/ExperienceSiteMigration.js +389 -0
  58. package/lib/migration/related/ExperienceSiteMigration.js.map +1 -0
  59. package/lib/migration/related/FlexipageMigration.d.ts +84 -0
  60. package/lib/migration/related/FlexipageMigration.js +216 -0
  61. package/lib/migration/related/FlexipageMigration.js.map +1 -0
  62. package/lib/migration/related/LwcMigration.js +30 -24
  63. package/lib/migration/related/LwcMigration.js.map +1 -1
  64. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.d.ts +4 -0
  65. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js +46 -25
  66. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js.map +1 -1
  67. package/lib/styles/reportGenerator.css +250 -21
  68. package/lib/templates/assessmentReport.template +106 -35
  69. package/lib/templates/dashboard.template +80 -52
  70. package/lib/templates/migrationReport.template +180 -27
  71. package/lib/utils/OmnistudioSettingsPrefManager.d.ts +14 -0
  72. package/lib/utils/OmnistudioSettingsPrefManager.js +112 -0
  73. package/lib/utils/OmnistudioSettingsPrefManager.js.map +1 -0
  74. package/lib/utils/XMLUtil.d.ts +34 -0
  75. package/lib/utils/XMLUtil.js +172 -0
  76. package/lib/utils/XMLUtil.js.map +1 -0
  77. package/lib/utils/apex/parser/apexparser.d.ts +8 -1
  78. package/lib/utils/apex/parser/apexparser.js +63 -10
  79. package/lib/utils/apex/parser/apexparser.js.map +1 -1
  80. package/lib/utils/config/OmniStudioMetadataCleanupService.d.ts +36 -0
  81. package/lib/utils/config/OmniStudioMetadataCleanupService.js +117 -0
  82. package/lib/utils/config/OmniStudioMetadataCleanupService.js.map +1 -0
  83. package/lib/utils/constants/documentRegistry.d.ts +21 -0
  84. package/lib/utils/constants/documentRegistry.js +25 -0
  85. package/lib/utils/constants/documentRegistry.js.map +1 -0
  86. package/lib/utils/constants/stringContants.d.ts +20 -0
  87. package/lib/utils/constants/stringContants.js +24 -2
  88. package/lib/utils/constants/stringContants.js.map +1 -1
  89. package/lib/utils/customLabels.d.ts +34 -0
  90. package/lib/utils/customLabels.js +97 -0
  91. package/lib/utils/customLabels.js.map +1 -0
  92. package/lib/utils/dataModelService.d.ts +12 -0
  93. package/lib/utils/dataModelService.js +61 -0
  94. package/lib/utils/dataModelService.js.map +1 -0
  95. package/lib/utils/file/fileUtil.d.ts +3 -0
  96. package/lib/utils/file/fileUtil.js +34 -0
  97. package/lib/utils/file/fileUtil.js.map +1 -1
  98. package/lib/utils/flexipage/flexiPageTransformer.d.ts +17 -0
  99. package/lib/utils/flexipage/flexiPageTransformer.js +218 -0
  100. package/lib/utils/flexipage/flexiPageTransformer.js.map +1 -0
  101. package/lib/utils/formula/FormulaUtil.d.ts +1 -1
  102. package/lib/utils/formula/FormulaUtil.js +8 -4
  103. package/lib/utils/formula/FormulaUtil.js.map +1 -1
  104. package/lib/utils/generatePackageXml.d.ts +5 -2
  105. package/lib/utils/generatePackageXml.js +27 -22
  106. package/lib/utils/generatePackageXml.js.map +1 -1
  107. package/lib/utils/index.d.ts +1 -0
  108. package/lib/utils/index.js +1 -0
  109. package/lib/utils/index.js.map +1 -1
  110. package/lib/utils/interfaces.d.ts +94 -2
  111. package/lib/utils/logger.d.ts +2 -2
  112. package/lib/utils/logger.js +7 -3
  113. package/lib/utils/logger.js.map +1 -1
  114. package/lib/utils/lwcparser/fileutils/FileDiffUtil.d.ts +2 -1
  115. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js +93 -48
  116. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js.map +1 -1
  117. package/lib/utils/lwcparser/htmlParser/HTMLParser.js +12 -3
  118. package/lib/utils/lwcparser/htmlParser/HTMLParser.js.map +1 -1
  119. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js +12 -4
  120. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js.map +1 -1
  121. package/lib/utils/lwcparser/xmlParser/XmlParser.js +3 -2
  122. package/lib/utils/lwcparser/xmlParser/XmlParser.js.map +1 -1
  123. package/lib/utils/net/index.d.ts +5 -0
  124. package/lib/utils/net/index.js +52 -16
  125. package/lib/utils/net/index.js.map +1 -1
  126. package/lib/utils/omniscriptPackageManager.d.ts +31 -0
  127. package/lib/utils/omniscriptPackageManager.js +205 -0
  128. package/lib/utils/omniscriptPackageManager.js.map +1 -0
  129. package/lib/utils/orgPreferences.d.ts +35 -0
  130. package/lib/utils/orgPreferences.js +112 -0
  131. package/lib/utils/orgPreferences.js.map +1 -1
  132. package/lib/utils/orgUtils/index.d.ts +1 -1
  133. package/lib/utils/orgUtils/index.js +18 -20
  134. package/lib/utils/orgUtils/index.js.map +1 -1
  135. package/lib/utils/projectPathUtil.d.ts +39 -0
  136. package/lib/utils/projectPathUtil.js +173 -0
  137. package/lib/utils/projectPathUtil.js.map +1 -0
  138. package/lib/utils/promptUtil.d.ts +2 -0
  139. package/lib/utils/promptUtil.js +26 -1
  140. package/lib/utils/promptUtil.js.map +1 -1
  141. package/lib/utils/reportGenerator/reportInterfaces.d.ts +14 -0
  142. package/lib/utils/reportGenerator/reportUtil.d.ts +6 -1
  143. package/lib/utils/reportGenerator/reportUtil.js +24 -4
  144. package/lib/utils/reportGenerator/reportUtil.js.map +1 -1
  145. package/lib/utils/resultsbuilder/ApexAssessmentReporter.d.ts +1 -0
  146. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js +52 -18
  147. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js.map +1 -1
  148. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.d.ts +13 -0
  149. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js +179 -0
  150. package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js.map +1 -0
  151. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.d.ts +27 -0
  152. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js +258 -0
  153. package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js.map +1 -0
  154. package/lib/utils/resultsbuilder/DRAssessmentReporter.js +56 -65
  155. package/lib/utils/resultsbuilder/DRAssessmentReporter.js.map +1 -1
  156. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.d.ts +14 -0
  157. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js +143 -0
  158. package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js.map +1 -0
  159. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +57 -64
  160. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -1
  161. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.d.ts +56 -0
  162. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js +155 -0
  163. package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js.map +1 -0
  164. package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.d.ts +14 -0
  165. package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js +156 -0
  166. package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js.map +1 -0
  167. package/lib/utils/resultsbuilder/IPAssessmentReporter.js +52 -65
  168. package/lib/utils/resultsbuilder/IPAssessmentReporter.js.map +1 -1
  169. package/lib/utils/resultsbuilder/LWCAssessmentReporter.d.ts +14 -0
  170. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js +143 -139
  171. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js.map +1 -1
  172. package/lib/utils/resultsbuilder/OSAssessmentReporter.js +55 -93
  173. package/lib/utils/resultsbuilder/OSAssessmentReporter.js.map +1 -1
  174. package/lib/utils/resultsbuilder/assessmentReporter.d.ts +8 -1
  175. package/lib/utils/resultsbuilder/assessmentReporter.js +177 -55
  176. package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
  177. package/lib/utils/resultsbuilder/index.d.ts +21 -1
  178. package/lib/utils/resultsbuilder/index.js +543 -81
  179. package/lib/utils/resultsbuilder/index.js.map +1 -1
  180. package/lib/utils/resultsbuilder/reportingHelper.d.ts +3 -6
  181. package/lib/utils/resultsbuilder/reportingHelper.js +4 -29
  182. package/lib/utils/resultsbuilder/reportingHelper.js.map +1 -1
  183. package/lib/utils/sfcli/project/sfProject.d.ts +28 -0
  184. package/lib/utils/sfcli/project/sfProject.js +206 -2
  185. package/lib/utils/sfcli/project/sfProject.js.map +1 -1
  186. package/lib/utils/shell/cli.js +3 -7
  187. package/lib/utils/shell/cli.js.map +1 -1
  188. package/lib/utils/storageUtil.d.ts +22 -0
  189. package/lib/utils/storageUtil.js +88 -0
  190. package/lib/utils/storageUtil.js.map +1 -0
  191. package/lib/utils/stringUtils.d.ts +10 -0
  192. package/lib/utils/stringUtils.js +53 -1
  193. package/lib/utils/stringUtils.js.map +1 -1
  194. package/lib/utils/templateParser/model/elementNode.js +11 -2
  195. package/lib/utils/templateParser/model/elementNode.js.map +1 -1
  196. package/lib/utils/validatorService.d.ts +12 -0
  197. package/lib/utils/validatorService.js +78 -0
  198. package/lib/utils/validatorService.js.map +1 -0
  199. package/messages/assess.json +182 -88
  200. package/messages/info.json +2 -1
  201. package/messages/migrate.json +282 -66
  202. package/oclif.manifest.json +1 -1
  203. package/package.json +41 -7
  204. package/lib/utils/constants/callToActionMessages.d.ts +0 -35
  205. package/lib/utils/constants/callToActionMessages.js +0 -39
  206. package/lib/utils/constants/callToActionMessages.js.map +0 -1
package/README.md CHANGED
@@ -1,83 +1,184 @@
1
- # OmniStudio Migration Assistant
1
+ # Omnistudio Migration Assistant
2
2
 
3
- ### Before You Begin
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
- Read and follow the directions in the Omnistudio migration documentation: https://help.salesforce.com/s/articleView?id=sf.os_migrate_omnistudio_custom_objects_to_standard_objects.htm&type=5
5
+ ## 🚀 Before You Begin
6
6
 
7
- ## Running SFDX plugin
7
+ ⚠️ IMPORTANT: Before installing and using the Omnistudio Migration Assistant, contact Salesforce support.
8
8
 
9
- 1. Install SFDX 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).
10
- 2. Authenticate your SFDX cli into the org you are going to use for development. You can follow authentication steps [here](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_web.htm).
11
- 3. In a new terminal session, install the plugin using the following command
9
+ - 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)
10
+
11
+ - 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).
12
+
13
+ - 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.
14
+
15
+ - LWC migration auto-deployment needs minimum node version of 18.17.1
16
+
17
+ ## Install and Run the Omnistudio Migration Assistant
18
+
19
+ 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).
20
+ 2. Authenticate Salesforce CLI in your migration sandbox (the org you are going to use for development) using the `sf org login web` command and then enter your username and password in the new browser tab that appears. See [Salesforce CLI Command Reference org login Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_org_commands_unified.htm).
21
+
22
+ `sf org login web --instance-url=<Org URL>`
23
+
24
+ When prompted, enter your username and password, and connect. The command-line interface shows the message "Authentication Successful"
25
+
26
+ For example:
27
+ `username@userdomain ~ % sf org login web --instance-url=https://usa794org-5b.my.salesforce.com`
28
+
29
+ You then see the authorization message.
30
+ Successfully authorized username@salesforce.com with org ID 00DHp000004ArLWMA0
31
+
32
+ You can also authenticate using a consumer key (client ID) and secret key through connected apps. See [Authorization Through Connected Apps and OAuth 2.0](<[text](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm)>).
33
+
34
+ 3. In a new terminal session, Install the Omnistudio Migration Assistant by running the `sf plugins install` command. For example
12
35
 
13
36
  ```
14
- sfdx plugins:install @salesforce/plugin-omnistudio-migration-tool
37
+ sf plugins install @salesforce/plugin-omnistudio-migration-tool@2.0.0-dev.1
15
38
  ```
16
39
 
17
- 4. To run the migration assistant, run the following command from your command line tool:
40
+ 4. Run the Omnistudio Migration Assistant from the Salesforce CLI:
18
41
 
19
42
  ```
43
+ // To assess everything without migrating
44
+ sfdx omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM
45
+
20
46
  // To migrate everything
21
47
  sfdx omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM
22
48
 
23
- // To assess everything without migrating
24
- sfdx omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM
25
49
 
26
- // To migrate/assess specific components: FlexCards, DataMappers, Integration Procedures, or OmniScripts, add the following parameters:
27
- --only=dr
28
- --only=ip
29
- --only=os
30
- --only=fc
50
+ // To migrate/assess specific components: Flexcards, Data Mappers, Integration Procedures, Omniscripts, Omni Global Auto Numbers or Custom Labels, add the following parameters:
51
+ --only=dm // Data Mappers
52
+ --only=ip // Integration Procedures
53
+ --only=os // Omniscripts
54
+ --only=fc // Flexcards
55
+ --only=autonumber // Omni Global Auto Numbers
56
+ --only=cl // Custom Labels
31
57
 
32
58
  // To migrate all versions of the components and not just the active ones:
33
59
  --allversions
34
60
 
35
- // To assess specific related objects:
36
- --relatedobjects=apex // for Apex classes only
61
+ // To assess specific set of related objects:
62
+ --relatedobjects=apex // for Apex classes only
63
+ --relatedobjects=lwc // for Lightning Web Components only
64
+ --relatedobjects=expsites // for Experience Sites only
65
+ --relatedobjects=flexipage // for FlexiPages only
66
+ --relatedobjects=apex,lwc,expsites,flexipage // for all related objects
37
67
 
38
- // To specify the Velocity Namespace (Optional)
39
- --namespace=VLOCITY_PACKAGE_NAMESPACE
68
+ ```
69
+
70
+ 5. An HTML page will be open in your default browser with the results of your migration/assessment reports.
71
+
72
+ ## Omni Global Auto Number Migration
73
+
74
+ 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.
75
+
76
+ ### Prerequisites for Omni Global Auto Number Migration
77
+
78
+ Before migrating Omni Global Auto Numbers, ensure that:
79
+
80
+ 1. **Org Preference is Disabled**: The `OmniGlobalAutoNumberPref` org preference must be disabled before migration
81
+ 2. **Rollback Flags are Disabled**: Both `RollbackIPChanges` and `RollbackDRChanges` flags must be disabled
82
+ 3. **Namespace is Specified**: Provide the correct namespace for your OmniStudio package
83
+
84
+ ### Omni Global Auto Number Migration Process
85
+
86
+ The migration process for Omni Global Auto Numbers includes:
87
+
88
+ 1. **Pre-migration Checks**: Validates that org preferences and rollback flags are properly configured
89
+ 2. **Data Migration**: Transforms Omni Global Auto Number settings from custom objects to standard Business Process Objects (BPO)
90
+ 3. **Post-migration Cleanup**: Removes source objects and enables the `OmniGlobalAutoNumberPref` org preference
91
+ 4. **Validation**: Ensures all records are successfully migrated before cleanup
92
+
93
+ ### Omni Global Auto Number Assessment
94
+
95
+ Assessment provides detailed information about:
96
+
97
+ - **Name Changes**: Identifies any naming modifications required to comply with API naming standards
98
+ - **Migration Readiness**: Determines if components can be automatically migrated or require manual intervention
99
+ - **Warnings**: Highlights potential issues that may affect migration success
100
+
101
+ ### Usage Examples for Omni Global Auto Numbers
102
+
103
+ ```bash
104
+ # Assess Omni Global Auto Numbers only
105
+ sfdx omnistudio:migration:assess -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
106
+
107
+ # Migrate Omni Global Auto Numbers only
108
+ sfdx omnistudio:migration:migrate -u YOUR_ORG_USERNAME@DOMAIN.COM --only=autonumber
40
109
  ```
41
110
 
42
111
  5. An HTML page will be open in your default browser with the results of your migration/assessment job.
43
112
 
44
- ### Usage & parameters
113
+ ### Assess Usage & parameters
45
114
 
46
115
  ```
47
116
  USAGE
48
- $ sfdx omnistudio:migration:migrate [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
117
+ $ sf omnistudio:migration:assess [-v <string>] [-u <string>] [--loglevel
49
118
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
50
119
 
51
120
  OPTIONS
52
- -n, --namespace=namespace the namespace of the vertical package
53
-
54
121
  -u, --targetusername=targetusername username or alias for the target
55
122
  org; overrides default target org
56
123
 
57
124
  -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
58
125
  org; overrides default dev hub org
59
126
 
60
- --apiversion=apiversion override the api version used for
61
- api requests made by this command
62
-
63
- --json format output as json
64
-
65
127
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
66
128
  this command invocation
67
129
 
68
130
  -a, --allversions migrate all versions and not
69
131
  and not just the active ones.
70
132
 
71
- --only=only specify components to migrate/assess:
72
- dr (DataRaptors), ip (Integration Procedures),
73
- os (OmniScripts), fc (FlexCards)
133
+ --only=only specify any single components to migrate:
134
+ dm (Data Mappers),
135
+ ip (Integration Procedures),
136
+ os (Omniscripts),
137
+ fc (Flexcards),
138
+ autonumber (Omni Global Auto Numbers),
139
+ cl (Custom Labels)
140
+
141
+ --relatedobjects=relatedobjects(comma separated) specify one or more related objects to assess:
142
+ 'apex' for Apex classes
143
+ 'lwc' for LWC (Lightning Web Components)
144
+ 'expsites' for Experience Sites
145
+ 'flexipage' for FlexiPages
146
+ ```
147
+
148
+ ### Migrate Usage & parameters
74
149
 
75
- --relatedobjects=relatedobjects specify related objects to assess:
76
- 'apex' for Apex classes, 'lwc' for Lightning
77
- Web Components, or 'apex,lwc' for both types
78
150
  ```
151
+ USAGE
152
+ $ sf omnistudio:migration:migrate [-v <string>] [-u <string>] [--loglevel
153
+ trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
154
+
155
+ OPTIONS
156
+ -u, --targetusername=targetusername username or alias for the target
157
+ org; overrides default target org
79
158
 
80
- > **Note:** LWC (Lightning Web Components) migration functionality is temporarily disabled in the current version. This includes LWC migration, assessment, and report generation features. These features will be re-enabled in a future release. Apex migration functionality remains fully available. The `--relatedobjects` flag accepts all values ('apex', 'lwc', 'apex,lwc'), but LWC-related operations will not be executed.
159
+ -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
160
+ org; overrides default dev hub org
161
+
162
+ --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
163
+ this command invocation
164
+
165
+ -a, --allversions migrate all versions and not
166
+ and not just the active ones.
167
+
168
+ --only=only specify any single components to migrate:
169
+ dm (Data Mappers),
170
+ ip (Integration Procedures),
171
+ os (Omniscripts),
172
+ fc (Flexcards),
173
+ autonumber (Omni Global Auto Numbers),
174
+ cl (Custom Labels)
175
+
176
+ --relatedobjects=relatedobjects(comma separated) specify one or more related objects to assess:
177
+ 'apex' for Apex classes
178
+ 'lwc' for LWC (Lightning Web Components)
179
+ 'expsites' for Experience Sites
180
+ 'flexipage' for FlexiPages
181
+ ```
81
182
 
82
183
  Terms:
83
184
  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.
@@ -7,7 +7,6 @@ export default class Assess extends OmniStudioBaseCommand {
7
7
  name: string;
8
8
  }[];
9
9
  protected static flagsConfig: {
10
- namespace: flags.Discriminated<flags.String>;
11
10
  only: flags.Discriminated<flags.String>;
12
11
  allversions: flags.Discriminated<flags.Boolean<boolean>>;
13
12
  relatedobjects: flags.Discriminated<flags.String>;
@@ -19,5 +18,6 @@ export default class Assess extends OmniStudioBaseCommand {
19
18
  private assessDataRaptors;
20
19
  private assessFlexCards;
21
20
  private assessOmniScripts;
22
- private getProjectPath;
21
+ private assessGlobalAutoNumbers;
22
+ private assessCustomLabels;
23
23
  }
@@ -26,42 +26,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ const path_1 = __importDefault(require("path"));
29
30
  const os = __importStar(require("os"));
30
- const path = __importStar(require("path"));
31
- const fs = __importStar(require("fs"));
32
31
  const command_1 = require("@salesforce/command");
33
32
  const core_1 = require("@salesforce/core");
34
33
  const basecommand_1 = __importDefault(require("../../basecommand"));
35
34
  const assessmentReporter_1 = require("../../../utils/resultsbuilder/assessmentReporter");
36
35
  const omniscript_1 = require("../../../migration/omniscript");
36
+ const interfaces_1 = require("../../../migration/interfaces");
37
37
  const flexcard_1 = require("../../../migration/flexcard");
38
38
  const dataraptor_1 = require("../../../migration/dataraptor");
39
+ const globalautonumber_1 = require("../../../migration/globalautonumber");
39
40
  const utils_1 = require("../../../utils");
40
41
  const logger_1 = require("../../../utils/logger");
41
42
  const OmnistudioRelatedObjectMigrationFacade_1 = __importDefault(require("../../../migration/related/OmnistudioRelatedObjectMigrationFacade"));
42
43
  const orgUtils_1 = require("../../../utils/orgUtils");
43
44
  const orgPreferences_1 = require("../../../utils/orgPreferences");
44
45
  const stringContants_1 = require("../../../utils/constants/stringContants");
45
- const sfProject_1 = require("../../../utils/sfcli/project/sfProject");
46
- const promptUtil_1 = require("../../../utils/promptUtil");
46
+ const projectPathUtil_1 = require("../../../utils/projectPathUtil");
47
+ const premigrate_1 = require("../../../migration/premigrate");
48
+ const postMigrate_1 = require("../../../migration/postMigrate");
49
+ const customLabels_1 = require("../../../utils/customLabels");
50
+ const dataModelService_1 = require("../../../utils/dataModelService");
51
+ const validatorService_1 = require("../../../utils/validatorService");
47
52
  core_1.Messages.importMessagesDirectory(__dirname);
48
53
  const messages = core_1.Messages.loadMessages('@salesforce/plugin-omnistudio-migration-tool', 'assess');
49
- const EXISTING_MODE = 'existing';
50
- const EMPTY_MODE = 'empty';
51
- const YES_SHORT = 'y';
52
- const NO_SHORT = 'n';
53
- const YES_LONG = 'yes';
54
- const NO_LONG = 'no';
55
- // Helper to create SFDX project if needed
56
- function createSfdxProject(folderPath) {
57
- const projectName = path.basename(folderPath);
58
- const parentDir = path.dirname(folderPath);
59
- sfProject_1.sfProject.create(projectName, parentDir);
60
- }
61
- function isSfdxProject(folderPath) {
62
- const sfdxProjectJson = path.join(folderPath, 'sfdx-project.json');
63
- return fs.existsSync(sfdxProjectJson);
64
- }
65
54
  class Assess extends basecommand_1.default {
66
55
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
56
  async run() {
@@ -70,75 +59,99 @@ class Assess extends basecommand_1.default {
70
59
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
71
60
  return await this.runAssess();
72
61
  }
73
- catch (error) {
74
- logger_1.Logger.error('Error running assess');
75
- logger_1.Logger.error(error);
62
+ catch (e) {
63
+ const error = e;
64
+ logger_1.Logger.error(messages.getMessage('errorRunningAssess', [error.message]), error);
76
65
  process.exit(1);
77
66
  }
78
67
  }
79
68
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
80
69
  async runAssess() {
70
+ var _a;
81
71
  utils_1.DebugTimer.getInstance().start();
82
- let apiVersion = this.flags.apiversion;
83
72
  const allVersions = (this.flags.allversions || false);
84
73
  const assessOnly = (this.flags.only || '');
85
74
  const relatedObjects = (this.flags.relatedobjects || '');
75
+ const isExperienceBundleMetadataAPIProgramaticallyEnabled = { value: false };
86
76
  const conn = this.org.getConnection();
87
- if (apiVersion) {
88
- conn.setApiVersion(apiVersion);
89
- }
90
- else {
91
- apiVersion = conn.getApiVersion();
92
- }
93
- const orgs = await orgUtils_1.OrgUtils.getOrgDetails(conn, this.flags.namespace);
94
- if (!orgs.hasValidNamespace) {
95
- logger_1.Logger.warn(messages.getMessage('invalidNamespace') + orgs.packageDetails.namespace);
96
- }
97
- if (!orgs.packageDetails) {
98
- logger_1.Logger.error(messages.getMessage('noPackageInstalled'));
99
- return;
100
- }
101
- if (orgs.omniStudioOrgPermissionEnabled) {
102
- logger_1.Logger.error(messages.getMessage('alreadyStandardModel'));
77
+ let objectsToProcess;
78
+ // To-Do: Add LWC to valid options when GA is released
79
+ const validOptions = [stringContants_1.Constants.Apex, stringContants_1.Constants.ExpSites, stringContants_1.Constants.FlexiPage, stringContants_1.Constants.LWC];
80
+ const apiVersion = conn.getApiVersion();
81
+ const orgs = await orgUtils_1.OrgUtils.getOrgDetails(conn);
82
+ // Initialize global data model service
83
+ (0, dataModelService_1.initializeDataModelService)(orgs);
84
+ // Perform comprehensive validation using ValidatorService
85
+ const validator = new validatorService_1.ValidatorService(orgs, messages, conn);
86
+ const isValidationPassed = await validator.validate();
87
+ if (!isValidationPassed) {
103
88
  return;
104
89
  }
105
90
  const namespace = orgs.packageDetails.namespace;
106
91
  let projectPath = '';
92
+ const preMigrate = new premigrate_1.PreMigrate(namespace, conn, this.logger, messages, this.ux);
107
93
  if (relatedObjects) {
108
- projectPath = await this.getProjectPath();
94
+ objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
95
+ projectPath = await projectPathUtil_1.ProjectPathUtil.getProjectPath(messages, true);
96
+ await preMigrate.handleExperienceSitePrerequisites(objectsToProcess, conn, isExperienceBundleMetadataAPIProgramaticallyEnabled);
109
97
  }
110
98
  const assesmentInfo = {
111
99
  lwcAssessmentInfos: [],
112
100
  apexAssessmentInfos: [],
113
101
  dataRaptorAssessmentInfos: [],
114
102
  flexCardAssessmentInfos: [],
103
+ globalAutoNumberAssessmentInfos: [],
115
104
  omniAssessmentInfo: {
116
105
  osAssessmentInfos: [],
117
106
  ipAssessmentInfos: [],
118
107
  },
108
+ flexipageAssessmentInfos: [],
109
+ experienceSiteAssessmentInfos: [],
110
+ customLabelAssessmentInfos: [],
111
+ customLabelStatistics: {
112
+ totalLabels: 0,
113
+ readyForMigration: 0,
114
+ needManualIntervention: 0,
115
+ warnings: 0,
116
+ failed: 0,
117
+ },
119
118
  };
120
119
  logger_1.Logger.log(messages.getMessage('assessmentInitialization', [String(namespace)]));
121
- logger_1.Logger.logVerbose(messages.getMessage('apiVersionInfo', [String(apiVersion)]));
120
+ logger_1.Logger.log(messages.getMessage('apiVersionInfo', [String(apiVersion)]));
122
121
  logger_1.Logger.logVerbose(messages.getMessage('assessmentTargets', [String(this.flags.only || 'all')]));
123
122
  logger_1.Logger.logVerbose(messages.getMessage('relatedObjectsInfo', [relatedObjects || 'none']));
124
123
  logger_1.Logger.logVerbose(messages.getMessage('allVersionsFlagInfo', [String(allVersions)]));
125
- // Assess OmniStudio components
126
- await this.assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions);
127
- let objectsToProcess;
124
+ try {
125
+ // Assess OmniStudio components
126
+ await this.assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions);
127
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
+ }
129
+ catch (ex) {
130
+ if (ex instanceof interfaces_1.InvalidEntityTypeError) {
131
+ logger_1.Logger.error(messages.getMessage('invalidTypeAssessErrorMessage', [namespace]));
132
+ process.exit(1);
133
+ }
134
+ if (ex instanceof Error) {
135
+ logger_1.Logger.error(messages.getMessage('errorRunningAssess', [ex.message]));
136
+ process.exit(1);
137
+ }
138
+ }
128
139
  // Assess related objects if specified
129
140
  if (relatedObjects) {
130
- const validOptions = [stringContants_1.Constants.Apex, stringContants_1.Constants.LWC];
131
141
  objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
132
142
  // Validate input
133
143
  for (const obj of objectsToProcess) {
134
144
  if (!validOptions.includes(obj)) {
135
- logger_1.Logger.warn(messages.getMessage('invalidRelatedObjectsOption', [String(obj)]));
145
+ logger_1.Logger.error(messages.getMessage('invalidRelatedObjectsOption', [String(obj)]));
146
+ process.exit(1);
136
147
  }
137
148
  }
138
149
  const omnistudioRelatedObjectsMigration = new OmnistudioRelatedObjectMigrationFacade_1.default(namespace, assessOnly, allVersions, this.org, projectPath);
139
150
  const relatedObjectAssessmentResult = omnistudioRelatedObjectsMigration.assessAll(objectsToProcess);
140
151
  assesmentInfo.lwcAssessmentInfos = relatedObjectAssessmentResult.lwcAssessmentInfos;
141
152
  assesmentInfo.apexAssessmentInfos = relatedObjectAssessmentResult.apexAssessmentInfos;
153
+ assesmentInfo.flexipageAssessmentInfos = relatedObjectAssessmentResult.flexipageAssessmentInfos;
154
+ assesmentInfo.experienceSiteAssessmentInfos = relatedObjectAssessmentResult.experienceSiteAssessmentInfos;
142
155
  }
143
156
  try {
144
157
  orgs.rollbackFlags = await orgPreferences_1.OrgPreferences.checkRollbackFlags(conn);
@@ -147,7 +160,15 @@ class Assess extends basecommand_1.default {
147
160
  logger_1.Logger.log(error.message);
148
161
  logger_1.Logger.log(error.stack);
149
162
  }
150
- await assessmentReporter_1.AssessmentReporter.generate(assesmentInfo, conn.instanceUrl, orgs, assessOnly, objectsToProcess, messages);
163
+ // Post Assessment tasks
164
+ const postMigrate = new postMigrate_1.PostMigrate(this.org, namespace, conn, this.logger, messages, this.ux, objectsToProcess);
165
+ const userActionMessages = [];
166
+ await postMigrate.restoreExperienceAPIMetadataSettings(isExperienceBundleMetadataAPIProgramaticallyEnabled, userActionMessages);
167
+ await assessmentReporter_1.AssessmentReporter.generate(assesmentInfo, conn.instanceUrl, orgs, assessOnly, objectsToProcess, messages, userActionMessages);
168
+ logger_1.Logger.log(messages.getMessage('assessmentSuccessfulMessage', [
169
+ (_a = orgs.orgDetails) === null || _a === void 0 ? void 0 : _a.Id,
170
+ path_1.default.join(process.cwd(), stringContants_1.Constants.AssessmentReportsFolderName),
171
+ ]));
151
172
  return assesmentInfo;
152
173
  }
153
174
  async assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions) {
@@ -155,7 +176,10 @@ class Assess extends basecommand_1.default {
155
176
  // If no specific component is specified, assess all components
156
177
  await this.assessDataRaptors(assesmentInfo, namespace, conn);
157
178
  await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions);
158
- await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.All);
179
+ await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.OS);
180
+ await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.IP);
181
+ await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
182
+ await this.assessCustomLabels(assesmentInfo, namespace, conn);
159
183
  return;
160
184
  }
161
185
  switch (assessOnly) {
@@ -171,6 +195,12 @@ class Assess extends basecommand_1.default {
171
195
  case stringContants_1.Constants.IntegrationProcedure:
172
196
  await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.IP);
173
197
  break;
198
+ case stringContants_1.Constants.GlobalAutoNumber:
199
+ await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
200
+ break;
201
+ case stringContants_1.Constants.CustomLabel:
202
+ await this.assessCustomLabels(assesmentInfo, namespace, conn);
203
+ break;
174
204
  default:
175
205
  throw new Error(messages.getMessage('invalidOnlyFlag'));
176
206
  }
@@ -189,79 +219,58 @@ class Assess extends basecommand_1.default {
189
219
  logger_1.Logger.log(messages.getMessage('flexCardAssessmentCompleted'));
190
220
  }
191
221
  async assessOmniScripts(assesmentInfo, namespace, conn, allVersions, exportType) {
192
- logger_1.Logger.logVerbose(messages.getMessage('omniScriptAssessment'));
222
+ const exportComponentType = exportType === omniscript_1.OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
223
+ logger_1.Logger.logVerbose(messages.getMessage('omniScriptAssessment', [exportComponentType]));
193
224
  const osMigrator = new omniscript_1.OmniScriptMigrationTool(exportType, namespace, conn, logger_1.Logger, messages, this.ux, allVersions);
194
- assesmentInfo.omniAssessmentInfo = await osMigrator.assess(assesmentInfo.dataRaptorAssessmentInfos, assesmentInfo.flexCardAssessmentInfos);
195
- logger_1.Logger.logVerbose(messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length]));
196
- logger_1.Logger.logVerbose(messages.getMessage('assessedIntegrationProceduresCount', [
197
- assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
198
- ]));
199
- logger_1.Logger.log(messages.getMessage('omniScriptAssessmentCompleted'));
225
+ const newOmniAssessmentInfo = await osMigrator.assess(assesmentInfo.dataRaptorAssessmentInfos, assesmentInfo.flexCardAssessmentInfos);
226
+ // Initialize omniAssessmentInfo if it doesn't exist
227
+ if (!assesmentInfo.omniAssessmentInfo) {
228
+ assesmentInfo.omniAssessmentInfo = {
229
+ osAssessmentInfos: [],
230
+ ipAssessmentInfos: [],
231
+ };
232
+ }
233
+ // Merge results instead of overwriting
234
+ if (exportType === omniscript_1.OmniScriptExportType.OS) {
235
+ // For OmniScript assessment, update osAssessmentInfos
236
+ assesmentInfo.omniAssessmentInfo.osAssessmentInfos = newOmniAssessmentInfo.osAssessmentInfos;
237
+ logger_1.Logger.logVerbose(messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length]));
238
+ }
239
+ else {
240
+ // For Integration Procedure assessment, update ipAssessmentInfos
241
+ assesmentInfo.omniAssessmentInfo.ipAssessmentInfos = newOmniAssessmentInfo.ipAssessmentInfos;
242
+ logger_1.Logger.logVerbose(messages.getMessage('assessedIntegrationProceduresCount', [
243
+ assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
244
+ ]));
245
+ }
246
+ logger_1.Logger.log(messages.getMessage('omniScriptAssessmentCompleted', [exportComponentType]));
200
247
  }
201
- async getProjectPath() {
202
- let projectPath = '';
203
- let mode = EXISTING_MODE;
204
- // Prompt for project type
205
- const askWithTimeout = promptUtil_1.PromptUtil.askWithTimeOut(messages);
206
- // Prompt: Existing project?
207
- let response = '';
208
- let validResponse = false;
209
- while (!validResponse) {
210
- try {
211
- const resp = await askWithTimeout(logger_1.Logger.prompt.bind(logger_1.Logger), messages.getMessage('existingApexPrompt'));
212
- response = typeof resp === 'string' ? resp.trim().toLowerCase() : '';
213
- }
214
- catch (err) {
215
- logger_1.Logger.error(messages.getMessage('requestTimedOut'));
216
- process.exit(1);
217
- }
218
- if (response === YES_SHORT || response === YES_LONG) {
219
- mode = EXISTING_MODE;
220
- validResponse = true;
221
- }
222
- else if (response === NO_SHORT || response === NO_LONG) {
223
- mode = EMPTY_MODE;
224
- validResponse = true;
225
- }
226
- else {
227
- logger_1.Logger.error(messages.getMessage('invalidYesNoResponse'));
228
- }
248
+ async assessGlobalAutoNumbers(assesmentInfo, namespace, conn) {
249
+ logger_1.Logger.logVerbose(messages.getMessage('startingGlobalAutoNumberAssessment'));
250
+ const globalAutoNumberMigrationTool = new globalautonumber_1.GlobalAutoNumberMigrationTool(namespace, conn, logger_1.Logger, messages, this.ux);
251
+ assesmentInfo.globalAutoNumberAssessmentInfos = await globalAutoNumberMigrationTool.assess();
252
+ logger_1.Logger.logVerbose(messages.getMessage('assessedGlobalAutoNumbersCount', [assesmentInfo.globalAutoNumberAssessmentInfos.length]));
253
+ logger_1.Logger.log(messages.getMessage('globalAutoNumberAssessmentCompleted'));
254
+ }
255
+ async assessCustomLabels(assesmentInfo, namespace, conn) {
256
+ try {
257
+ logger_1.Logger.log(messages.getMessage('startingCustomLabelAssessment'));
258
+ const customLabelResult = await customLabels_1.CustomLabelsUtil.fetchCustomLabels(conn, namespace, messages);
259
+ assesmentInfo.customLabelAssessmentInfos = customLabelResult.labels;
260
+ assesmentInfo.customLabelStatistics = customLabelResult.statistics;
261
+ logger_1.Logger.log(messages.getMessage('customLabelAssessmentCompleted'));
229
262
  }
230
- // Prompt for project path
231
- let gotValidPath = false;
232
- while (!gotValidPath) {
233
- let folderPath = '';
234
- try {
235
- const resp = await askWithTimeout(logger_1.Logger.prompt.bind(logger_1.Logger), mode === EXISTING_MODE
236
- ? messages.getMessage('enterExistingProjectPath')
237
- : messages.getMessage('enterEmptyProjectPath'));
238
- folderPath = typeof resp === 'string' ? resp.trim() : '';
239
- }
240
- catch (err) {
241
- logger_1.Logger.error(messages.getMessage('requestTimedOut'));
242
- process.exit(1);
243
- }
244
- folderPath = path.resolve(folderPath);
245
- if (!fs.existsSync(folderPath) || !fs.lstatSync(folderPath).isDirectory()) {
246
- logger_1.Logger.error(messages.getMessage('invalidProjectFolderPath'));
247
- continue;
248
- }
249
- if (mode === EMPTY_MODE && fs.readdirSync(folderPath).length > 0) {
250
- logger_1.Logger.error(messages.getMessage('notEmptyProjectFolderPath'));
251
- continue;
252
- }
253
- // If empty, create SFDX project
254
- if (mode === EMPTY_MODE) {
255
- createSfdxProject(folderPath);
256
- }
257
- else if (!isSfdxProject(folderPath)) {
258
- logger_1.Logger.error(messages.getMessage('notSfdxProjectFolderPath'));
259
- continue;
260
- }
261
- projectPath = folderPath;
262
- gotValidPath = true;
263
+ catch (error) {
264
+ logger_1.Logger.error(messages.getMessage('errorDuringCustomLabelAssessment', [error.message]));
265
+ assesmentInfo.customLabelAssessmentInfos = [];
266
+ assesmentInfo.customLabelStatistics = {
267
+ totalLabels: 0,
268
+ readyForMigration: 0,
269
+ needManualIntervention: 0,
270
+ warnings: 0,
271
+ failed: 0,
272
+ };
263
273
  }
264
- return projectPath;
265
274
  }
266
275
  }
267
276
  exports.default = Assess;
@@ -269,10 +278,6 @@ Assess.description = messages.getMessage('commandDescription');
269
278
  Assess.examples = messages.getMessage('examples').split(os.EOL);
270
279
  Assess.args = [{ name: 'file' }];
271
280
  Assess.flagsConfig = {
272
- namespace: command_1.flags.string({
273
- char: 'n',
274
- description: messages.getMessage('namespaceFlagDescription'),
275
- }),
276
281
  only: command_1.flags.string({
277
282
  char: 'o',
278
283
  description: messages.getMessage('onlyFlagDescription'),
@@ -284,7 +289,7 @@ Assess.flagsConfig = {
284
289
  }),
285
290
  relatedobjects: command_1.flags.string({
286
291
  char: 'r',
287
- description: messages.getMessage('apexLwc'),
292
+ description: messages.getMessage('relatedObjectGA'),
288
293
  }),
289
294
  verbose: command_1.flags.builtin({
290
295
  type: 'builtin',