Skip to content

Commit caa39a5

Browse files
fix(deps): resolving comments
1 parent 8caa522 commit caa39a5

File tree

17 files changed

+298
-269
lines changed

17 files changed

+298
-269
lines changed

README.md

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The Omnistudio Migration Assistant is a Salesforce CLI plugin that automates the
44

55
## 🚀 Before You Begin
66

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+
79
⚠️ IMPORTANT: Before installing and using the Omnistudio Migration Assistant, contact Salesforce support.
810

911
- 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)
@@ -12,6 +14,8 @@ The Omnistudio Migration Assistant is a Salesforce CLI plugin that automates the
1214

1315
- 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.
1416

17+
- This tool requires Node Version 18+.
18+
1519
- LWC migration auto-deployment needs minimum node version of 18.17.1
1620

1721
## Install and Run the Omnistudio Migration Assistant
@@ -41,10 +45,10 @@ sf plugins install @salesforce/[email protected]
4145

4246
```
4347
// To assess everything without migrating
44-
sfdx omnistudio:migration:assess -u [email protected]
48+
sf omnistudio:migration:assess -u [email protected]
4549
4650
// To migrate everything
47-
sfdx omnistudio:migration:migrate -u [email protected]
51+
sf omnistudio:migration:migrate -u [email protected]
4852
4953
5054
// To migrate/assess specific components: Flexcards, Data Mappers, Integration Procedures, Omniscripts, Omni Global Auto Numbers or Custom Labels, add the following parameters:
@@ -102,10 +106,10 @@ Assessment provides detailed information about:
102106

103107
```bash
104108
# Assess Omni Global Auto Numbers only
105-
sfdx omnistudio:migration:assess -u [email protected] --only=autonumber
109+
sf omnistudio:migration:assess -u [email protected] --only=autonumber
106110

