@salesforce/plugin-omnistudio-migration-tool 2.0.0-rc.60 → 2.0.0-rc.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/omnistudio/migration/assess.d.ts +1 -0
- package/lib/commands/omnistudio/migration/assess.js +27 -0
- package/lib/commands/omnistudio/migration/assess.js.map +1 -1
- package/lib/commands/omnistudio/migration/clean.js +4 -2
- package/lib/commands/omnistudio/migration/clean.js.map +1 -1
- package/lib/commands/omnistudio/migration/migrate.js +11 -0
- package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
- package/lib/javascripts/reportGeneratorUtility.js +181 -0
- package/lib/migration/ApexNamespaceRegistry.d.ts +49 -0
- package/lib/migration/ApexNamespaceRegistry.js +130 -0
- package/lib/migration/ApexNamespaceRegistry.js.map +1 -0
- package/lib/migration/CustomCssRegistry.d.ts +117 -0
- package/lib/migration/CustomCssRegistry.js +234 -0
- package/lib/migration/CustomCssRegistry.js.map +1 -0
- package/lib/migration/base.js +1 -1
- package/lib/migration/base.js.map +1 -1
- package/lib/migration/customLabels.js +14 -3
- package/lib/migration/customLabels.js.map +1 -1
- package/lib/migration/flexcard.d.ts +98 -0
- package/lib/migration/flexcard.js +448 -15
- package/lib/migration/flexcard.js.map +1 -1
- package/lib/migration/interfaces.d.ts +1 -0
- package/lib/migration/interfaces.js.map +1 -1
- package/lib/migration/omniscript.d.ts +42 -1
- package/lib/migration/omniscript.js +249 -6
- package/lib/migration/omniscript.js.map +1 -1
- package/lib/migration/omniscriptInstance.d.ts +90 -0
- package/lib/migration/omniscriptInstance.js +755 -0
- package/lib/migration/omniscriptInstance.js.map +1 -0
- package/lib/styles/reportGenerator.css +25 -0
- package/lib/templates/assessmentReport.template +8 -0
- package/lib/templates/migrationReport.template +8 -0
- package/lib/utils/constants/documentRegistry.d.ts +6 -0
- package/lib/utils/constants/documentRegistry.js +6 -0
- package/lib/utils/constants/documentRegistry.js.map +1 -1
- package/lib/utils/constants/stringContants.d.ts +28 -5
- package/lib/utils/constants/stringContants.js +30 -5
- package/lib/utils/constants/stringContants.js.map +1 -1
- package/lib/utils/customLabels.d.ts +1 -0
- package/lib/utils/customLabels.js +3 -0
- package/lib/utils/customLabels.js.map +1 -1
- package/lib/utils/interfaces.d.ts +19 -0
- package/lib/utils/query/index.d.ts +1 -0
- package/lib/utils/query/index.js +17 -0
- package/lib/utils/query/index.js.map +1 -1
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +4 -0
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.d.ts +12 -0
- package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.js +109 -0
- package/lib/utils/resultsbuilder/SaveForLaterAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/assessmentReporter.js +18 -2
- package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.d.ts +11 -1
- package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.js +64 -1
- package/lib/utils/resultsbuilder/helpers/AssessmentReportHelper.js.map +1 -1
- package/lib/utils/resultsbuilder/index.d.ts +4 -0
- package/lib/utils/resultsbuilder/index.js +61 -0
- package/lib/utils/resultsbuilder/index.js.map +1 -1
- package/lib/utils/stringUtils.d.ts +15 -0
- package/lib/utils/stringUtils.js +37 -0
- package/lib/utils/stringUtils.js.map +1 -1
- package/messages/assess.json +23 -2
- package/messages/migrate.json +29 -3
- package/oclif.manifest.json +1 -1
- package/package.json +5 -4
|
@@ -6,9 +6,11 @@ import { Ux } from '@salesforce/sf-plugins-core';
|
|
|
6
6
|
import { FlexCardAssessmentInfo } from '../../src/utils';
|
|
7
7
|
import { Logger } from '../utils/logger';
|
|
8
8
|
export declare class CardMigrationTool extends BaseMigrationTool implements MigrationTool {
|
|
9
|
+
private readonly apexNamespaceRegistry;
|
|
9
10
|
static readonly VLOCITYCARD_NAME = "VlocityCard__c";
|
|
10
11
|
static readonly OMNIUICARD_NAME = "OmniUiCard";
|
|
11
12
|
static readonly VERSION_PROP = "Version__c";
|
|
13
|
+
private static readonly URL_PARSE_BASE;
|
|
12
14
|
private IS_STANDARD_DATA_MODEL;
|
|
13
15
|
private readonly allVersions;
|
|
14
16
|
constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages<string>, ux: Ux, allVersions: boolean);
|
|
@@ -20,6 +22,26 @@ export declare class CardMigrationTool extends BaseMigrationTool implements Migr
|
|
|
20
22
|
assess(): Promise<FlexCardAssessmentInfo[]>;
|
|
21
23
|
processCardComponents(flexCards: AnyJson[]): Promise<FlexCardAssessmentInfo[]>;
|
|
22
24
|
private processFlexCard;
|
|
25
|
+
/**
|
|
26
|
+
* Scan a FlexCard for two distinct kinds of namespace-bound custom CSS:
|
|
27
|
+
*
|
|
28
|
+
* 1. **StaticResource-backed stylesheet** — `Definition__c.customStyleSheet`
|
|
29
|
+
* stores the *Name* of a Static Resource. We look it up, fetch its body,
|
|
30
|
+
* and substring-check for the org's managed-package namespace. Same flow
|
|
31
|
+
* and same warning message as the OmniScript implementation; resource
|
|
32
|
+
* scans are cached by name in {@link CustomCssRegistry}, so a stylesheet
|
|
33
|
+
* shared between OmniScripts and FlexCards is only fetched once per run.
|
|
34
|
+
*
|
|
35
|
+
* 2. **Inline CSS** — `Styles__c.customStyles` stores raw CSS text. We
|
|
36
|
+
* substring-check the namespace directly against that string. No
|
|
37
|
+
* SOQL/REST traffic and no caching (the CSS is per-FlexCard and not
|
|
38
|
+
* shared across records).
|
|
39
|
+
*
|
|
40
|
+
* Both checks emit a warning into `flexCardAssessmentInfo.warnings` and bump
|
|
41
|
+
* `migrationStatus` to 'Needs manual intervention' (via
|
|
42
|
+
* `getUpdatedAssessmentStatus`, which never downgrades a stricter status).
|
|
43
|
+
*/
|
|
44
|
+
private collectStylesheetNamespaceDependencies;
|
|
23
45
|
private updateDependencies;
|
|
24
46
|
/**
|
|
25
47
|
* Check events array for dependencies (Assessment)
|
|
@@ -67,6 +89,21 @@ export declare class CardMigrationTool extends BaseMigrationTool implements Migr
|
|
|
67
89
|
private handleMigrationForStdDataModelOrgsWithMetadataAPIEnabled;
|
|
68
90
|
private readChildCardsFromDefinition;
|
|
69
91
|
private checkComponentForDependencies;
|
|
92
|
+
private addOmniScriptNavigateURLAssessmentWarning;
|
|
93
|
+
/**
|
|
94
|
+
* Build the customer-facing warning shown when a Web Page action URL contains
|
|
95
|
+
* fragment tokens that decodeURIComponent couldn't parse. Centralised here so
|
|
96
|
+
* the assessment and migration paths emit byte-identical text.
|
|
97
|
+
*
|
|
98
|
+
* Returns an empty string when the helper is called with no malformed tokens
|
|
99
|
+
* (defense in depth: callers already guard, but a future caller that forgets
|
|
100
|
+
* shouldn't be able to produce a degenerate warning with an empty bracket).
|
|
101
|
+
* Non-string entries are coerced via String() so a misbehaving caller can't
|
|
102
|
+
* surface "undefined" / "[object Object]" to customers; duplicates are
|
|
103
|
+
* suppressed so a fragment like `#/Foo%/Bar/Foo%/Baz` doesn't render as
|
|
104
|
+
* `["Foo%", "Foo%"]`.
|
|
105
|
+
*/
|
|
106
|
+
private formatMalformedFragmentTokenWarning;
|
|
70
107
|
private getAllCards;
|
|
71
108
|
private uploadAllCards;
|
|
72
109
|
private uploadCard;
|
|
@@ -100,6 +137,60 @@ export declare class CardMigrationTool extends BaseMigrationTool implements Migr
|
|
|
100
137
|
* Update component dependencies comprehensively
|
|
101
138
|
*/
|
|
102
139
|
private updateComponentDependenciesWithRegistry;
|
|
140
|
+
private applyOmniScriptURLRewrite;
|
|
141
|
+
/** Build a human-readable "before -> after" string for warning messages only. */
|
|
142
|
+
private formatURLRewriteSummary;
|
|
143
|
+
/**
|
|
144
|
+
* Decode a URL for DISPLAY purposes only (warning/log messages). The output
|
|
145
|
+
* is lossy with respect to URL parsing semantics (e.g. an encoded `%26`
|
|
146
|
+
* becomes a literal `&`) and must NOT be re-fed into a URL parser. Falls
|
|
147
|
+
* back to the raw input on malformed percent sequences.
|
|
148
|
+
*/
|
|
149
|
+
private toReadableURL;
|
|
150
|
+
private getOmniScriptURLRewrite;
|
|
151
|
+
private isCustomWebPageAction;
|
|
152
|
+
/**
|
|
153
|
+
* Parse a URL string without throwing. Returns the parsed URL on success or
|
|
154
|
+
* undefined for:
|
|
155
|
+
* - syntactically invalid input (e.g. `https://[bad`, raw spaces in host,
|
|
156
|
+
* `http:///` with no host), or
|
|
157
|
+
* - URLs whose scheme is not `http:` or `https:` (e.g. `javascript:`,
|
|
158
|
+
* `data:`, `file:`, `mailto:`).
|
|
159
|
+
*
|
|
160
|
+
* See URL_PARSE_BASE for why a synthetic base is supplied.
|
|
161
|
+
*/
|
|
162
|
+
private tryParseURL;
|
|
163
|
+
/**
|
|
164
|
+
* Verify a parsed URL has the OmniScript Navigate shape. We validate against
|
|
165
|
+
* the parsed components (pathname / searchParams / hash) rather than doing
|
|
166
|
+
* substring matches on the raw input so callers cannot smuggle the required
|
|
167
|
+
* tokens in unrelated positions (e.g. inside another query value).
|
|
168
|
+
*
|
|
169
|
+
* The pathname must START WITH `/apex/` and contain the universal-page
|
|
170
|
+
* token. Anchoring to the prefix rejects non-http(s) schemes such as
|
|
171
|
+
* `javascript:alert(1)//apex/...` whose parsed pathname does not begin
|
|
172
|
+
* with `/` (it begins with the opaque body of the scheme).
|
|
173
|
+
*
|
|
174
|
+
* Two legitimate shapes are accepted:
|
|
175
|
+
* 1. Path + query: /apex/<ns>__OmniScriptUniversalPage?OmniScriptType=...&OmniScriptSubType=...&OmniScriptLang=...
|
|
176
|
+
* 2. Path + fragment: /apex/<ns>__OmniScriptUniversalPage?...#/OmniScriptType/.../OmniScriptSubType/.../OmniScriptLang/...
|
|
177
|
+
*/
|
|
178
|
+
private isValidOmniScriptNavigationURL;
|
|
179
|
+
private convertToStandardOmniScriptURL;
|
|
180
|
+
/**
|
|
181
|
+
* Parse a slash-separated OmniScript fragment of the form
|
|
182
|
+
* #/Key1/Value1/Key2/Value2/...
|
|
183
|
+
* into [key, value] pairs. Tolerates leading `#`, leading `/`, empty values
|
|
184
|
+
* (consecutive slashes), and a trailing orphan token (which is dropped).
|
|
185
|
+
*
|
|
186
|
+
* Tokens with malformed percent sequences (e.g. `Foo%`, `Bar%E2`) are kept
|
|
187
|
+
* as-is rather than throwing; decodeURIComponent raises URIError on invalid
|
|
188
|
+
* escape sequences and we don't want one bad token to crash the whole
|
|
189
|
+
* FlexCard's URL rewrite. The raw (still-encoded) tokens are also returned
|
|
190
|
+
* via `malformedTokens` so callers can surface them to customers as a
|
|
191
|
+
* "please verify" warning rather than silently shipping a best-effort guess.
|
|
192
|
+
*/
|
|
193
|
+
private parseSlashFragmentParams;
|
|
103
194
|
/**
|
|
104
195
|
* Update omniType.Name using registry (handles Type/SubType/Language format)
|
|
105
196
|
*/
|
|
@@ -141,6 +232,13 @@ export declare class CardMigrationTool extends BaseMigrationTool implements Migr
|
|
|
141
232
|
* @param flexCardAssessmentInfo - Assessment info to update
|
|
142
233
|
*/
|
|
143
234
|
private addFlexCardDependency;
|
|
235
|
+
/**
|
|
236
|
+
* Helper method to flag a Vlocity Action dependency during assessment.
|
|
237
|
+
* Vlocity Actions are not supported in standard runtime FlexCards, so the
|
|
238
|
+
* FlexCard cannot be auto-migrated and must be manually reimplemented using
|
|
239
|
+
* the FlexCard Action (cardAction) feature.
|
|
240
|
+
*/
|
|
241
|
+
private addVlocityActionDependency;
|
|
144
242
|
private getCardFields;
|
|
145
243
|
private getFieldKey;
|
|
146
244
|
private getQueryNamespace;
|