@opensea/i18n-upload
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -21,5 +21,12 @@ #!/usr/bin/env node | ||
client; | ||
stringFormat; | ||
accessToken = ""; | ||
static BASE_URL = "https://api.smartling.com"; | ||
constructor({ userSecret, userIdentifier, ref, projectId }) { | ||
constructor({ | ||
userSecret, | ||
userIdentifier, | ||
ref, | ||
projectId, | ||
stringFormat = "none" | ||
}) { | ||
this.userSecret = userSecret; | ||
@@ -29,2 +36,3 @@ this.userIdentifier = userIdentifier; | ||
this.projectId = projectId; | ||
this.stringFormat = stringFormat; | ||
this.client = ky.create({ | ||
@@ -138,2 +146,5 @@ prefixUrl: _SmartlingClient.BASE_URL, | ||
); | ||
if (this.stringFormat) { | ||
form.append("smartling.string_format", this.stringFormat); | ||
} | ||
return this.client.post( | ||
@@ -172,3 +183,4 @@ `jobs-batch-api/v1/projects/${this.projectId}/batches/${batch.batchUid}/file`, | ||
directory, | ||
jobName | ||
jobName, | ||
stringFormat | ||
}) => { | ||
@@ -179,3 +191,4 @@ const client = new UploadClient({ | ||
ref, | ||
projectId | ||
projectId, | ||
stringFormat | ||
}); | ||
@@ -218,4 +231,16 @@ await client.authenticate(); | ||
process.env.JOB_NAME | ||
).option( | ||
"-f --stringFormat <format>", | ||
"String format of template strings", | ||
"none" | ||
); | ||
const { userSecret, userIdentifier, ref, projectId, directory, jobName } = program.parse().opts(); | ||
const { | ||
userSecret, | ||
userIdentifier, | ||
ref, | ||
projectId, | ||
directory, | ||
jobName, | ||
stringFormat | ||
} = program.parse().opts(); | ||
const spinner = ora("Processing files for translations...").start(); | ||
@@ -228,3 +253,4 @@ await upload({ | ||
projectId, | ||
directory | ||
directory, | ||
stringFormat | ||
}); | ||
@@ -231,0 +257,0 @@ spinner.succeed("Files for translation uploaded!"); |
{ | ||
"name": "@opensea/i18n-upload", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Package for i18n key upload", | ||
@@ -23,3 +23,3 @@ "license": "MIT", | ||
"glob": "10.3.4", | ||
"ky": "1.0.0", | ||
"ky": "1.0.1", | ||
"ora": "7.0.1" | ||
@@ -30,4 +30,4 @@ }, | ||
"@types/uuid": "9.0.3", | ||
"msw": "1.3.0", | ||
"uuid": "9.0.0" | ||
"msw": "1.3.1", | ||
"uuid": "9.0.1" | ||
}, | ||
@@ -34,0 +34,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8486
243