generaltranslation 2.0.48 → 2.0.49

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.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(updates) {
112
- return __awaiter(this, void 0, void 0, function* () {
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(updates)
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()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "2.0.48",
3
+ "version": "2.0.49",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",