@encatch/api-sdk 0.0.12-beta.0 → 0.1.0-beta.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/dist/index.cjs +8 -10
- package/dist/index.js +8 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -194,28 +194,26 @@ var _EncatchApiSDK = class _EncatchApiSDK {
|
|
|
194
194
|
}
|
|
195
195
|
async refineText(params) {
|
|
196
196
|
this._log("Refining text with params:", JSON.stringify(params, null, 2));
|
|
197
|
-
let convertedPayload;
|
|
198
197
|
const url = `${this.hostUrl}${_EncatchApiSDK.ENDPOINTS.REFINE_TEXT}`;
|
|
199
198
|
const headers = {
|
|
200
199
|
"Content-Type": "application/json",
|
|
201
200
|
"X-Api-Key": this.apiKey,
|
|
202
201
|
Referer: this.appPackageName
|
|
203
202
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
203
|
+
const requestBody = {
|
|
204
|
+
questionId: params.questionId,
|
|
205
|
+
feedbackConfigurationId: params.feedbackConfigurationId,
|
|
206
|
+
userText: params.userText
|
|
207
|
+
};
|
|
209
208
|
const response = await fetch(url, {
|
|
210
209
|
method: "POST",
|
|
211
210
|
headers,
|
|
212
|
-
body: JSON.stringify(
|
|
211
|
+
body: JSON.stringify(requestBody)
|
|
213
212
|
});
|
|
214
213
|
try {
|
|
215
214
|
const jsonResponse = await response.json();
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return convertedResponse;
|
|
215
|
+
this._log("Text refine response: ", jsonResponse);
|
|
216
|
+
return jsonResponse;
|
|
219
217
|
} catch (error) {
|
|
220
218
|
this._log("Error parsing response:", error);
|
|
221
219
|
throw new Error("Failed to parse response");
|
package/dist/index.js
CHANGED
|
@@ -160,28 +160,26 @@ var _EncatchApiSDK = class _EncatchApiSDK {
|
|
|
160
160
|
}
|
|
161
161
|
async refineText(params) {
|
|
162
162
|
this._log("Refining text with params:", JSON.stringify(params, null, 2));
|
|
163
|
-
let convertedPayload;
|
|
164
163
|
const url = `${this.hostUrl}${_EncatchApiSDK.ENDPOINTS.REFINE_TEXT}`;
|
|
165
164
|
const headers = {
|
|
166
165
|
"Content-Type": "application/json",
|
|
167
166
|
"X-Api-Key": this.apiKey,
|
|
168
167
|
Referer: this.appPackageName
|
|
169
168
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
169
|
+
const requestBody = {
|
|
170
|
+
questionId: params.questionId,
|
|
171
|
+
feedbackConfigurationId: params.feedbackConfigurationId,
|
|
172
|
+
userText: params.userText
|
|
173
|
+
};
|
|
175
174
|
const response = await fetch(url, {
|
|
176
175
|
method: "POST",
|
|
177
176
|
headers,
|
|
178
|
-
body: JSON.stringify(
|
|
177
|
+
body: JSON.stringify(requestBody)
|
|
179
178
|
});
|
|
180
179
|
try {
|
|
181
180
|
const jsonResponse = await response.json();
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return convertedResponse;
|
|
181
|
+
this._log("Text refine response: ", jsonResponse);
|
|
182
|
+
return jsonResponse;
|
|
185
183
|
} catch (error) {
|
|
186
184
|
this._log("Error parsing response:", error);
|
|
187
185
|
throw new Error("Failed to parse response");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@encatch/api-sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"pako": "^2.1.0",
|
|
21
21
|
"ts-case-convert": "^2.1.0",
|
|
22
22
|
"zod": "^4.1.8",
|
|
23
|
-
"@encatch/schema": "1.
|
|
23
|
+
"@encatch/schema": "1.1.0-beta.7"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"dev": "vite",
|