@salesforce/plugin-omnistudio-migration-tool 2.0.0-beta.8 → 2.0.0-dev.0
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.
- package/README.md +137 -36
- package/lib/commands/omnistudio/migration/assess.d.ts +2 -2
- package/lib/commands/omnistudio/migration/assess.js +143 -124
- package/lib/commands/omnistudio/migration/assess.js.map +1 -1
- package/lib/commands/omnistudio/migration/info.js +2 -3
- package/lib/commands/omnistudio/migration/info.js.map +1 -1
- package/lib/commands/omnistudio/migration/migrate.d.ts +37 -4
- package/lib/commands/omnistudio/migration/migrate.js +378 -118
- package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
- package/lib/error/deploymentErrors.d.ts +15 -0
- package/lib/error/deploymentErrors.js +35 -0
- package/lib/error/deploymentErrors.js.map +1 -0
- package/lib/error/errorInterfaces.d.ts +14 -0
- package/lib/error/errorInterfaces.js +27 -0
- package/lib/error/errorInterfaces.js.map +1 -0
- package/lib/javascripts/reportGeneratorUtility.js +405 -25
- package/lib/mappings/GlobalAutoNumber.d.ts +10 -0
- package/lib/mappings/GlobalAutoNumber.js +14 -0
- package/lib/mappings/GlobalAutoNumber.js.map +1 -0
- package/lib/migration/NameMappingRegistry.d.ts +134 -0
- package/lib/migration/NameMappingRegistry.js +411 -0
- package/lib/migration/NameMappingRegistry.js.map +1 -0
- package/lib/migration/base.d.ts +7 -4
- package/lib/migration/base.js +34 -7
- package/lib/migration/base.js.map +1 -1
- package/lib/migration/customLabels.d.ts +70 -0
- package/lib/migration/customLabels.js +166 -0
- package/lib/migration/customLabels.js.map +1 -0
- package/lib/migration/dataraptor.d.ts +13 -0
- package/lib/migration/dataraptor.js +208 -82
- package/lib/migration/dataraptor.js.map +1 -1
- package/lib/migration/deployer.d.ts +14 -0
- package/lib/migration/deployer.js +95 -0
- package/lib/migration/deployer.js.map +1 -0
- package/lib/migration/flexcard.d.ts +67 -3
- package/lib/migration/flexcard.js +1017 -169
- package/lib/migration/flexcard.js.map +1 -1
- package/lib/migration/globalautonumber.d.ts +60 -0
- package/lib/migration/globalautonumber.js +341 -0
- package/lib/migration/globalautonumber.js.map +1 -0
- package/lib/migration/interfaces.d.ts +101 -0
- package/lib/migration/interfaces.js +7 -0
- package/lib/migration/interfaces.js.map +1 -1
- package/lib/migration/omniscript.d.ts +60 -1
- package/lib/migration/omniscript.js +1138 -186
- package/lib/migration/omniscript.js.map +1 -1
- package/lib/migration/postMigrate.d.ts +29 -0
- package/lib/migration/postMigrate.js +221 -0
- package/lib/migration/postMigrate.js.map +1 -0
- package/lib/migration/premigrate.d.ts +49 -0
- package/lib/migration/premigrate.js +271 -0
- package/lib/migration/premigrate.js.map +1 -0
- package/lib/migration/related/ApexMigration.d.ts +3 -0
- package/lib/migration/related/ApexMigration.js +206 -53
- package/lib/migration/related/ApexMigration.js.map +1 -1
- package/lib/migration/related/ExperienceSiteMigration.d.ts +42 -0
- package/lib/migration/related/ExperienceSiteMigration.js +389 -0
- package/lib/migration/related/ExperienceSiteMigration.js.map +1 -0
- package/lib/migration/related/FlexipageMigration.d.ts +84 -0
- package/lib/migration/related/FlexipageMigration.js +220 -0
- package/lib/migration/related/FlexipageMigration.js.map +1 -0
- package/lib/migration/related/LwcMigration.js +30 -24
- package/lib/migration/related/LwcMigration.js.map +1 -1
- package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.d.ts +4 -0
- package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js +46 -25
- package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js.map +1 -1
- package/lib/styles/reportGenerator.css +261 -22
- package/lib/templates/assessmentReport.template +111 -40
- package/lib/templates/dashboard.template +86 -52
- package/lib/templates/migrationReport.template +180 -27
- package/lib/utils/OmnistudioSettingsPrefManager.d.ts +14 -0
- package/lib/utils/OmnistudioSettingsPrefManager.js +112 -0
- package/lib/utils/OmnistudioSettingsPrefManager.js.map +1 -0
- package/lib/utils/XMLUtil.d.ts +34 -0
- package/lib/utils/XMLUtil.js +172 -0
- package/lib/utils/XMLUtil.js.map +1 -0
- package/lib/utils/apex/parser/apexparser.d.ts +8 -1
- package/lib/utils/apex/parser/apexparser.js +77 -11
- package/lib/utils/apex/parser/apexparser.js.map +1 -1
- package/lib/utils/config/OmniStudioMetadataCleanupService.d.ts +36 -0
- package/lib/utils/config/OmniStudioMetadataCleanupService.js +117 -0
- package/lib/utils/config/OmniStudioMetadataCleanupService.js.map +1 -0
- package/lib/utils/constants/documentRegistry.d.ts +21 -0
- package/lib/utils/constants/documentRegistry.js +25 -0
- package/lib/utils/constants/documentRegistry.js.map +1 -0
- package/lib/utils/constants/stringContants.d.ts +21 -0
- package/lib/utils/constants/stringContants.js +26 -2
- package/lib/utils/constants/stringContants.js.map +1 -1
- package/lib/utils/customLabels.d.ts +34 -0
- package/lib/utils/customLabels.js +97 -0
- package/lib/utils/customLabels.js.map +1 -0
- package/lib/utils/dataModelService.d.ts +14 -0
- package/lib/utils/dataModelService.js +74 -0
- package/lib/utils/dataModelService.js.map +1 -0
- package/lib/utils/file/fileUtil.d.ts +3 -0
- package/lib/utils/file/fileUtil.js +34 -0
- package/lib/utils/file/fileUtil.js.map +1 -1
- package/lib/utils/flexipage/flexiPageTransformer.d.ts +17 -0
- package/lib/utils/flexipage/flexiPageTransformer.js +218 -0
- package/lib/utils/flexipage/flexiPageTransformer.js.map +1 -0
- package/lib/utils/formula/FormulaUtil.d.ts +1 -1
- package/lib/utils/formula/FormulaUtil.js +13 -4
- package/lib/utils/formula/FormulaUtil.js.map +1 -1
- package/lib/utils/generatePackageXml.d.ts +5 -2
- package/lib/utils/generatePackageXml.js +27 -22
- package/lib/utils/generatePackageXml.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/interfaces.d.ts +94 -2
- package/lib/utils/logger.d.ts +2 -2
- package/lib/utils/logger.js +7 -3
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/lwcparser/fileutils/FileDiffUtil.d.ts +2 -1
- package/lib/utils/lwcparser/fileutils/FileDiffUtil.js +103 -49
- package/lib/utils/lwcparser/fileutils/FileDiffUtil.js.map +1 -1
- package/lib/utils/lwcparser/htmlParser/HTMLParser.js +12 -3
- package/lib/utils/lwcparser/htmlParser/HTMLParser.js.map +1 -1
- package/lib/utils/lwcparser/jsParser/JavaScriptParser.js +12 -4
- package/lib/utils/lwcparser/jsParser/JavaScriptParser.js.map +1 -1
- package/lib/utils/lwcparser/xmlParser/XmlParser.js +3 -2
- package/lib/utils/lwcparser/xmlParser/XmlParser.js.map +1 -1
- package/lib/utils/net/index.d.ts +5 -0
- package/lib/utils/net/index.js +52 -16
- package/lib/utils/net/index.js.map +1 -1
- package/lib/utils/omniscriptPackageManager.d.ts +31 -0
- package/lib/utils/omniscriptPackageManager.js +205 -0
- package/lib/utils/omniscriptPackageManager.js.map +1 -0
- package/lib/utils/orgPreferences.d.ts +37 -0
- package/lib/utils/orgPreferences.js +143 -0
- package/lib/utils/orgPreferences.js.map +1 -1
- package/lib/utils/orgUtils/index.d.ts +4 -5
- package/lib/utils/orgUtils/index.js +29 -24
- package/lib/utils/orgUtils/index.js.map +1 -1
- package/lib/utils/projectPathUtil.d.ts +39 -0
- package/lib/utils/projectPathUtil.js +173 -0
- package/lib/utils/projectPathUtil.js.map +1 -0
- package/lib/utils/promptUtil.d.ts +2 -0
- package/lib/utils/promptUtil.js +26 -1
- package/lib/utils/promptUtil.js.map +1 -1
- package/lib/utils/recordPrioritization.d.ts +44 -0
- package/lib/utils/recordPrioritization.js +70 -0
- package/lib/utils/recordPrioritization.js.map +1 -0
- package/lib/utils/reportGenerator/reportInterfaces.d.ts +15 -0
- package/lib/utils/reportGenerator/reportUtil.d.ts +6 -1
- package/lib/utils/reportGenerator/reportUtil.js +24 -4
- package/lib/utils/reportGenerator/reportUtil.js.map +1 -1
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.d.ts +1 -0
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.js +52 -18
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.d.ts +13 -0
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js +179 -0
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.d.ts +27 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js +262 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/DRAssessmentReporter.js +56 -65
- package/lib/utils/resultsbuilder/DRAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.d.ts +14 -0
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js +143 -0
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +57 -64
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.d.ts +56 -0
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js +155 -0
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.d.ts +14 -0
- package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js +156 -0
- package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/IPAssessmentReporter.js +52 -65
- package/lib/utils/resultsbuilder/IPAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.d.ts +14 -0
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.js +143 -139
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/OSAssessmentReporter.js +55 -93
- package/lib/utils/resultsbuilder/OSAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/assessmentReporter.d.ts +8 -1
- package/lib/utils/resultsbuilder/assessmentReporter.js +195 -55
- package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/index.d.ts +21 -1
- package/lib/utils/resultsbuilder/index.js +566 -82
- package/lib/utils/resultsbuilder/index.js.map +1 -1
- package/lib/utils/resultsbuilder/reportingHelper.d.ts +3 -6
- package/lib/utils/resultsbuilder/reportingHelper.js +4 -29
- package/lib/utils/resultsbuilder/reportingHelper.js.map +1 -1
- package/lib/utils/sfcli/project/sfProject.d.ts +28 -0
- package/lib/utils/sfcli/project/sfProject.js +206 -2
- package/lib/utils/sfcli/project/sfProject.js.map +1 -1
- package/lib/utils/shell/cli.js +3 -7
- package/lib/utils/shell/cli.js.map +1 -1
- package/lib/utils/storageUtil.d.ts +22 -0
- package/lib/utils/storageUtil.js +88 -0
- package/lib/utils/storageUtil.js.map +1 -0
- package/lib/utils/stringUtils.d.ts +10 -0
- package/lib/utils/stringUtils.js +53 -1
- package/lib/utils/stringUtils.js.map +1 -1
- package/lib/utils/templateParser/model/elementNode.js +11 -2
- package/lib/utils/templateParser/model/elementNode.js.map +1 -1
- package/lib/utils/validatorService.d.ts +14 -0
- package/lib/utils/validatorService.js +140 -0
- package/lib/utils/validatorService.js.map +1 -0
- package/messages/assess.json +199 -88
- package/messages/info.json +2 -1
- package/messages/migrate.json +296 -67
- package/oclif.manifest.json +1 -1
- package/package.json +41 -7
- package/lib/utils/constants/callToActionMessages.d.ts +0 -35
- package/lib/utils/constants/callToActionMessages.js +0 -39
- package/lib/utils/constants/callToActionMessages.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,83 +1,184 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Omnistudio Migration Assistant
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
## 🚀 Before You Begin
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
⚠️ IMPORTANT: Before installing and using the Omnistudio Migration Assistant, contact Salesforce support.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
37
|
+
sf plugins install @salesforce/plugin-omnistudio-migration-tool@2.0.0-dev.1
|
|
15
38
|
```
|
|
16
39
|
|
|
17
|
-
4.
|
|
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:
|
|
27
|
-
--only=
|
|
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
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
$
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
46
|
-
const
|
|
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,103 @@ 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 (
|
|
74
|
-
|
|
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
|
|
83
|
-
const allVersions = (this.flags.allversions || false);
|
|
72
|
+
let 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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (!
|
|
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);
|
|
93
|
+
// Handle all versions prerequisite for standard data model
|
|
94
|
+
if ((0, dataModelService_1.isStandardDataModel)()) {
|
|
95
|
+
allVersions = await preMigrate.handleAllVersionsPrerequisites(allVersions);
|
|
96
|
+
}
|
|
107
97
|
if (relatedObjects) {
|
|
108
|
-
|
|
98
|
+
objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
|
|
99
|
+
projectPath = await projectPathUtil_1.ProjectPathUtil.getProjectPath(messages, true);
|
|
100
|
+
await preMigrate.handleExperienceSitePrerequisites(objectsToProcess, conn, isExperienceBundleMetadataAPIProgramaticallyEnabled);
|
|
109
101
|
}
|
|
110
102
|
const assesmentInfo = {
|
|
111
103
|
lwcAssessmentInfos: [],
|
|
112
104
|
apexAssessmentInfos: [],
|
|
113
105
|
dataRaptorAssessmentInfos: [],
|
|
114
106
|
flexCardAssessmentInfos: [],
|
|
107
|
+
globalAutoNumberAssessmentInfos: [],
|
|
115
108
|
omniAssessmentInfo: {
|
|
116
109
|
osAssessmentInfos: [],
|
|
117
110
|
ipAssessmentInfos: [],
|
|
118
111
|
},
|
|
112
|
+
flexipageAssessmentInfos: [],
|
|
113
|
+
experienceSiteAssessmentInfos: [],
|
|
114
|
+
customLabelAssessmentInfos: [],
|
|
115
|
+
customLabelStatistics: {
|
|
116
|
+
totalLabels: 0,
|
|
117
|
+
readyForMigration: 0,
|
|
118
|
+
needManualIntervention: 0,
|
|
119
|
+
warnings: 0,
|
|
120
|
+
failed: 0,
|
|
121
|
+
},
|
|
119
122
|
};
|
|
120
123
|
logger_1.Logger.log(messages.getMessage('assessmentInitialization', [String(namespace)]));
|
|
121
|
-
logger_1.Logger.
|
|
124
|
+
logger_1.Logger.log(messages.getMessage('apiVersionInfo', [String(apiVersion)]));
|
|
122
125
|
logger_1.Logger.logVerbose(messages.getMessage('assessmentTargets', [String(this.flags.only || 'all')]));
|
|
123
126
|
logger_1.Logger.logVerbose(messages.getMessage('relatedObjectsInfo', [relatedObjects || 'none']));
|
|
124
127
|
logger_1.Logger.logVerbose(messages.getMessage('allVersionsFlagInfo', [String(allVersions)]));
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
try {
|
|
129
|
+
// Assess OmniStudio components
|
|
130
|
+
await this.assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions);
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
|
+
}
|
|
133
|
+
catch (ex) {
|
|
134
|
+
if (ex instanceof interfaces_1.InvalidEntityTypeError) {
|
|
135
|
+
logger_1.Logger.error(messages.getMessage('invalidTypeAssessErrorMessage', [namespace]));
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
if (ex instanceof Error) {
|
|
139
|
+
logger_1.Logger.error(messages.getMessage('errorRunningAssess', [ex.message]));
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
128
143
|
// Assess related objects if specified
|
|
129
144
|
if (relatedObjects) {
|
|
130
|
-
const validOptions = [stringContants_1.Constants.Apex, stringContants_1.Constants.LWC];
|
|
131
145
|
objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
|
|
132
146
|
// Validate input
|
|
133
147
|
for (const obj of objectsToProcess) {
|
|
134
148
|
if (!validOptions.includes(obj)) {
|
|
135
|
-
logger_1.Logger.
|
|
149
|
+
logger_1.Logger.error(messages.getMessage('invalidRelatedObjectsOption', [String(obj)]));
|
|
150
|
+
process.exit(1);
|
|
136
151
|
}
|
|
137
152
|
}
|
|
138
153
|
const omnistudioRelatedObjectsMigration = new OmnistudioRelatedObjectMigrationFacade_1.default(namespace, assessOnly, allVersions, this.org, projectPath);
|
|
139
154
|
const relatedObjectAssessmentResult = omnistudioRelatedObjectsMigration.assessAll(objectsToProcess);
|
|
140
155
|
assesmentInfo.lwcAssessmentInfos = relatedObjectAssessmentResult.lwcAssessmentInfos;
|
|
141
156
|
assesmentInfo.apexAssessmentInfos = relatedObjectAssessmentResult.apexAssessmentInfos;
|
|
157
|
+
assesmentInfo.flexipageAssessmentInfos = relatedObjectAssessmentResult.flexipageAssessmentInfos;
|
|
158
|
+
assesmentInfo.experienceSiteAssessmentInfos = relatedObjectAssessmentResult.experienceSiteAssessmentInfos;
|
|
142
159
|
}
|
|
143
160
|
try {
|
|
144
161
|
orgs.rollbackFlags = await orgPreferences_1.OrgPreferences.checkRollbackFlags(conn);
|
|
@@ -147,7 +164,15 @@ class Assess extends basecommand_1.default {
|
|
|
147
164
|
logger_1.Logger.log(error.message);
|
|
148
165
|
logger_1.Logger.log(error.stack);
|
|
149
166
|
}
|
|
150
|
-
|
|
167
|
+
// Post Assessment tasks
|
|
168
|
+
const postMigrate = new postMigrate_1.PostMigrate(this.org, namespace, conn, this.logger, messages, this.ux, objectsToProcess);
|
|
169
|
+
const userActionMessages = [];
|
|
170
|
+
await postMigrate.restoreExperienceAPIMetadataSettings(isExperienceBundleMetadataAPIProgramaticallyEnabled, userActionMessages);
|
|
171
|
+
await assessmentReporter_1.AssessmentReporter.generate(assesmentInfo, conn.instanceUrl, orgs, assessOnly, objectsToProcess, messages, userActionMessages);
|
|
172
|
+
logger_1.Logger.log(messages.getMessage('assessmentSuccessfulMessage', [
|
|
173
|
+
(_a = orgs.orgDetails) === null || _a === void 0 ? void 0 : _a.Id,
|
|
174
|
+
path_1.default.join(process.cwd(), stringContants_1.Constants.AssessmentReportsFolderName),
|
|
175
|
+
]));
|
|
151
176
|
return assesmentInfo;
|
|
152
177
|
}
|
|
153
178
|
async assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions) {
|
|
@@ -155,7 +180,12 @@ class Assess extends basecommand_1.default {
|
|
|
155
180
|
// If no specific component is specified, assess all components
|
|
156
181
|
await this.assessDataRaptors(assesmentInfo, namespace, conn);
|
|
157
182
|
await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions);
|
|
158
|
-
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.
|
|
183
|
+
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.OS);
|
|
184
|
+
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.IP);
|
|
185
|
+
if (!(0, dataModelService_1.isFoundationPackage)()) {
|
|
186
|
+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
|
|
187
|
+
}
|
|
188
|
+
await this.assessCustomLabels(assesmentInfo, namespace, conn);
|
|
159
189
|
return;
|
|
160
190
|
}
|
|
161
191
|
switch (assessOnly) {
|
|
@@ -171,6 +201,17 @@ class Assess extends basecommand_1.default {
|
|
|
171
201
|
case stringContants_1.Constants.IntegrationProcedure:
|
|
172
202
|
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, omniscript_1.OmniScriptExportType.IP);
|
|
173
203
|
break;
|
|
204
|
+
case stringContants_1.Constants.GlobalAutoNumber:
|
|
205
|
+
if (!(0, dataModelService_1.isFoundationPackage)()) {
|
|
206
|
+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
logger_1.Logger.warn(messages.getMessage('globalAutoNumberUnSupportedInOmnistudioPackage'));
|
|
210
|
+
}
|
|
211
|
+
break;
|
|
212
|
+
case stringContants_1.Constants.CustomLabel:
|
|
213
|
+
await this.assessCustomLabels(assesmentInfo, namespace, conn);
|
|
214
|
+
break;
|
|
174
215
|
default:
|
|
175
216
|
throw new Error(messages.getMessage('invalidOnlyFlag'));
|
|
176
217
|
}
|
|
@@ -189,79 +230,61 @@ class Assess extends basecommand_1.default {
|
|
|
189
230
|
logger_1.Logger.log(messages.getMessage('flexCardAssessmentCompleted'));
|
|
190
231
|
}
|
|
191
232
|
async assessOmniScripts(assesmentInfo, namespace, conn, allVersions, exportType) {
|
|
192
|
-
|
|
233
|
+
const exportComponentType = exportType === omniscript_1.OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
|
|
234
|
+
logger_1.Logger.logVerbose(messages.getMessage('omniScriptAssessment', [exportComponentType]));
|
|
193
235
|
const osMigrator = new omniscript_1.OmniScriptMigrationTool(exportType, namespace, conn, logger_1.Logger, messages, this.ux, allVersions);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
assesmentInfo.omniAssessmentInfo
|
|
198
|
-
|
|
199
|
-
|
|
236
|
+
const newOmniAssessmentInfo = await osMigrator.assess(assesmentInfo.dataRaptorAssessmentInfos, assesmentInfo.flexCardAssessmentInfos);
|
|
237
|
+
// Initialize omniAssessmentInfo if it doesn't exist
|
|
238
|
+
if (!assesmentInfo.omniAssessmentInfo) {
|
|
239
|
+
assesmentInfo.omniAssessmentInfo = {
|
|
240
|
+
osAssessmentInfos: [],
|
|
241
|
+
ipAssessmentInfos: [],
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
// Merge results instead of overwriting
|
|
245
|
+
if (exportType === omniscript_1.OmniScriptExportType.OS) {
|
|
246
|
+
// For OmniScript assessment, update osAssessmentInfos
|
|
247
|
+
assesmentInfo.omniAssessmentInfo.osAssessmentInfos = newOmniAssessmentInfo.osAssessmentInfos;
|
|
248
|
+
logger_1.Logger.logVerbose(messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length]));
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
// For Integration Procedure assessment, update ipAssessmentInfos
|
|
252
|
+
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos = newOmniAssessmentInfo.ipAssessmentInfos;
|
|
253
|
+
logger_1.Logger.logVerbose(messages.getMessage('assessedIntegrationProceduresCount', [
|
|
254
|
+
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
|
|
255
|
+
]));
|
|
256
|
+
}
|
|
257
|
+
logger_1.Logger.log(messages.getMessage('omniScriptAssessmentCompleted', [exportComponentType]));
|
|
200
258
|
}
|
|
201
|
-
async
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
}
|
|
259
|
+
async assessGlobalAutoNumbers(assesmentInfo, namespace, conn) {
|
|
260
|
+
if ((0, dataModelService_1.isFoundationPackage)()) {
|
|
261
|
+
return;
|
|
229
262
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
+
logger_1.Logger.logVerbose(messages.getMessage('startingGlobalAutoNumberAssessment'));
|
|
264
|
+
const globalAutoNumberMigrationTool = new globalautonumber_1.GlobalAutoNumberMigrationTool(namespace, conn, logger_1.Logger, messages, this.ux);
|
|
265
|
+
assesmentInfo.globalAutoNumberAssessmentInfos = await globalAutoNumberMigrationTool.assess();
|
|
266
|
+
logger_1.Logger.logVerbose(messages.getMessage('assessedGlobalAutoNumbersCount', [assesmentInfo.globalAutoNumberAssessmentInfos.length]));
|
|
267
|
+
logger_1.Logger.log(messages.getMessage('globalAutoNumberAssessmentCompleted'));
|
|
268
|
+
}
|
|
269
|
+
async assessCustomLabels(assesmentInfo, namespace, conn) {
|
|
270
|
+
try {
|
|
271
|
+
logger_1.Logger.log(messages.getMessage('startingCustomLabelAssessment'));
|
|
272
|
+
const customLabelResult = await customLabels_1.CustomLabelsUtil.fetchCustomLabels(conn, namespace, messages);
|
|
273
|
+
assesmentInfo.customLabelAssessmentInfos = customLabelResult.labels;
|
|
274
|
+
assesmentInfo.customLabelStatistics = customLabelResult.statistics;
|
|
275
|
+
logger_1.Logger.log(messages.getMessage('customLabelAssessmentCompleted'));
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
logger_1.Logger.error(messages.getMessage('errorDuringCustomLabelAssessment', [error.message]));
|
|
279
|
+
assesmentInfo.customLabelAssessmentInfos = [];
|
|
280
|
+
assesmentInfo.customLabelStatistics = {
|
|
281
|
+
totalLabels: 0,
|
|
282
|
+
readyForMigration: 0,
|
|
283
|
+
needManualIntervention: 0,
|
|
284
|
+
warnings: 0,
|
|
285
|
+
failed: 0,
|
|
286
|
+
};
|
|
263
287
|
}
|
|
264
|
-
return projectPath;
|
|
265
288
|
}
|
|
266
289
|
}
|
|
267
290
|
exports.default = Assess;
|
|
@@ -269,10 +292,6 @@ Assess.description = messages.getMessage('commandDescription');
|
|
|
269
292
|
Assess.examples = messages.getMessage('examples').split(os.EOL);
|
|
270
293
|
Assess.args = [{ name: 'file' }];
|
|
271
294
|
Assess.flagsConfig = {
|
|
272
|
-
namespace: command_1.flags.string({
|
|
273
|
-
char: 'n',
|
|
274
|
-
description: messages.getMessage('namespaceFlagDescription'),
|
|
275
|
-
}),
|
|
276
295
|
only: command_1.flags.string({
|
|
277
296
|
char: 'o',
|
|
278
297
|
description: messages.getMessage('onlyFlagDescription'),
|
|
@@ -284,7 +303,7 @@ Assess.flagsConfig = {
|
|
|
284
303
|
}),
|
|
285
304
|
relatedobjects: command_1.flags.string({
|
|
286
305
|
char: 'r',
|
|
287
|
-
description: messages.getMessage('
|
|
306
|
+
description: messages.getMessage('relatedObjectGA'),
|
|
288
307
|
}),
|
|
289
308
|
verbose: command_1.flags.builtin({
|
|
290
309
|
type: 'builtin',
|