@kopynator/cli 1.0.13 → 1.1.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/index.js +1 -1
- package/package.json +2 -1
- package/src/commands/sync.ts +11 -4
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -333,7 +333,7 @@ async function syncCommand() {
|
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
335
|
const syncConfig = await getSyncConfig();
|
|
336
|
-
const baseUrl = config.baseUrl || "
|
|
336
|
+
const baseUrl = config.baseUrl || "https://api.kopynator.com/api/tokens";
|
|
337
337
|
const token = config.apiKey;
|
|
338
338
|
const spinner = (0, import_ora.default)("\u{1F4E1} Connecting to Kopynator Cloud...").start();
|
|
339
339
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopynator/cli",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "CLI tool for Kopynator - The i18n management solution",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kopynator": "dist/index.js"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"author": "Carlos Florio",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@kopynator/core": "^1.0.1",
|
|
25
26
|
"chalk": "^4.1.2",
|
|
26
27
|
"commander": "^11.1.0",
|
|
27
28
|
"inquirer": "^8.2.6",
|
package/src/commands/sync.ts
CHANGED
|
@@ -193,7 +193,7 @@ export async function syncCommand() {
|
|
|
193
193
|
// Get sync configuration
|
|
194
194
|
const syncConfig = await getSyncConfig();
|
|
195
195
|
|
|
196
|
-
const baseUrl = config.baseUrl || '
|
|
196
|
+
const baseUrl = config.baseUrl || 'https://api.kopynator.com/api/tokens';
|
|
197
197
|
const token = config.apiKey;
|
|
198
198
|
|
|
199
199
|
const spinner = ora('📡 Connecting to Kopynator Cloud...').start();
|
|
@@ -202,8 +202,11 @@ export async function syncCommand() {
|
|
|
202
202
|
// 1. Fetch available languages
|
|
203
203
|
spinner.text = '📡 Fetching available languages...';
|
|
204
204
|
const languagesUrl = `${baseUrl}/languages?token=${token}`;
|
|
205
|
-
const languagesResponse = await fetch(languagesUrl
|
|
206
|
-
|
|
205
|
+
const languagesResponse = await fetch(languagesUrl, {
|
|
206
|
+
headers: {
|
|
207
|
+
'x-kopynator-version': '1.1.0'
|
|
208
|
+
}
|
|
209
|
+
});
|
|
207
210
|
if (!languagesResponse.ok) {
|
|
208
211
|
spinner.fail(`Failed to fetch languages: ${languagesResponse.status} ${languagesResponse.statusText}`);
|
|
209
212
|
return;
|
|
@@ -225,7 +228,11 @@ export async function syncCommand() {
|
|
|
225
228
|
const fetchUrl = `${baseUrl}/fetch?token=${token}&langs=${locale}&nested=${syncConfig.nested}&includeLangKey=${syncConfig.includeLangKey}&pretty=${syncConfig.pretty}&indent=${syncConfig.indent}`;
|
|
226
229
|
|
|
227
230
|
try {
|
|
228
|
-
const translationResponse = await fetch(fetchUrl
|
|
231
|
+
const translationResponse = await fetch(fetchUrl, {
|
|
232
|
+
headers: {
|
|
233
|
+
'x-kopynator-version': '1.1.0'
|
|
234
|
+
}
|
|
235
|
+
});
|
|
229
236
|
|
|
230
237
|
if (!translationResponse.ok) {
|
|
231
238
|
downloadSpinner.warn(`Failed to fetch ${locale}: ${translationResponse.status}`);
|