107111
# Migrate Omni Global Auto Numbers only
108-
sfdx omnistudio:migration:migrate -u [email protected] --only=autonumber
112+
sf omnistudio:migration:migrate -u [email protected] --only=autonumber
109113
```
110114

111115
5. An HTML page will be open in your default browser with the results of your migration/assessment job.
@@ -114,70 +118,64 @@ sfdx omnistudio:migration:migrate -u [email protected] --only=autonum
114118

115119
```
116120
USAGE
117-
$ sf omnistudio:migration:assess [-v <string>] [-u <string>] [--loglevel
118-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
121+
$ sf omnistudio:migration:assess -u <username> [--only <component>] [--allversions]
122+
[--relatedobjects <objects>] [--verbose]
119123
120124
OPTIONS
121-
-u, --targetusername=targetusername username or alias for the target
122-
org; overrides default target org
123-
124-
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
125-
org; overrides default dev hub org
126-
127-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
128-
this command invocation
129-
130-
-a, --allversions migrate all versions and not
131-
and not just the active ones.
132-
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
125+
-u, --target-org=<username> (required) username or alias for the target org
126+
(alias: --targetusername - deprecated)
127+
128+
-o, --only=<component> specify a single component to assess:
129+
dm (Data Mappers),
130+
ip (Integration Procedures),
131+
os (Omniscripts),
132+
fc (Flexcards),
133+
autonumber (Omni Global Auto Numbers),
134+
cl (Custom Labels)
135+
136+
-a, --allversions assess all versions, not just the active ones
137+
138+
-r, --relatedobjects=<objects> specify one or more related objects to assess (comma separated):
139+
apex - Apex classes
140+
lwc - Lightning Web Components
141+
expsites - Experience Sites
142+
flexipage - FlexiPages
143+
144+
--verbose enable verbose output
145+
146+
--loglevel=<level> (deprecated) use --verbose instead
146147
```
147148

148149
### Migrate Usage & parameters
149150

150151
```
151152
USAGE
152-
$ sf omnistudio:migration:migrate [-v <string>] [-u <string>] [--loglevel
153-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
153+
$ sf omnistudio:migration:migrate -u <username> [--only <component>] [--allversions]
154+
[--relatedobjects <objects>] [--verbose]
154155
155156
OPTIONS
156-
-u, --targetusername=targetusername username or alias for the target
157-
org; overrides default target org
158-
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
157+
-u, --target-org=<username> (required) username or alias for the target org
158+
(aliases: --targetusername - deprecated)
159+
160+
-o, --only=<component> specify a single component to migrate:
161+
dm (Data Mappers),
162+
ip (Integration Procedures),
163+
os (Omniscripts),
164+
fc (Flexcards),
165+
autonumber (Omni Global Auto Numbers),
166+
cl (Custom Labels)
167+
168+
-a, --allversions migrate all versions, not just the active ones
169+
170+
-r, --relatedobjects=<objects> specify one or more related objects to migrate (comma separated):
171+
apex - Apex classes
172+
lwc - Lightning Web Components
173+
expsites - Experience Sites
174+
flexipage - FlexiPages
175+
176+
--verbose enable verbose output
177+
178+
--loglevel=<level> (deprecated) use --verbose instead
181179
```
182180

183181
Terms:

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
environment:
2-
nodejs_version: "10"
2+
nodejs_version: '18'
33
cache:
44
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
55
- node_modules -> yarn.lock
@@ -16,4 +16,3 @@ build_script:
1616

1717
test_script:
1818
- yarn test
19-

command-snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
{
33
"command": "omnistudio:migration:assess",
44
"plugin": "@salesforce/plugin-omnistudio-migration-tool",
5-
"flags": ["allversions", "only", "relatedobjects", "target-org", "verbose"],
5+
"flags": ["allversions", "loglevel", "only", "relatedobjects", "target-org", "verbose"],
66
"alias": []
77
},
88
{
99
"command": "omnistudio:migration:info",
1010
"plugin": "@salesforce/plugin-omnistudio-migration-tool",
11-
"flags": ["allversions", "name", "target-dev-hub", "target-org", "verbose"],
11+
"flags": ["allversions", "name", "target-org", "verbose"],
1212
"alias": []
1313
},
1414
{
1515
"command": "omnistudio:migration:migrate",
1616
"plugin": "@salesforce/plugin-omnistudio-migration-tool",
17-
"flags": ["allversions", "only", "relatedobjects", "target-org", "verbose"],
17+
"flags": ["allversions", "loglevel", "only", "relatedobjects", "target-org", "verbose"],
1818
"alias": []
1919
}
2020
]

messages/assess.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,6 @@
225225
"omniStudioAllVersionsProcessingConsentGiven": "You've consented to assess all versions of the Omnistudio components.",
226226
"preparingStorageForMetadataEnabledOrg": "Preparing storage for %s org on Standard Data Model with Metadata API enabled",
227227
"processingNotRequired": "Assessment not required for Standard Data Model Orgs with Metadata API enabled",
228-
"skippingTruncation": "Skipping Trunction as standard data model org"
228+
"skippingTruncation": "Skipping Trunction as standard data model org",
229+
"loglevelFlagDeprecated": "loglevel is deprecated. Use --verbose instead"
229230
}

messages/migrate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,6 @@
324324
"orgUsecaseDetails": "The Org is on %s data model with %s and Omnistudio Metadata API %s",
325325
"preparingStorageForMetadataEnabledOrg": "Preparing storage for %s org on Standard Data Model with Metadata API enabled",
326326
"processingNotRequired": "Migration not required for Standard Data Model Orgs with Metadata API enabled",
327-
"skippingTruncation": "Skipping Trunction as standard data model org"
327+
"skippingTruncation": "Skipping Trunction as standard data model org",
328+
"loglevelFlagDeprecated": "loglevel is deprecated. Use --verbose instead."
328329
}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@
6262
"puppeteer": "^24.12.1",
6363
"sinon": "10.0.0",
6464
"ts-node": "^10.9.2",
65-
"typescript": "^4.9.5"
65+
"typescript": "^5.4.5"
6666
},
6767
"resolutions": {
6868
"nanoid": "^3.3.8",
6969
"marked": "^4.0.10",
7070
"semver": "^7.5.2",
7171
"jsonwebtoken": "^9.0.2",
72+
"jws": "^3.2.3",
73+
"js-yaml": "^4.1.1",
7274
"form-data": "^4.0.4",
7375
"trim-newlines": "^3.0.1",
7476
"minimatch": "^3.0.5",
@@ -111,7 +113,7 @@
111113
"license": "BSD-3-Clause",
112114
"oclif": {
113115
"commands": "./lib/commands",
114-
"bin": "sfdx",
116+
"bin": "sf",
115117
"topics": {
116118
"omnistudio": {
117119
"subtopics": {
@@ -130,18 +132,18 @@
130132
},
131133
"repository": "salesforcecli/plugin-omnistudio-migration-tool",
132134
"scripts": {
133-
"build": "sf-build",
135+
"build": "sf-build && yarn copy-assets",
134136
"clean": "sf-clean",
135137
"clean-all": "sf-clean all",
136138
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
137-
"compile": "sf-compile",
139+
"compile": "sf-compile && yarn copy-assets",
138140
"copy-assets": "shx cp -r src/templates lib/ && shx cp -r src/styles lib/ && shx cp -r src/javascripts lib/",
139141
"docs": "sf-docs",
140142
"format": "sf-format",
141143
"lint": "sf-lint",
142144
"postpack": "shx rm -f oclif.manifest.json",
143145
"posttest": "yarn lint && yarn test:deprecation-policy && yarn test:command-reference",
144-
"prepack": "sf-prepack",
146+
"prepack": "sf-prepack && yarn copy-assets",
145147
"prepare": "sf-install",
146148
"pretest": "sf-compile-test",
147149
"test": "sf-test",

src/commands/omnistudio/migration/assess.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ export default class Assess extends SfCommand<AssessmentInfo> {
5252
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
5353
'target-org': flags.optionalOrg({
5454
summary: 'Target org username or alias',
55+
char: 'u',
5556
required: true,
56-
aliases: ['targetusername', 'u'],
57+
aliases: ['targetusername'],
5758
deprecateAliases: true,
5859
makeDefault: false, // Prevent auto-resolution during command-reference generation
5960
}),
@@ -76,11 +77,18 @@ export default class Assess extends SfCommand<AssessmentInfo> {
7677
verbose: flags.boolean({
7778
description: messages.getMessage('enableVerboseOutput'),
7879
}),
80+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
81+
loglevel: flags.string({
82+
description: 'Logging level (deprecated, use --verbose instead)',
83+
deprecated: {
84+
message: messages.getMessage('loglevelFlagDeprecated'),
85+
},
86+
}),
7987
};
8088

8189
public async run(): Promise<AssessmentInfo> {
8290
const { flags: parsedFlags } = await this.parse(Assess);
83-
const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
91+
const ux = new Ux();
8492
const logger = await CoreLogger.child(this.constructor.name);
8593
Logger.initialiseLogger(ux, logger, 'assess', parsedFlags.verbose);
8694
try {
@@ -94,7 +102,7 @@ export default class Assess extends SfCommand<AssessmentInfo> {
94102

95103
public async runAssess(parsedFlags: AssessFlags, ux: Ux, logger: CoreLogger): Promise<AssessmentInfo> {
96104
DebugTimer.getInstance().start();
97-
const allVersions = parsedFlags.allversions || false;
105+
let allVersions = parsedFlags.allversions || false;
98106
const assessOnly = parsedFlags.only || '';
99107
const relatedObjects = parsedFlags.relatedobjects || '';
100108
const isExperienceBundleMetadataAPIProgramaticallyEnabled: { value: boolean } = { value: false };
@@ -259,7 +267,9 @@ export default class Assess extends SfCommand<AssessmentInfo> {
259267
await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions, ux);
260268
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.OS, ux);
261269
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.IP, ux);
262-
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn, ux);
270+
if (!isFoundationPackage()) {
271+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn, ux);
272+
}
263273
await this.assessCustomLabels(assesmentInfo, namespace, conn);
264274
return;
265275
}
@@ -278,7 +288,11 @@ export default class Assess extends SfCommand<AssessmentInfo> {
278288
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.IP, ux);
279289
break;
280290
case Constants.GlobalAutoNumber:
281-
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn, ux);
291+
if (!isFoundationPackage()) {
292+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn, ux);
293+
} else {
294+
Logger.warn(messages.getMessage('globalAutoNumberUnSupportedInOmnistudioPackage'));
295+
}
282296
break;
283297
case Constants.CustomLabel:
284298
await this.assessCustomLabels(assesmentInfo, namespace, conn);
@@ -374,6 +388,9 @@ export default class Assess extends SfCommand<AssessmentInfo> {
374388
conn: Connection,
375389
ux: Ux
376390
): Promise<void> {
391+
if (isFoundationPackage()) {
392+
return;
393+
}
377394
Logger.logVerbose(messages.getMessage('startingGlobalAutoNumberAssessment'));
378395
const globalAutoNumberMigrationTool = new GlobalAutoNumberMigrationTool(namespace, conn, Logger, messages, ux);
379396
assesmentInfo.globalAutoNumberAssessmentInfos = await globalAutoNumberMigrationTool.assess();

src/commands/omnistudio/migration/info.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export default class Info extends SfCommand<InfoResult> {
4141
public static readonly flags: any = {
4242
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
4343
'target-org': flags.optionalOrg({
44+
char: 'u',
4445
summary: 'Target org username or alias',
4546
required: true,
46-
}),
47-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
48-
'target-dev-hub': flags.optionalHub({
49-
summary: 'Dev Hub username or alias',
47+
aliases: ['targetusername'],
48+
deprecateAliases: true,
49+
makeDefault: false, // Prevent auto-resolution during command-reference generation
5050
}),
5151
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
5252
name: flags.string({

0 commit comments

Comments
 (0)