generaltranslation 2.0.48 → 2.0.49
Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts
CHANGED
@@ -85,7 +85,7 @@ declare class GT {
|
|
85
85
|
* @param updates - Array of updates with optional targetLanguage.
|
86
86
|
* @returns A promise that resolves to a boolean indicating success or failure.
|
87
87
|
*/
|
88
|
-
updateRemoteDictionary(updates: Update[]): Promise<string[]>;
|
88
|
+
updateRemoteDictionary(updates: Update[], projectID?: string, replace?: boolean): Promise<string[]>;
|
89
89
|
}
|
90
90
|
export default GT;
|
91
91
|
/**
|
package/dist/index.js
CHANGED
@@ -108,9 +108,9 @@ class GT {
|
|
108
108
|
* @param updates - Array of updates with optional targetLanguage.
|
109
109
|
* @returns A promise that resolves to a boolean indicating success or failure.
|
110
110
|
*/
|
111
|
-
updateRemoteDictionary(
|
112
|
-
return __awaiter(this,
|
113
|
-
return (0, _updateRemoteDictionary_1.default)(this, updates);
|
111
|
+
updateRemoteDictionary(updates_1) {
|
112
|
+
return __awaiter(this, arguments, void 0, function* (updates, projectID = this.projectID, replace = false) {
|
113
|
+
return (0, _updateRemoteDictionary_1.default)(this, updates, projectID, replace);
|
114
114
|
});
|
115
115
|
}
|
116
116
|
}
|
@@ -17,7 +17,7 @@ exports.default = _updateRemoteDictionary;
|
|
17
17
|
* @returns {Promise<boolean>} A promise that resolves to an array of processed results.
|
18
18
|
* @internal
|
19
19
|
*/
|
20
|
-
function _updateRemoteDictionary(gt, updates) {
|
20
|
+
function _updateRemoteDictionary(gt, updates, projectID, replace) {
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
22
22
|
try {
|
23
23
|
const response = yield fetch(`${gt.baseURL}/update`, {
|
@@ -26,7 +26,9 @@ function _updateRemoteDictionary(gt, updates) {
|
|
26
26
|
'Content-Type': 'application/json',
|
27
27
|
'gtx-api-key': gt.apiKey,
|
28
28
|
},
|
29
|
-
body: JSON.stringify(
|
29
|
+
body: JSON.stringify({
|
30
|
+
updates, projectID, replace
|
31
|
+
})
|
30
32
|
});
|
31
33
|
if (!response.ok) {
|
32
34
|
throw new Error(`${response.status}: ${yield response.text()}`);
|