sfdx-easy-sources 0.6.0 → 0.7.1
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 +78 -38
- 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/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.js +7 -69
- package/lib/commands/easysources/translations/clearempty.js.map +1 -1
- 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/commands/splitter.js +6 -0
- package/lib/utils/commands/splitter.js.map +1 -1
- package/lib/utils/commands/upserter.js +2 -1
- package/lib/utils/commands/upserter.js.map +1 -1
- package/lib/utils/filesUtils.js +13 -3
- package/lib/utils/filesUtils.js.map +1 -1
- package/lib/utils/localSettings.d.ts +1 -0
- package/lib/utils/localSettings.js +2 -1
- package/lib/utils/localSettings.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/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/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,14 +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
|
|
65
|
-
- Clearempty
|
|
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
|
|
66
68
|
|
|
67
69
|
# Disclaimer
|
|
68
70
|
- Please experiment at first inside a dummy project!
|
|
@@ -109,7 +111,7 @@ Some useful parameters are:
|
|
|
109
111
|
- --split-merge: if set to true, automatically performes a split and then a merge of all the sources, after they are retrieved
|
|
110
112
|
|
|
111
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.
|
|
112
|
-
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!**
|
|
113
115
|
|
|
114
116
|
### Prerequisite 3 - Create the csv files for the first time
|
|
115
117
|
Once all the metadata have been downloaded, before to start dealing with the csv files, you should create them the first time.
|
|
@@ -138,13 +140,13 @@ the plugin generates a folder with all the csv files.
|
|
|
138
140
|

|
|
139
141
|
|
|
140
142
|
### Upsert
|
|
141
|
-
Suppose the developer
|
|
142
|
-
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:
|
|
143
145
|
1. Make the changes on Salesforce org
|
|
144
146
|
2. Create a package xml with the object, layout, fields and all profiles
|
|
145
147
|
3. Retrieve the package. All profiles will now contain only the tags related to the new object, layout and fields
|
|
146
|
-
4. *Execute the upsert command for profiles. The upsert command will insert the new tags into the
|
|
147
|
-
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
|
|
148
150
|
|
|
149
151
|
|
|
150
152
|
**NOTE: the upsert doesn't delete any unused reference. If the user deletes a field, he should run the delete command**
|
|
@@ -152,14 +154,14 @@ To update the profiles on the repository, he can:
|
|
|
152
154
|
|
|
153
155
|
### UpdateKey
|
|
154
156
|
|
|
155
|
-
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.
|
|
156
158
|
|
|
157
159
|
|
|
158
160
|
### Merge
|
|
159
161
|
|
|
160
|
-
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.
|
|
161
163
|
|
|
162
|
-
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!
|
|
163
165
|
|
|
164
166
|
### Delete
|
|
165
167
|
**Note: only applies to Profiles, PermissionSets and RecordTypes**
|
|
@@ -169,17 +171,57 @@ This command is intended to delete references, and it has flags to specify the n
|
|
|
169
171
|
|
|
170
172
|
### Minify
|
|
171
173
|
|
|
172
|
-
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**.
|
|
173
175
|
|
|
174
176
|
For example, in the following image, the lines in red don't specify any permission so they could be removed.
|
|
175
177
|
|
|
176
178
|
```sh-session
|
|
177
179
|
$ sfdx easysources:profiles:minify
|
|
180
|
+
$ sfdx easysources:permissionsets:minify
|
|
181
|
+
$ sfdx easysources:objecttranslations:minify
|
|
182
|
+
$ sfdx easysources:translations:minify
|
|
178
183
|
```
|
|
179
184
|
|
|
180
185
|

|
|
181
186
|
|
|
182
|
-
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.
|
|
183
225
|
|
|
184
226
|
## A special note on object translations
|
|
185
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.
|
|
@@ -207,6 +249,4 @@ I know that the commands parameters can easily lead to misunderstanding or can b
|
|
|
207
249
|
|
|
208
250
|
## Release Notes
|
|
209
251
|
|
|
210
|
-
|
|
211
|
-
- 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.
|
|
212
|
-
- 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.
|
|
252
|
+
For detailed information about all releases, new features, bug fixes, and changes, please see the [**Release Notes**](https://github.com/raffo93p/sfdx-easy-sources/blob/main/RELEASE_NOTES.md).
|
|
@@ -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,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KACjF,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,OAAO,EAAE,MAAM;KAClB,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,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 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,C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AAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,OAAO,EAAE,MAAM;KAClB,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,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 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,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AI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,8BAAkB,CAAC,CAAC;KACjF,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,OAAO,EAAE,MAAM;KAClB,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,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,mBAA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AAK,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,OAAO,EAAE,MAAM;KAClB,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,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,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
|
+
}
|