@kopynator/cli 1.3.0 → 1.3.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 +2 -0
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/commands/sync.ts +2 -2
- package/src/commands/upload.ts +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,8 @@ npx -y @kopynator/cli sync
|
|
|
43
43
|
### 4. Upload
|
|
44
44
|
Uploads a JSON translation file to the Kopynator Cloud. Keys are merged/updated for the given language. Use the same API key (token) as in your app or `kopynator.config.json`.
|
|
45
45
|
|
|
46
|
+
**Project:** The target project is determined by the token. Each token is linked to one project when created in [Dashboard → Settings → Tokens](https://www.kopynator.com/dashboard/settings/tokens). To upload to a different project, use that project’s token (e.g. another `apiKey` in `kopynator.config.json` or a separate config).
|
|
47
|
+
|
|
46
48
|
```bash
|
|
47
49
|
# Language inferred from filename (es.json → es)
|
|
48
50
|
npx -y @kopynator/cli upload --file=src/assets/i18n/es.json
|
package/dist/index.js
CHANGED
|
@@ -446,7 +446,7 @@ async function syncCommand() {
|
|
|
446
446
|
const languagesUrl = `${baseUrl}/languages?token=${token}`;
|
|
447
447
|
const languagesResponse = await fetch(languagesUrl, {
|
|
448
448
|
headers: {
|
|
449
|
-
"x-kopynator-version": "1.1
|
|
449
|
+
"x-kopynator-version": "1.3.1"
|
|
450
450
|
}
|
|
451
451
|
});
|
|
452
452
|
if (!languagesResponse.ok) {
|
|
@@ -466,7 +466,7 @@ async function syncCommand() {
|
|
|
466
466
|
try {
|
|
467
467
|
const translationResponse = await fetch(fetchUrl, {
|
|
468
468
|
headers: {
|
|
469
|
-
"x-kopynator-version": "1.1
|
|
469
|
+
"x-kopynator-version": "1.3.1"
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
472
|
if (!translationResponse.ok) {
|
|
@@ -592,7 +592,7 @@ async function uploadCommand(options) {
|
|
|
592
592
|
headers: {
|
|
593
593
|
"Content-Type": "application/json",
|
|
594
594
|
"x-api-token": token,
|
|
595
|
-
"x-kopynator-version": "1.
|
|
595
|
+
"x-kopynator-version": "1.3.1"
|
|
596
596
|
},
|
|
597
597
|
body: JSON.stringify({ lang, data: batches[i] })
|
|
598
598
|
});
|
|
@@ -613,7 +613,7 @@ async function uploadCommand(options) {
|
|
|
613
613
|
|
|
614
614
|
// src/index.ts
|
|
615
615
|
var program = new import_commander.Command();
|
|
616
|
-
program.name("kopynator").description("Kopynator CLI - Manage your i18n workflow").version("1.3.
|
|
616
|
+
program.name("kopynator").description("Kopynator CLI - Manage your i18n workflow").version("1.3.1");
|
|
617
617
|
program.command("init").description("Initialize Kopynator in your project").action(initCommand);
|
|
618
618
|
program.command("check").description("Validate your local JSON translation files").action(checkCommand);
|
|
619
619
|
program.command("sync").description("Sync your translations with the Kopynator Cloud").action(syncCommand);
|
package/package.json
CHANGED
package/src/commands/sync.ts
CHANGED
|
@@ -204,7 +204,7 @@ export async function syncCommand() {
|
|
|
204
204
|
const languagesUrl = `${baseUrl}/languages?token=${token}`;
|
|
205
205
|
const languagesResponse = await fetch(languagesUrl, {
|
|
206
206
|
headers: {
|
|
207
|
-
'x-kopynator-version': '1.1
|
|
207
|
+
'x-kopynator-version': '1.3.1'
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
if (!languagesResponse.ok) {
|
|
@@ -230,7 +230,7 @@ export async function syncCommand() {
|
|
|
230
230
|
try {
|
|
231
231
|
const translationResponse = await fetch(fetchUrl, {
|
|
232
232
|
headers: {
|
|
233
|
-
'x-kopynator-version': '1.1
|
|
233
|
+
'x-kopynator-version': '1.3.1'
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
|
package/src/commands/upload.ts
CHANGED
|
@@ -123,7 +123,7 @@ export async function uploadCommand(options: { file?: string; lang?: string }) {
|
|
|
123
123
|
headers: {
|
|
124
124
|
'Content-Type': 'application/json',
|
|
125
125
|
'x-api-token': token,
|
|
126
|
-
'x-kopynator-version': '1.
|
|
126
|
+
'x-kopynator-version': '1.3.1',
|
|
127
127
|
},
|
|
128
128
|
body: JSON.stringify({ lang, data: batches[i] }),
|
|
129
129
|
});
|