sfdx-easy-sources 0.9.5 → 0.9.6
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/api/translations.d.ts +6 -0
- package/lib/api/translations.js +9 -0
- package/lib/api/translations.js.map +1 -1
- package/lib/commands/easysources/translations/updatekey.d.ts +13 -0
- package/lib/commands/easysources/translations/updatekey.js +55 -0
- package/lib/commands/easysources/translations/updatekey.js.map +1 -0
- package/messages/translations_updatekey.json +10 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -77,4 +77,10 @@ export declare const translations: {
|
|
|
77
77
|
* @returns Promise resolving to cleanup result
|
|
78
78
|
*/
|
|
79
79
|
clearEmpty: (options?: TranslationOptions) => Promise<AnyJson>;
|
|
80
|
+
/**
|
|
81
|
+
* Updates the _tagid key on CSV files based on the other fields.
|
|
82
|
+
* @param options Optional configuration, automatically resolved from settings if not provided
|
|
83
|
+
* @returns Promise resolving to operation result
|
|
84
|
+
*/
|
|
85
|
+
updateKey: (options?: TranslationOptions) => Promise<AnyJson>;
|
|
80
86
|
};
|
package/lib/api/translations.js
CHANGED
|
@@ -8,6 +8,7 @@ const merge_1 = require("../commands/easysources/translations/merge");
|
|
|
8
8
|
const arealigned_1 = require("../commands/easysources/translations/arealigned");
|
|
9
9
|
const minify_1 = require("../commands/easysources/translations/minify");
|
|
10
10
|
const clearempty_1 = require("../commands/easysources/translations/clearempty");
|
|
11
|
+
const updatekey_1 = require("../commands/easysources/translations/updatekey");
|
|
11
12
|
/**
|
|
12
13
|
* Translations namespace containing all programmatic API functions for Salesforce Translation metadata operations.
|
|
13
14
|
*
|
|
@@ -84,6 +85,14 @@ exports.translations = {
|
|
|
84
85
|
*/
|
|
85
86
|
clearEmpty: async (options = {}) => {
|
|
86
87
|
return (0, clearempty_1.translationClearEmpty)(options);
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Updates the _tagid key on CSV files based on the other fields.
|
|
91
|
+
* @param options Optional configuration, automatically resolved from settings if not provided
|
|
92
|
+
* @returns Promise resolving to operation result
|
|
93
|
+
*/
|
|
94
|
+
updateKey: async (options = {}) => {
|
|
95
|
+
return (0, updatekey_1.translationUpdateKey)(options);
|
|
87
96
|
}
|
|
88
97
|
};
|
|
89
98
|
//# sourceMappingURL=translations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../../src/api/translations.ts"],"names":[],"mappings":";;;AAGA,oEAAoE;AACpE,sEAA8E;AAC9E,wEAAgF;AAChF,sEAA8E;AAC9E,gFAAwF;AACxF,wEAAgF;AAChF,gFAAwF;
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../../src/api/translations.ts"],"names":[],"mappings":";;;AAGA,oEAAoE;AACpE,sEAA8E;AAC9E,wEAAgF;AAChF,sEAA8E;AAC9E,gFAAwF;AACxF,wEAAgF;AAChF,gFAAwF;AACxF,8EAAsF;AAetF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,YAAY,GAAG;IAC1B;;;;OAIG;IACH,KAAK,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QAClE,OAAO,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,MAAM,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QACnE,OAAO,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,KAAK,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QAClE,OAAO,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,UAAU,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QACvE,OAAO,IAAA,kCAAqB,EAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,MAAM,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QACnE,OAAO,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,UAAU,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QACvE,OAAO,IAAA,kCAAqB,EAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,SAAS,EAAE,KAAK,EAAE,UAA8B,EAAE,EAAoB,EAAE;QACtE,OAAO,IAAA,gCAAoB,EAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class UpdateKey extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
protected static flagsConfig: {
|
|
7
|
+
"es-csv": flags.Discriminated<flags.String>;
|
|
8
|
+
input: flags.Discriminated<flags.String>;
|
|
9
|
+
sort: flags.Discriminated<flags.Enum<string>>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<AnyJson>;
|
|
12
|
+
}
|
|
13
|
+
export declare function translationUpdateKey(options?: any): Promise<AnyJson>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translationUpdateKey = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const os = require("os");
|
|
11
|
+
const command_1 = require("@salesforce/command");
|
|
12
|
+
const core_1 = require("@salesforce/core");
|
|
13
|
+
const performance_1 = require("../../../utils/performance");
|
|
14
|
+
const keyupdater_1 = require("../../../utils/commands/keyupdater");
|
|
15
|
+
const constants_translations_1 = require("../../../utils/constants/constants_translations");
|
|
16
|
+
const constants_1 = require("../../../utils/constants/constants");
|
|
17
|
+
// Initialize Messages with the current plugin directory
|
|
18
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
19
|
+
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
20
|
+
// or any library that is using the messages framework can also be loaded this way.
|
|
21
|
+
const messages = core_1.Messages.loadMessages('sfdx-easy-sources', 'translations_updatekey');
|
|
22
|
+
class UpdateKey extends command_1.SfdxCommand {
|
|
23
|
+
async run() {
|
|
24
|
+
performance_1.default.getInstance().start();
|
|
25
|
+
var result = await translationUpdateKey(this.flags);
|
|
26
|
+
performance_1.default.getInstance().end();
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = UpdateKey;
|
|
31
|
+
UpdateKey.description = messages.getMessage('commandDescription');
|
|
32
|
+
UpdateKey.examples = messages.getMessage('examples').split(os.EOL);
|
|
33
|
+
UpdateKey.flagsConfig = {
|
|
34
|
+
// flag with a value (-n, --name=VALUE)
|
|
35
|
+
"es-csv": command_1.flags.string({
|
|
36
|
+
char: 'c',
|
|
37
|
+
description: messages.getMessage('esCsvFlagDescription', [constants_1.DEFAULT_ESCSV_PATH]),
|
|
38
|
+
}),
|
|
39
|
+
input: command_1.flags.string({
|
|
40
|
+
char: 'i',
|
|
41
|
+
description: messages.getMessage('inputFlagDescription'),
|
|
42
|
+
}),
|
|
43
|
+
sort: command_1.flags.enum({
|
|
44
|
+
char: 'S',
|
|
45
|
+
description: messages.getMessage('sortFlagDescription', ['true']),
|
|
46
|
+
options: ['true', 'false'],
|
|
47
|
+
default: 'true',
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
// Export function for programmatic API
|
|
51
|
+
async function translationUpdateKey(options = {}) {
|
|
52
|
+
return await (0, keyupdater_1.updatekey)(options, constants_translations_1.TRANSLATIONS_SUBPATH, constants_translations_1.TRANSLATION_ITEMS);
|
|
53
|
+
}
|
|
54
|
+
exports.translationUpdateKey = translationUpdateKey;
|
|
55
|
+
//# sourceMappingURL=updatekey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updatekey.js","sourceRoot":"","sources":["../../../../src/commands/easysources/translations/updatekey.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,4DAAqD;AACrD,mEAA+D;AAC/D,4FAA0G;AAC1G,kEAAwE;AAExE,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,mBAAmB,EAAE,wBAAwB,CAAC,CAAC;AAEtF,MAAqB,SAAU,SAAQ,qBAAW;IAyBvC,KAAK,CAAC,GAAG;QACZ,qBAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAElC,IAAI,MAAM,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEpD,qBAAW,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;;AAhCL,4BAiCC;AAhCiB,qBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAExD,kBAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAGtD,qBAAW,GAAG;IAC3B,uCAAuC;IACvC,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACnB,IAAI,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;CACL,CAAC;AAaN,uCAAuC;AAChC,KAAK,UAAU,oBAAoB,CAAC,UAAe,EAAE;IACxD,OAAO,MAAM,IAAA,sBAAS,EAAC,OAAO,EAAE,6CAAoB,EAAE,0CAAiB,CAAC,CAAC;AAC7E,CAAC;AAFD,oDAEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commandDescription": "Update _tagid on csv files, based on the other fields",
|
|
3
|
+
"esCsvFlagDescription": "Specify a custom dir for input translations. Default: '%s'",
|
|
4
|
+
"inputFlagDescription": "Specify a translation. Example: en_US",
|
|
5
|
+
"sortFlagDescription" : "Specify if split results must be sorted. Default '%s'",
|
|
6
|
+
"examples": [
|
|
7
|
+
"sf easysources translations updatekey",
|
|
8
|
+
"sf easysources translations updatekey -c './easysources'"
|
|
9
|
+
]
|
|
10
|
+
}
|