Skip to content

Commit 9c4c2fd

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

File tree

15 files changed

+240
-223
lines changed

15 files changed

+240
-223
lines changed

LICENSE.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Copyright (c) 2018, Salesforce.com, Inc.
22
All rights reserved.
33

4-
Welcome to the Omnistudio Migration Assistant Pilot. This is a pilot tool release and your feedback is invaluable. This migration assistant which is provided for pilot evaluation purposes only and Pilot participants agree to provide feedback as requested.
5-
64
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
75

86
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

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 -o [email protected]
4549
4650
// To migrate everything
47-
sfdx omnistudio:migration:migrate -u [email protected]
51+
sf omnistudio:migration:migrate -o [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 -o [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 -o [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 -o <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+
-o, --target-org=<username> (required) username or alias for the target org
126+
(aliases: -u, --targetusername - deprecated)
127+
128+
--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 -o <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+
-o, --target-org=<username> (required) username or alias for the target org
158+
(aliases: -u, --targetusername - deprecated)
159+
160+
--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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
{
@@ -14,7 +14,7 @@
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,8 @@
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+
"orgUsecaseDetails": "The Org is on %s data model with %s ",
329+
"globalAutoNumberUnSupportedInOmnistudioPackage": "Omni Global Auto Number is not supported in Omnistudio Foundation package orgs.",
330+
"loglevelflagdeprecated": "loglevel is deprecated. Use --verbose instead."
328331
}

package.json

Lines changed: 8 additions & 6 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,21 +132,21 @@
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",
147-
"test": "sf-test",
149+
"test": "npx --yes puppeteer browsers install chrome && sf-test",
148150
"test:command-reference": "./bin/run commandreference:generate --erroronwarnings",
149151
"test:deprecation-policy": "./bin/run snapshot:compare",
150152
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",

src/commands/omnistudio/migration/assess.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ export default class Assess extends SfCommand<AssessmentInfo> {
7676
verbose: flags.boolean({
7777
description: messages.getMessage('enableVerboseOutput'),
7878
}),
79+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
80+
loglevel: flags.string({
81+
description: 'Logging level (deprecated, use --verbose instead)',
82+
deprecated: {
83+
message: messages.getMessage('loglevelflagdeprecated'),
84+
},
85+
options: ['trace', 'debug', 'info', 'warn', 'error', 'fatal'],
86+
}),
7987
};
8088

8189
public async run(): Promise<AssessmentInfo> {
@@ -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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +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: 'o',
4445
summary: 'Target org username or alias',
4546
required: true,
47+
aliases: ['targetusername', 'u'],
48+
deprecateAliases: true,
49+
makeDefault: false, // Prevent auto-resolution during command-reference generation
4650
}),
4751
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
4852
'target-dev-hub': flags.optionalHub({

src/commands/omnistudio/migration/migrate.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export default class Migrate extends SfCommand<MigrateResult> {
7272
'target-org': flags.optionalOrg({
7373
summary: 'Target org username or alias',
7474
required: true,
75+
aliases: ['targetusername', 'u'],
76+
deprecateAliases: true,
77+
makeDefault: false, // Prevent auto-resolution during command-reference generation
7578
}),
7679
only: flags.string({
7780
char: 'o',
@@ -89,6 +92,13 @@ export default class Migrate extends SfCommand<MigrateResult> {
8992
verbose: flags.boolean({
9093
description: 'Enable verbose output',
9194
}),
95+
loglevel: flags.string({
96+
description: 'Logging level (deprecated, use --verbose instead)',
97+
deprecated: {
98+
message: messages.getMessage('loglevelflagdeprecated'),
99+
},
100+
options: ['trace', 'debug', 'info', 'warn', 'error', 'fatal'],
101+
}),
92102
};
93103

94104
// OmniStudio components that don't need migration logging when metadata API is enabled

0 commit comments

Comments
 (0)