@tolgee/cli 2.4.2 → 2.6.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/dist/cli.js CHANGED
@@ -107,7 +107,7 @@ async function run() {
107
107
  program.addOption(VERBOSE);
108
108
  program.addOption(CONFIG_OPT);
109
109
  program.addOption(API_URL_OPT.default(config.apiUrl ?? DEFAULT_API_URL));
110
- program.addOption(API_KEY_OPT);
110
+ program.addOption(API_KEY_OPT.default(config.apiKey));
111
111
  program.addOption(PROJECT_ID_OPT.default(config.projectId ?? -1));
112
112
  program.addOption(FORMAT_OPT.default(config.format ?? 'JSON_TOLGEE'));
113
113
  program.addOption(EXTRACTOR.default(config.extractor));
@@ -76,6 +76,7 @@ const syncHandler = (config) => async function () {
76
76
  translations: key.defaultValue
77
77
  ? { [baseLanguage.tag]: key.defaultValue }
78
78
  : {},
79
+ tags: opts.tagNewKeys,
79
80
  }));
80
81
  const loadable = await loading('Creating missing keys...', opts.client.POST('/v2/projects/{projectId}/keys/import', {
81
82
  params: { path: { projectId: opts.client.getProjectId() } },
@@ -116,4 +117,5 @@ export default (config) => new Command()
116
117
  .option('--continue-on-warning', 'Set this flag to continue the sync if warnings are detected during string extraction. By default, as warnings may indicate an invalid extraction, the CLI will abort the sync.')
117
118
  .option('-Y, --yes', 'Skip prompts and automatically say yes to them. You will not be asked for confirmation before creating/deleting keys.')
118
119
  .option('--remove-unused', 'Also delete unused keys from the Tolgee project.')
120
+ .option('--tag-new-keys <tags...>', 'Specify tags that will be added to newly created keys.')
119
121
  .action(syncHandler(config));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolgee/cli",
3
- "version": "2.4.2",
3
+ "version": "2.6.0",
4
4
  "type": "module",
5
5
  "description": "A tool to interact with the Tolgee Platform through CLI",
6
6
  "repository": {
package/schema.json CHANGED
@@ -9,6 +9,10 @@
9
9
  "description": "The url of Tolgee API.",
10
10
  "type": "string"
11
11
  },
12
+ "apiKey": {
13
+ "description": "Api key to Tolgee Platform.\n\nWARNING: Make sure you don't leak your API key\nUse `apiKey` only if you are loading it from an environment or other secured source (supported in .js or .yml files) or your config is not public.\n\nIn most cases, it's better to use a one-time `login` command or set it via the `TOLGEE_API_KEY` environment variable.",
14
+ "type": "string"
15
+ },
12
16
  "format": {
13
17
  "$ref": "#/$defs/format"
14
18
  },