sfdx-easy-sources 0.5.13 → 0.7.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 +90 -34
- package/lib/commands/easysources/applications/arealigned.d.ts +17 -0
- package/lib/commands/easysources/applications/arealigned.js +60 -0
- package/lib/commands/easysources/applications/arealigned.js.map +1 -0
- package/lib/commands/easysources/globalvaluesets/arealigned.d.ts +17 -0
- package/lib/commands/easysources/globalvaluesets/arealigned.js +60 -0
- package/lib/commands/easysources/globalvaluesets/arealigned.js.map +1 -0
- package/lib/commands/easysources/globalvaluesettranslations/arealigned.d.ts +17 -0
- package/lib/commands/easysources/globalvaluesettranslations/arealigned.js +60 -0
- package/lib/commands/easysources/globalvaluesettranslations/arealigned.js.map +1 -0
- package/lib/commands/easysources/labels/arealigned.d.ts +17 -0
- package/lib/commands/easysources/labels/arealigned.js +60 -0
- package/lib/commands/easysources/labels/arealigned.js.map +1 -0
- package/lib/commands/easysources/objecttranslations/arealigned.d.ts +20 -0
- package/lib/commands/easysources/objecttranslations/arealigned.js +488 -0
- package/lib/commands/easysources/objecttranslations/arealigned.js.map +1 -0
- package/lib/commands/easysources/objecttranslations/clearempty.d.ts +15 -0
- package/lib/commands/easysources/objecttranslations/clearempty.js +115 -0
- package/lib/commands/easysources/objecttranslations/clearempty.js.map +1 -0
- package/lib/commands/easysources/permissionsets/arealigned.d.ts +14 -0
- package/lib/commands/easysources/permissionsets/arealigned.js +65 -0
- package/lib/commands/easysources/permissionsets/arealigned.js.map +1 -0
- package/lib/commands/easysources/permissionsets/clearempty.d.ts +15 -0
- package/lib/commands/easysources/permissionsets/clearempty.js +52 -0
- package/lib/commands/easysources/permissionsets/clearempty.js.map +1 -0
- package/lib/commands/easysources/profiles/arealigned.d.ts +14 -0
- package/lib/commands/easysources/profiles/arealigned.js +65 -0
- package/lib/commands/easysources/profiles/arealigned.js.map +1 -0
- package/lib/commands/easysources/profiles/clearempty.d.ts +15 -0
- package/lib/commands/easysources/profiles/clearempty.js +52 -0
- package/lib/commands/easysources/profiles/clearempty.js.map +1 -0
- package/lib/commands/easysources/recordtypes/arealigned.d.ts +20 -0
- package/lib/commands/easysources/recordtypes/arealigned.js +417 -0
- package/lib/commands/easysources/recordtypes/arealigned.js.map +1 -0
- package/lib/commands/easysources/recordtypes/delete.js +5 -3
- package/lib/commands/easysources/recordtypes/delete.js.map +1 -1
- package/lib/commands/easysources/translations/arealigned.d.ts +14 -0
- package/lib/commands/easysources/translations/arealigned.js +65 -0
- package/lib/commands/easysources/translations/arealigned.js.map +1 -0
- package/lib/commands/easysources/translations/clearempty.d.ts +15 -0
- package/lib/commands/easysources/translations/clearempty.js +52 -0
- package/lib/commands/easysources/translations/clearempty.js.map +1 -0
- package/lib/utils/commands/alignmentChecker.d.ts +21 -0
- package/lib/utils/commands/alignmentChecker.js +353 -0
- package/lib/utils/commands/alignmentChecker.js.map +1 -0
- package/lib/utils/commands/emptyClearer.d.ts +20 -0
- package/lib/utils/commands/emptyClearer.js +90 -0
- package/lib/utils/commands/emptyClearer.js.map +1 -0
- package/lib/utils/filesUtils.js +13 -3
- package/lib/utils/filesUtils.js.map +1 -1
- package/messages/applications_arealigned.json +22 -0
- package/messages/globalvaluesets_arealigned.json +22 -0
- package/messages/globalvaluesettranslations_arealigned.json +22 -0
- package/messages/labels_arealigned.json +22 -0
- package/messages/objtransl_arealigned.json +23 -0
- package/messages/objtransl_clearempty.json +11 -0
- package/messages/permissionsets_arealigned.json +23 -0
- package/messages/permissionsets_clearempty.json +11 -0
- package/messages/profiles_arealigned.json +23 -0
- package/messages/profiles_clearempty.json +11 -0
- package/messages/recordtypes_arealigned.json +26 -0
- package/messages/translations_arealigned.json +23 -0
- package/messages/translations_clearempty.json +11 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,31 +11,32 @@ SFDX plugin to simplify the management of Salesforce sources, splitting some lon
|
|
|
11
11
|
[](https://github.com/raffo93p/sfdx-easy-sources/blob/master/package.json)
|
|
12
12
|
|
|
13
13
|
# What is sfdx-easy-sources?
|
|
14
|
-
This plugin helps
|
|
14
|
+
This plugin helps Salesforce developers, architects and release managers with the management of Salesforce XML sources, especially those which become very long and difficult to handle with git version history.
|
|
15
15
|
|
|
16
16
|
With this plugin you can:
|
|
17
|
-
- Split
|
|
18
|
-
-
|
|
19
|
-
- Upsert
|
|
20
|
-
- Merge
|
|
21
|
-
-
|
|
22
|
-
- Minify
|
|
23
|
-
- Clean
|
|
24
|
-
- Setup
|
|
17
|
+
- **Split** long XML files into smaller, manageable CSV files
|
|
18
|
+
- **Better visualize and understand** file contents using VSCode CSV extensions and tools
|
|
19
|
+
- **Upsert** CSV files after retrieving packages with new resources
|
|
20
|
+
- **Merge** CSV files back into the original XML format for deployment
|
|
21
|
+
- **Bulk delete** references or permissions from all CSV files of a given metadata type
|
|
22
|
+
- **Minify** CSV files by removing rows that don't add value to the configuration
|
|
23
|
+
- **Clean** CSV references to resources that don't exist in the target org or repository
|
|
24
|
+
- **Setup custom git mergers** to automatically resolve CSV conflicts during cherry-picking or merging
|
|
25
25
|
|
|
26
26
|
## Supported metadata types
|
|
27
27
|
|
|
28
28
|
| Metadata Label| Metadata api | Available commands |
|
|
29
29
|
| :---: | :---: | :---: |
|
|
30
30
|
| All Meta | allmeta | split, upsert, merge, minify, retrieve |
|
|
31
|
-
| Profiles | profiles | split, upsert, merge, minify, updatekey, delete, clean |
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
| Global Value
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| Translations |
|
|
31
|
+
| Profiles | profiles | split, upsert, merge, minify, updatekey, delete, clean, clearempty, arealigned |
|
|
32
|
+
| Permission Sets | permissionsets | split, upsert, merge, minify, updatekey, delete, clean, clearempty, arealigned |
|
|
33
|
+
| Record Types | recordtypes | split, upsert, merge, updatekey, delete, clean, arealigned |
|
|
34
|
+
| Labels | labels | split, upsert, merge, updatekey, arealigned |
|
|
35
|
+
| Global Value Sets | globalvaluesets | split, upsert, merge, updatekey, arealigned |
|
|
36
|
+
| Global Value Set Translations | globalvaluesettranslations | split, upsert, merge, updatekey, arealigned |
|
|
37
|
+
| Applications | applications | split, upsert, merge, updatekey, arealigned |
|
|
38
|
+
| Object Translations | objecttranslations | split, upsert, merge, minify, updatekey, clearempty, arealigned |
|
|
39
|
+
| Translations | translations | split, upsert, merge, minify, updatekey, clearempty, arealigned |
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
|
|
@@ -55,13 +56,15 @@ Examples
|
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
Based on the source type, this plugin provides the following commands:
|
|
58
|
-
- Split
|
|
59
|
-
- Merge
|
|
60
|
-
- Upsert
|
|
61
|
-
- Updatekey
|
|
62
|
-
- Delete
|
|
63
|
-
- Minify
|
|
64
|
-
- Clean
|
|
59
|
+
- **Split**: Splits the resources into various CSV files, and creates an XML file containing all the tags that weren't split
|
|
60
|
+
- **Merge**: Merges back all the resources previously split from CSV files into XML format
|
|
61
|
+
- **Upsert**: Similar to split, but adds new entries to existing CSV files instead of recreating them
|
|
62
|
+
- **Updatekey**: Updates the `_tagid` column when developers make changes directly in CSV files
|
|
63
|
+
- **Delete**: Bulk deletes a single permission from all resources of the same type (only applies to Profiles, PermissionSets and Record Types)
|
|
64
|
+
- **Minify**: Removes entries that don't add value to the file (available for profiles, permissionsets, objecttranslations, and translations)
|
|
65
|
+
- **Clean**: Removes all references that are not present in the target org or in the repository
|
|
66
|
+
- **Clearempty**: Removes empty CSV files and folders from the generated CSV files (available for profiles, permissionsets, objecttranslations, and translations)
|
|
67
|
+
- **AreAligned**: Validates alignment between XML and CSV representations, ensuring data integrity with logic or string comparison modes
|
|
65
68
|
|
|
66
69
|
# Disclaimer
|
|
67
70
|
- Please experiment at first inside a dummy project!
|
|
@@ -108,7 +111,7 @@ Some useful parameters are:
|
|
|
108
111
|
- --split-merge: if set to true, automatically performes a split and then a merge of all the sources, after they are retrieved
|
|
109
112
|
|
|
110
113
|
This command actually splits all the resources into various packages, trying to count the resources in every package to not exceed the "resnumb" number. It also creates some little packages, because profiles, permissionsets, translations and other particular metadata types should be retrieved building the package in a given way.
|
|
111
|
-
Suppose the profile packages are more then one, the algorithm should automatically perform a split after retrieving the first profile package, then it should perform an upsert after every other profile package retrieved, and at the end it should perform a merge and delete the created csv. Unfortunately, at this moment I didn't test this scenario
|
|
114
|
+
> **⚠️ Important Note:** Suppose the profile packages are more then one, the algorithm should automatically perform a split after retrieving the first profile package, then it should perform an upsert after every other profile package retrieved, and at the end it should perform a merge and delete the created csv. Unfortunately, **at this moment I didn't test this scenario!**
|
|
112
115
|
|
|
113
116
|
### Prerequisite 3 - Create the csv files for the first time
|
|
114
117
|
Once all the metadata have been downloaded, before to start dealing with the csv files, you should create them the first time.
|
|
@@ -137,13 +140,13 @@ the plugin generates a folder with all the csv files.
|
|
|
137
140
|

|
|
138
141
|
|
|
139
142
|
### Upsert
|
|
140
|
-
Suppose the developer
|
|
141
|
-
To update the profiles
|
|
143
|
+
Suppose the developer creates a new object, creates some fields, and assigns the fields, layouts and object permissions to the various profiles.
|
|
144
|
+
To update the profiles in the repository, the developer can:
|
|
142
145
|
1. Make the changes on Salesforce org
|
|
143
146
|
2. Create a package xml with the object, layout, fields and all profiles
|
|
144
147
|
3. Retrieve the package. All profiles will now contain only the tags related to the new object, layout and fields
|
|
145
|
-
4. *Execute the upsert command for profiles. The upsert command will insert the new tags into the
|
|
146
|
-
5. Then
|
|
148
|
+
4. *Execute the upsert command for profiles. The upsert command will insert the new tags into the CSV files*
|
|
149
|
+
5. Then merge back to have the profiles ready to be deployed elsewhere
|
|
147
150
|
|
|
148
151
|
|
|
149
152
|
**NOTE: the upsert doesn't delete any unused reference. If the user deletes a field, he should run the delete command**
|
|
@@ -151,14 +154,14 @@ To update the profiles on the repository, he can:
|
|
|
151
154
|
|
|
152
155
|
### UpdateKey
|
|
153
156
|
|
|
154
|
-
Suppose the developer makes some
|
|
157
|
+
Suppose the developer makes some modifications directly in the CSV files. With the updatekey command, they can update the tagid column if needed.
|
|
155
158
|
|
|
156
159
|
|
|
157
160
|
### Merge
|
|
158
161
|
|
|
159
|
-
When the
|
|
162
|
+
When the developer needs to deploy the code, he first needs to merge back the CSV files to restore and update the original XML files based on the content of the CSV files.
|
|
160
163
|
|
|
161
|
-
Another scenario could be during a cherry pick or a merge conflict. Suppose a developer has created a custom field and he retrieves the package with the field and the profiles. Then he performs the upsert to insert the field into the csv, and then he merges the profiles to have again the full xml files. He commits and all is OK in the dev environment. If the profiles are not aligned between the sandboxes, the cherry pick or the merge through the UAT branch could raise a conflict on the xml files. If
|
|
164
|
+
Another scenario could be during a cherry pick or a merge conflict. Suppose a developer has created a custom field and he retrieves the package with the field and the profiles. Then he performs the upsert to insert the field into the csv, and then he merges the profiles to have again the full xml files. He commits and all is OK in the dev environment. If the profiles are not aligned between the sandboxes, the cherry pick or the merge through the UAT branch could raise a conflict on the xml files. If he configured a git merger for the csv files, he probably will not have conflicts on the csv. So he can simply run the merge command again, to restore the correct version of the xml files automatically and without any effort!
|
|
162
165
|
|
|
163
166
|
### Delete
|
|
164
167
|
**Note: only applies to Profiles, PermissionSets and RecordTypes**
|
|
@@ -168,17 +171,57 @@ This command is intended to delete references, and it has flags to specify the n
|
|
|
168
171
|
|
|
169
172
|
### Minify
|
|
170
173
|
|
|
171
|
-
This command is very useful if you don't want to have
|
|
174
|
+
This command is very useful if you don't want to have in your csv files all the lines that don't add value to the file. The minify command is available for **profiles**, **permissionsets**, **objecttranslations**, and **translations**.
|
|
172
175
|
|
|
173
176
|
For example, in the following image, the lines in red don't specify any permission so they could be removed.
|
|
174
177
|
|
|
175
178
|
```sh-session
|
|
176
179
|
$ sfdx easysources:profiles:minify
|
|
180
|
+
$ sfdx easysources:permissionsets:minify
|
|
181
|
+
$ sfdx easysources:objecttranslations:minify
|
|
182
|
+
$ sfdx easysources:translations:minify
|
|
177
183
|
```
|
|
178
184
|
|
|
179
185
|

|
|
180
186
|
|
|
181
|
-
If you want a permission to be ignored even if it is false you can write FALSE instead of false: when I tested this feature, it
|
|
187
|
+
If you want a permission to be ignored even if it is false you can write FALSE instead of false: when I tested this feature, it worked correctly in Salesforce.
|
|
188
|
+
|
|
189
|
+
### Clearempty
|
|
190
|
+
|
|
191
|
+
This command removes empty CSV files and folders from the generated CSV files, helping to keep your repository clean. The clearempty command is available for **profiles**, **permissionsets**, **objecttranslations**, and **translations**.
|
|
192
|
+
|
|
193
|
+
After splitting metadata into CSV files, you might end up with empty CSV files or empty folders that don't contain any meaningful data. This command identifies and removes these empty files and directories automatically.
|
|
194
|
+
|
|
195
|
+
```sh-session
|
|
196
|
+
$ sfdx easysources:profiles:clearempty
|
|
197
|
+
$ sfdx easysources:permissionsets:clearempty
|
|
198
|
+
$ sfdx easysources:objecttranslations:clearempty
|
|
199
|
+
$ sfdx easysources:translations:clearempty
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
This is particularly useful for object translations where you might have many empty field translation files, or for translations where some language files might be empty.
|
|
203
|
+
|
|
204
|
+
### AreAligned
|
|
205
|
+
|
|
206
|
+
This command validates whether XML files and their corresponding CSV files are properly synchronized and aligned. It's particularly useful for ensuring data integrity and troubleshooting issues where CSV and XML representations might have diverged.
|
|
207
|
+
|
|
208
|
+
The command supports two validation modes:
|
|
209
|
+
|
|
210
|
+
**String Mode** (`--mode string` - default):
|
|
211
|
+
```sh-session
|
|
212
|
+
$ sfdx easysources:profiles:arealigned --mode string
|
|
213
|
+
# or simply (uses string mode by default):
|
|
214
|
+
$ sfdx easysources:profiles:arealigned
|
|
215
|
+
```
|
|
216
|
+
Performs an exact string comparison by temporarily merging CSV files back into XML format and comparing the complete file content character by character. This mode detects even minor formatting differences and is the default mode.
|
|
217
|
+
|
|
218
|
+
**Logic Mode** (`--mode logic`):
|
|
219
|
+
```sh-session
|
|
220
|
+
$ sfdx easysources:profiles:arealigned --mode logic
|
|
221
|
+
```
|
|
222
|
+
Performs a logical comparison by parsing both XML and CSV data structures and comparing the actual values. This mode is faster and focuses on data content rather than formatting differences.
|
|
223
|
+
|
|
224
|
+
Both modes provide detailed validation reports showing which files are aligned, misaligned, or have warnings, helping developers identify and resolve synchronization issues between XML and CSV representations.
|
|
182
225
|
|
|
183
226
|
## A special note on object translations
|
|
184
227
|
The object translation metadata is a little different, because when you download all custom objects with all object translations, salesforce retrieves an xml file for each field of the objects.
|
|
@@ -203,3 +246,16 @@ In my project I still have the xml files even if they are supported by csv.
|
|
|
203
246
|
It could be a great idea and it could avoid many conflicts and waste of time if the release manager removes the xml files from the repository, and the pipeline merges automatically the csv into the xml at runtime while deploying.
|
|
204
247
|
|
|
205
248
|
I know that the commands parameters can easily lead to misunderstanding or can be forgotten. I'm developing a vscode extension to easily launch the commands, get the parameters, select the resources on which a command must be run. But at the moment there is no ETA to finish it.
|
|
249
|
+
|
|
250
|
+
## Release Notes
|
|
251
|
+
|
|
252
|
+
### Version 0.7.0
|
|
253
|
+
- **New Feature: `arealigned` command for all metadata types** - Introduced a new validation command that checks if XML and corresponding CSV files are properly aligned. This command is available for all supported metadata types (profiles, recordtypes, translations, objecttranslations, etc.) and provides two validation modes:
|
|
254
|
+
- `--mode string` (default): Performs exact string comparison by temporarily merging CSV files back to XML and comparing the full file content
|
|
255
|
+
- `--mode logic`: Performs logical comparison at the value level, comparing the actual data structures after parsing
|
|
256
|
+
- **New Feature: `clearempty` command for profiles and permissionsets** - Added the clearempty command for `profiles:clearempty` and `permissionsets:clearempty` that removes empty CSV files and folders from the generated CSV files. This command helps clean up the repository by removing unnecessary empty files and directories that may be created during the split process.
|
|
257
|
+
- **Bug Fix: Enhanced `recordtypes:delete` command** - Fixed and improved the delete command for record types. Now supports comma-separated notation for both picklist values and picklist entries, providing more flexibility when specifying multiple items to delete.
|
|
258
|
+
|
|
259
|
+
### Version 0.6.0
|
|
260
|
+
- Added `objecttranslations:clearempty` command that removes empty CSV files and folders from the generated CSV files. This command helps clean up the repository by removing unnecessary empty files and directories that may be created during the split process.
|
|
261
|
+
- Added `translations:clearempty` command that removes empty CSV files and folders from translations. Similar to the object translations command, it helps maintain a clean repository structure by removing empty CSV files and unused folders.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class ApplicationsAreAligned extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
protected static flagsConfig: {
|
|
10
|
+
"sf-xml": flags.Discriminated<flags.String>;
|
|
11
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
12
|
+
input: flags.Discriminated<flags.String>;
|
|
13
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
14
|
+
mode: flags.Discriminated<flags.Enum<string>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<AnyJson>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const command_1 = require("@salesforce/command");
|
|
5
|
+
const core_1 = require("@salesforce/core");
|
|
6
|
+
const constants_applications_1 = require("../../../utils/constants/constants_applications");
|
|
7
|
+
const performance_1 = require("../../../utils/performance");
|
|
8
|
+
const alignmentChecker_1 = require("../../../utils/commands/alignmentChecker");
|
|
9
|
+
const constants_1 = require("../../../utils/constants/constants");
|
|
10
|
+
// Initialize Messages with the current plugin directory
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
13
|
+
// or any library that is using the messages framework can also be loaded this way.
|
|
14
|
+
const messages = core_1.Messages.loadMessages('sfdx-easy-sources', 'applications_arealigned');
|
|
15
|
+
class ApplicationsAreAligned extends command_1.SfdxCommand {
|
|
16
|
+
async run() {
|
|
17
|
+
performance_1.default.getInstance().start();
|
|
18
|
+
let result;
|
|
19
|
+
if (this.flags.mode === 'string') {
|
|
20
|
+
result = await (0, alignmentChecker_1.areAligned)(this.flags, constants_applications_1.APPLICATIONS_SUBPATH, constants_applications_1.APPLICATIONS_EXTENSION, constants_applications_1.APPLICATIONS_ROOT_TAG, constants_applications_1.APPLICATION_ITEMS);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result = await (0, alignmentChecker_1.validateAlignment)(this.flags, constants_applications_1.APPLICATIONS_SUBPATH, constants_applications_1.APPLICATIONS_EXTENSION, constants_applications_1.APPLICATIONS_ROOT_TAG, constants_applications_1.APPLICATION_ITEMS);
|
|
24
|
+
}
|
|
25
|
+
performance_1.default.getInstance().end();
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = ApplicationsAreAligned;
|
|
30
|
+
ApplicationsAreAligned.description = messages.getMessage('commandDescription');
|
|
31
|
+
ApplicationsAreAligned.examples = messages.getMessage('examples').split(os.EOL);
|
|
32
|
+
ApplicationsAreAligned.args = [{ name: 'file' }];
|
|
33
|
+
ApplicationsAreAligned.flagsConfig = {
|
|
34
|
+
// flag with a value (-n, --name=VALUE)
|
|
35
|
+
"sf-xml": command_1.flags.string({
|
|
36
|
+
char: 'x',
|
|
37
|
+
description: messages.getMessage('sfXmlFlagDescription', [constants_1.DEFAULT_SFXML_PATH]),
|
|
38
|
+
}),
|
|
39
|
+
"es-csv": command_1.flags.string({
|
|
40
|
+
char: 'c',
|
|
41
|
+
description: messages.getMessage('esCsvFlagDescription', [constants_1.DEFAULT_ESCSV_PATH]),
|
|
42
|
+
}),
|
|
43
|
+
input: command_1.flags.string({
|
|
44
|
+
char: 'i',
|
|
45
|
+
description: messages.getMessage('inputFlagDescription'),
|
|
46
|
+
}),
|
|
47
|
+
sort: command_1.flags.enum({
|
|
48
|
+
char: 'S',
|
|
49
|
+
description: messages.getMessage('sortFlagDescription', ['true']),
|
|
50
|
+
options: ['true', 'false'],
|
|
51
|
+
default: 'true',
|
|
52
|
+
}),
|
|
53
|
+
mode: command_1.flags.enum({
|
|
54
|
+
char: 'm',
|
|
55
|
+
description: messages.getMessage('modeFlagDescription', ['string']),
|
|
56
|
+
options: ['string', 'logic'],
|
|
57
|
+
default: 'string',
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=arealigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arealigned.js","sourceRoot":"","sources":["../../../../src/commands/easysources/applications/arealigned.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,4FAAyJ;AACzJ,4DAAqD;AACrD,+EAAyF;AACzF,kEAA4F;AAE5F,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,CAAC;AAEvF,MAAqB,sBAAuB,SAAQ,qBAAW;IAqCtD,KAAK,CAAC,GAAG;QACd,qBAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAElC,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,MAAM,GAAG,MAAM,IAAA,6BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,6CAAoB,EAAE,+CAAsB,EAAE,8CAAqB,EAAE,0CAAiB,CAAC,CAAC;SAC/H;aAAM;YACL,MAAM,GAAG,MAAM,IAAA,oCAAiB,EAAC,IAAI,CAAC,KAAK,EAAE,6CAAoB,EAAE,+CAAsB,EAAE,8CAAqB,EAAE,0CAAiB,CAAC,CAAC;SACtI;QAED,qBAAW,CAAC,WAAW,EAAE,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AAC;QAC5B,OAAO,EAAE,QAAQ;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class GlobalValueSetsAreAligned extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
protected static flagsConfig: {
|
|
10
|
+
"sf-xml": flags.Discriminated<flags.String>;
|
|
11
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
12
|
+
input: flags.Discriminated<flags.String>;
|
|
13
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
14
|
+
mode: flags.Discriminated<flags.Enum<string>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<AnyJson>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const command_1 = require("@salesforce/command");
|
|
5
|
+
const core_1 = require("@salesforce/core");
|
|
6
|
+
const constants_globalvaluesets_1 = require("../../../utils/constants/constants_globalvaluesets");
|
|
7
|
+
const performance_1 = require("../../../utils/performance");
|
|
8
|
+
const alignmentChecker_1 = require("../../../utils/commands/alignmentChecker");
|
|
9
|
+
const constants_1 = require("../../../utils/constants/constants");
|
|
10
|
+
// Initialize Messages with the current plugin directory
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
13
|
+
// or any library that is using the messages framework can also be loaded this way.
|
|
14
|
+
const messages = core_1.Messages.loadMessages('sfdx-easy-sources', 'globalvaluesets_arealigned');
|
|
15
|
+
class GlobalValueSetsAreAligned extends command_1.SfdxCommand {
|
|
16
|
+
async run() {
|
|
17
|
+
performance_1.default.getInstance().start();
|
|
18
|
+
let result;
|
|
19
|
+
if (this.flags.mode === 'string') {
|
|
20
|
+
result = await (0, alignmentChecker_1.areAligned)(this.flags, constants_globalvaluesets_1.GVSETS_SUBPATH, constants_globalvaluesets_1.GVSETS_EXTENSION, constants_globalvaluesets_1.GVSETS_ROOT_TAG, constants_globalvaluesets_1.GVSET_ITEMS);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result = await (0, alignmentChecker_1.validateAlignment)(this.flags, constants_globalvaluesets_1.GVSETS_SUBPATH, constants_globalvaluesets_1.GVSETS_EXTENSION, constants_globalvaluesets_1.GVSETS_ROOT_TAG, constants_globalvaluesets_1.GVSET_ITEMS);
|
|
24
|
+
}
|
|
25
|
+
performance_1.default.getInstance().end();
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = GlobalValueSetsAreAligned;
|
|
30
|
+
GlobalValueSetsAreAligned.description = messages.getMessage('commandDescription');
|
|
31
|
+
GlobalValueSetsAreAligned.examples = messages.getMessage('examples').split(os.EOL);
|
|
32
|
+
GlobalValueSetsAreAligned.args = [{ name: 'file' }];
|
|
33
|
+
GlobalValueSetsAreAligned.flagsConfig = {
|
|
34
|
+
// flag with a value (-n, --name=VALUE)
|
|
35
|
+
"sf-xml": command_1.flags.string({
|
|
36
|
+
char: 'x',
|
|
37
|
+
description: messages.getMessage('sfXmlFlagDescription', [constants_1.DEFAULT_SFXML_PATH]),
|
|
38
|
+
}),
|
|
39
|
+
"es-csv": command_1.flags.string({
|
|
40
|
+
char: 'c',
|
|
41
|
+
description: messages.getMessage('esCsvFlagDescription', [constants_1.DEFAULT_ESCSV_PATH]),
|
|
42
|
+
}),
|
|
43
|
+
input: command_1.flags.string({
|
|
44
|
+
char: 'i',
|
|
45
|
+
description: messages.getMessage('inputFlagDescription'),
|
|
46
|
+
}),
|
|
47
|
+
sort: command_1.flags.enum({
|
|
48
|
+
char: 'S',
|
|
49
|
+
description: messages.getMessage('sortFlagDescription', ['true']),
|
|
50
|
+
options: ['true', 'false'],
|
|
51
|
+
default: 'true',
|
|
52
|
+
}),
|
|
53
|
+
mode: command_1.flags.enum({
|
|
54
|
+
char: 'm',
|
|
55
|
+
description: messages.getMessage('modeFlagDescription', ['string']),
|
|
56
|
+
options: ['string', 'logic'],
|
|
57
|
+
default: 'string',
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=arealigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arealigned.js","sourceRoot":"","sources":["../../../../src/commands/easysources/globalvaluesets/arealigned.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,kGAAoI;AACpI,4DAAqD;AACrD,+EAAyF;AACzF,kEAA4F;AAE5F,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,mBAAmB,EAAE,4BAA4B,CAAC,CAAC;AAE1F,MAAqB,yBAA0B,SAAQ,qBAAW;IAoCzD,KAAK,CAAC,GAAG;QACd,qBAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAElC,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,MAAM,GAAG,MAAM,IAAA,6BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,0CAAc,EAAE,4CAAgB,EAAE,2CAAe,EAAE,uCAAW,CAAC,CAAC;SACvG;aAAM;YACL,MAAM,GAAG,MAAM,IAAA,oCAAiB,EAAC,IAAI,CAAC,KAAK,EAAE,0CAAc,EAAE,4CAAgB,EAAE,2CAAe,EAAE,uCAAW,CAAC,CAAC;SAC9G;QAED,qBAAW,CAAC,WAAW,EAAE,CAAC,GA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C5B,OAAO,EAAE,QAAQ;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class GlobalValueSetTranslationsAreAligned extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
protected static flagsConfig: {
|
|
10
|
+
"sf-xml": flags.Discriminated<flags.String>;
|
|
11
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
12
|
+
input: flags.Discriminated<flags.String>;
|
|
13
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
14
|
+
mode: flags.Discriminated<flags.Enum<string>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<AnyJson>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const command_1 = require("@salesforce/command");
|
|
5
|
+
const core_1 = require("@salesforce/core");
|
|
6
|
+
const constants_globalvaluesettranslations_1 = require("../../../utils/constants/constants_globalvaluesettranslations");
|
|
7
|
+
const performance_1 = require("../../../utils/performance");
|
|
8
|
+
const alignmentChecker_1 = require("../../../utils/commands/alignmentChecker");
|
|
9
|
+
const constants_1 = require("../../../utils/constants/constants");
|
|
10
|
+
// Initialize Messages with the current plugin directory
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
13
|
+
// or any library that is using the messages framework can also be loaded this way.
|
|
14
|
+
const messages = core_1.Messages.loadMessages('sfdx-easy-sources', 'globalvaluesettranslations_arealigned');
|
|
15
|
+
class GlobalValueSetTranslationsAreAligned extends command_1.SfdxCommand {
|
|
16
|
+
async run() {
|
|
17
|
+
performance_1.default.getInstance().start();
|
|
18
|
+
let result;
|
|
19
|
+
if (this.flags.mode === 'string') {
|
|
20
|
+
result = await (0, alignmentChecker_1.areAligned)(this.flags, constants_globalvaluesettranslations_1.GVSETTRANS_SUBPATH, constants_globalvaluesettranslations_1.GVSETTRANS_EXTENSION, constants_globalvaluesettranslations_1.GVSETTRANS_ROOT_TAG, constants_globalvaluesettranslations_1.GVSETTRAN_ITEMS);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result = await (0, alignmentChecker_1.validateAlignment)(this.flags, constants_globalvaluesettranslations_1.GVSETTRANS_SUBPATH, constants_globalvaluesettranslations_1.GVSETTRANS_EXTENSION, constants_globalvaluesettranslations_1.GVSETTRANS_ROOT_TAG, constants_globalvaluesettranslations_1.GVSETTRAN_ITEMS);
|
|
24
|
+
}
|
|
25
|
+
performance_1.default.getInstance().end();
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = GlobalValueSetTranslationsAreAligned;
|
|
30
|
+
GlobalValueSetTranslationsAreAligned.description = messages.getMessage('commandDescription');
|
|
31
|
+
GlobalValueSetTranslationsAreAligned.examples = messages.getMessage('examples').split(os.EOL);
|
|
32
|
+
GlobalValueSetTranslationsAreAligned.args = [{ name: 'file' }];
|
|
33
|
+
GlobalValueSetTranslationsAreAligned.flagsConfig = {
|
|
34
|
+
// flag with a value (-n, --name=VALUE)
|
|
35
|
+
"sf-xml": command_1.flags.string({
|
|
36
|
+
char: 'x',
|
|
37
|
+
description: messages.getMessage('sfXmlFlagDescription', [constants_1.DEFAULT_SFXML_PATH]),
|
|
38
|
+
}),
|
|
39
|
+
"es-csv": command_1.flags.string({
|
|
40
|
+
char: 'c',
|
|
41
|
+
description: messages.getMessage('esCsvFlagDescription', [constants_1.DEFAULT_ESCSV_PATH]),
|
|
42
|
+
}),
|
|
43
|
+
input: command_1.flags.string({
|
|
44
|
+
char: 'i',
|
|
45
|
+
description: messages.getMessage('inputFlagDescription'),
|
|
46
|
+
}),
|
|
47
|
+
sort: command_1.flags.enum({
|
|
48
|
+
char: 'S',
|
|
49
|
+
description: messages.getMessage('sortFlagDescription', ['true']),
|
|
50
|
+
options: ['true', 'false'],
|
|
51
|
+
default: 'true',
|
|
52
|
+
}),
|
|
53
|
+
mode: command_1.flags.enum({
|
|
54
|
+
char: 'm',
|
|
55
|
+
description: messages.getMessage('modeFlagDescription', ['string']),
|
|
56
|
+
options: ['string', 'logic'],
|
|
57
|
+
default: 'string',
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=arealigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arealigned.js","sourceRoot":"","sources":["../../../../src/commands/easysources/globalvaluesettranslations/arealigned.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,wHAA+J;AAC/J,4DAAqD;AACrD,+EAAyF;AACzF,kEAA4F;AAE5F,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,mBAAmB,EAAE,uCAAuC,CAAC,CAAC;AAErG,MAAqB,oCAAqC,SAAQ,qBAAW;IAoCpE,KAAK,CAAC,GAAG;QACd,qBAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAElC,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,MAAM,GAAG,MAAM,IAAA,6BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,yDAAkB,EAAE,2DAAoB,EAAE,0DAAmB,EAAE,sDAAe,CAAC,CAAC;SACvH;aAAM;YACL,MAAM,GAAG,MAAM,IAAA,oCAAiB,EAAC,IAAI,CAAC,KAAK,EAAE,yD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C,UAAU,CAAC,qBAAqB,EAAE,CAAC,QAAQ,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC5B,OAAO,EAAE,QAAQ;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class LabelsAreAligned extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
protected static flagsConfig: {
|
|
10
|
+
"sf-xml": flags.Discriminated<flags.String>;
|
|
11
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
12
|
+
input: flags.Discriminated<flags.String>;
|
|
13
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
14
|
+
mode: flags.Discriminated<flags.Enum<string>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<AnyJson>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const command_1 = require("@salesforce/command");
|
|
5
|
+
const core_1 = require("@salesforce/core");
|
|
6
|
+
const constants_labels_1 = require("../../../utils/constants/constants_labels");
|
|
7
|
+
const performance_1 = require("../../../utils/performance");
|
|
8
|
+
const alignmentChecker_1 = require("../../../utils/commands/alignmentChecker");
|
|
9
|
+
const constants_1 = require("../../../utils/constants/constants");
|
|
10
|
+
// Initialize Messages with the current plugin directory
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
13
|
+
// or any library that is using the messages framework can also be loaded this way.
|
|
14
|
+
const messages = core_1.Messages.loadMessages('sfdx-easy-sources', 'labels_arealigned');
|
|
15
|
+
class LabelsAreAligned extends command_1.SfdxCommand {
|
|
16
|
+
async run() {
|
|
17
|
+
performance_1.default.getInstance().start();
|
|
18
|
+
let result;
|
|
19
|
+
if (this.flags.mode === 'string') {
|
|
20
|
+
result = await (0, alignmentChecker_1.areAligned)(this.flags, constants_labels_1.LABELS_SUBPATH, constants_labels_1.LABELS_EXTENSION, constants_labels_1.LABELS_ROOT_TAG, constants_labels_1.LABEL_ITEMS);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result = await (0, alignmentChecker_1.validateAlignment)(this.flags, constants_labels_1.LABELS_SUBPATH, constants_labels_1.LABELS_EXTENSION, constants_labels_1.LABELS_ROOT_TAG, constants_labels_1.LABEL_ITEMS);
|
|
24
|
+
}
|
|
25
|
+
performance_1.default.getInstance().end();
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = LabelsAreAligned;
|
|
30
|
+
LabelsAreAligned.description = messages.getMessage('commandDescription');
|
|
31
|
+
LabelsAreAligned.examples = messages.getMessage('examples').split(os.EOL);
|
|
32
|
+
LabelsAreAligned.args = [{ name: 'file' }];
|
|
33
|
+
LabelsAreAligned.flagsConfig = {
|
|
34
|
+
// flag with a value (-n, --name=VALUE)
|
|
35
|
+
"sf-xml": command_1.flags.string({
|
|
36
|
+
char: 'x',
|
|
37
|
+
description: messages.getMessage('sfXmlFlagDescription', [constants_1.DEFAULT_SFXML_PATH]),
|
|
38
|
+
}),
|
|
39
|
+
"es-csv": command_1.flags.string({
|
|
40
|
+
char: 'c',
|
|
41
|
+
description: messages.getMessage('esCsvFlagDescription', [constants_1.DEFAULT_ESCSV_PATH]),
|
|
42
|
+
}),
|
|
43
|
+
input: command_1.flags.string({
|
|
44
|
+
char: 'i',
|
|
45
|
+
description: messages.getMessage('inputFlagDescription'),
|
|
46
|
+
}),
|
|
47
|
+
sort: command_1.flags.enum({
|
|
48
|
+
char: 'S',
|
|
49
|
+
description: messages.getMessage('sortFlagDescription', ['true']),
|
|
50
|
+
options: ['true', 'false'],
|
|
51
|
+
default: 'true',
|
|
52
|
+
}),
|
|
53
|
+
mode: command_1.flags.enum({
|
|
54
|
+
char: 'm',
|
|
55
|
+
description: messages.getMessage('modeFlagDescription', ['string']),
|
|
56
|
+
options: ['string', 'logic'],
|
|
57
|
+
default: 'string',
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=arealigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arealigned.js","sourceRoot":"","sources":["../../../../src/commands/easysources/labels/arealigned.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,gFAA2H;AAC3H,4DAAqD;AACrD,+EAAyF;AACzF,kEAA4F;AAE5F,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;AAEjF,MAAqB,gBAAiB,SAAQ,qBAAW;IAoChD,KAAK,CAAC,GAAG;QACd,qBAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAElC,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,MAAM,GAAG,MAAM,IAAA,6BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,iCAAc,EAAE,mCAAgB,EAAE,kCAAe,EAAE,8BAAW,CAAC,CAAC;SACvG;aAAM;YACL,MAAM,GAAG,MAAM,IAAA,oCAAiB,EAAC,IAAI,CAAC,KAAK,EAAE,iCAAc,EAAE,mCAAgB,EAAE,kCAAe,EAAE,8BAAW,CAAC,CAAC;SAC9G;QAED,qBAAW,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QAChC,O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;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class AreAligned extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
protected static flagsConfig: {
|
|
7
|
+
"sf-xml": flags.Discriminated<flags.String>;
|
|
8
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
9
|
+
input: flags.Discriminated<flags.String>;
|
|
10
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
11
|
+
mode: flags.Discriminated<flags.Enum<string>>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<AnyJson>;
|
|
14
|
+
private validateAlignmentLogic;
|
|
15
|
+
private validateSingleObjectTranslation;
|
|
16
|
+
private validateFieldTranslations;
|
|
17
|
+
private areAlignedString;
|
|
18
|
+
private compareStrings;
|
|
19
|
+
private compareFieldTranslationsStrings;
|
|
20
|
+
}
|