uapi-browser-sdk 0.1.12 → 0.1.13
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 +1 -1
- package/dist/internal/src/apis/ClipzyApi.d.ts +0 -12
- package/dist/internal/src/apis/ClipzyApi.js +15 -36
- package/dist/internal/src/apis/ConvertApi.d.ts +0 -8
- package/dist/internal/src/apis/ConvertApi.js +10 -24
- package/dist/internal/src/apis/DailyApi.d.ts +0 -4
- package/dist/internal/src/apis/DailyApi.js +5 -12
- package/dist/internal/src/apis/DefaultApi.d.ts +0 -20
- package/dist/internal/src/apis/DefaultApi.js +25 -60
- package/dist/internal/src/apis/GameApi.d.ts +0 -20
- package/dist/internal/src/apis/GameApi.js +25 -60
- package/dist/internal/src/apis/ImageApi.d.ts +0 -44
- package/dist/internal/src/apis/ImageApi.js +55 -132
- package/dist/internal/src/apis/MiscApi.d.ts +0 -60
- package/dist/internal/src/apis/MiscApi.js +75 -180
- package/dist/internal/src/apis/NetworkApi.d.ts +0 -40
- package/dist/internal/src/apis/NetworkApi.js +50 -120
- package/dist/internal/src/apis/PoemApi.d.ts +0 -4
- package/dist/internal/src/apis/PoemApi.js +5 -12
- package/dist/internal/src/apis/RandomApi.d.ts +0 -16
- package/dist/internal/src/apis/RandomApi.js +20 -48
- package/dist/internal/src/apis/SocialApi.d.ts +0 -32
- package/dist/internal/src/apis/SocialApi.js +40 -96
- package/dist/internal/src/apis/StatusApi.d.ts +0 -8
- package/dist/internal/src/apis/StatusApi.js +10 -24
- package/dist/internal/src/apis/TextApi.d.ts +0 -44
- package/dist/internal/src/apis/TextApi.js +55 -132
- package/dist/internal/src/apis/TranslateApi.d.ts +0 -16
- package/dist/internal/src/apis/TranslateApi.js +20 -48
- package/dist/internal/src/apis/WebParseApi.d.ts +0 -16
- package/dist/internal/src/apis/WebParseApi.js +20 -48
- package/dist/internal/src/models/GetMiscHolidayCalendar200ResponseHolidaysInner.d.ts +1 -1
- package/dist/internal/src/models/GetMiscWeather200Response.d.ts +1 -1
- package/dist/internal/src/models/PostAiTranslateRequest.d.ts +2 -2
- package/dist/internal/src/models/PostSearchAggregateRequest.d.ts +2 -2
- package/dist/internal/src/models/PostSensitiveWordAnalyze200ResponseResultsInner.d.ts +2 -2
- package/dist/internal/src/models/PostTextAesDecryptAdvancedRequest.d.ts +2 -2
- package/dist/internal/src/models/PostTextAesEncryptAdvancedRequest.d.ts +3 -3
- package/dist/internal/src/models/PostTextConvertRequest.d.ts +2 -2
- package/dist/internal/src/models/PostTranslateStream400Response.d.ts +1 -1
- package/dist/internal/src/runtime.js +0 -15
- package/dist/src/errors.d.ts +85 -0
- package/dist/src/errors.js +247 -0
- package/dist/src/index.d.ts +5 -6
- package/dist/src/index.js +9 -10
- package/internal/.openapi-generator/VERSION +1 -1
- package/internal/src/apis/ClipzyApi.ts +15 -39
- package/internal/src/apis/ConvertApi.ts +10 -26
- package/internal/src/apis/DailyApi.ts +5 -13
- package/internal/src/apis/DefaultApi.ts +25 -65
- package/internal/src/apis/GameApi.ts +25 -65
- package/internal/src/apis/ImageApi.ts +55 -143
- package/internal/src/apis/MiscApi.ts +75 -195
- package/internal/src/apis/NetworkApi.ts +50 -130
- package/internal/src/apis/PoemApi.ts +5 -13
- package/internal/src/apis/RandomApi.ts +20 -52
- package/internal/src/apis/SocialApi.ts +40 -104
- package/internal/src/apis/StatusApi.ts +10 -26
- package/internal/src/apis/TextApi.ts +55 -143
- package/internal/src/apis/TranslateApi.ts +20 -52
- package/internal/src/apis/WebParseApi.ts +20 -52
- package/internal/src/models/GetMiscHolidayCalendar200ResponseHolidaysInner.ts +1 -1
- package/internal/src/models/GetMiscWeather200Response.ts +1 -1
- package/internal/src/models/PostAiTranslateRequest.ts +2 -2
- package/internal/src/models/PostSearchAggregateRequest.ts +2 -2
- package/internal/src/models/PostSensitiveWordAnalyze200ResponseResultsInner.ts +2 -2
- package/internal/src/models/PostTextAesDecryptAdvancedRequest.ts +2 -2
- package/internal/src/models/PostTextAesEncryptAdvancedRequest.ts +3 -3
- package/internal/src/models/PostTextConvertRequest.ts +2 -2
- package/internal/src/models/PostTranslateStream400Response.ts +1 -1
- package/internal/src/runtime.ts +0 -18
- package/package.json +1 -1
- package/src/errors.ts +282 -0
- package/src/index.ts +12 -8
|
@@ -168,9 +168,10 @@ export interface PostTextMd5VerifyOperationRequest {
|
|
|
168
168
|
export class TextApi extends runtime.BaseAPI {
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
*
|
|
171
|
+
* 一个快速计算文本 MD5 哈希值的工具,适用于短文本且不关心参数暴露的场景。 ## 功能概述 通过GET请求的查询参数传入文本,返回其32位小写的MD5哈希值。 > [!NOTE] > 对于较长或敏感的文本,我们推荐使用本接口的 POST 版本,以避免URL长度限制和参数暴露问题。
|
|
172
|
+
* MD5 哈希
|
|
172
173
|
*/
|
|
173
|
-
async
|
|
174
|
+
async getTextMd5Raw(requestParameters: GetTextMd5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetTextMd5200Response>> {
|
|
174
175
|
if (requestParameters['text'] == null) {
|
|
175
176
|
throw new runtime.RequiredError(
|
|
176
177
|
'text',
|
|
@@ -189,21 +190,12 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
189
190
|
|
|
190
191
|
let urlPath = `/text/md5`;
|
|
191
192
|
|
|
192
|
-
|
|
193
|
+
const response = await this.request({
|
|
193
194
|
path: urlPath,
|
|
194
195
|
method: 'GET',
|
|
195
196
|
headers: headerParameters,
|
|
196
197
|
query: queryParameters,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 一个快速计算文本 MD5 哈希值的工具,适用于短文本且不关心参数暴露的场景。 ## 功能概述 通过GET请求的查询参数传入文本,返回其32位小写的MD5哈希值。 > [!NOTE] > 对于较长或敏感的文本,我们推荐使用本接口的 POST 版本,以避免URL长度限制和参数暴露问题。
|
|
202
|
-
* MD5 哈希
|
|
203
|
-
*/
|
|
204
|
-
async getTextMd5Raw(requestParameters: GetTextMd5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetTextMd5200Response>> {
|
|
205
|
-
const requestOptions = await this.getTextMd5RequestOpts(requestParameters);
|
|
206
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
198
|
+
}, initOverrides);
|
|
207
199
|
|
|
208
200
|
return new runtime.JSONApiResponse(response, (jsonValue) => GetTextMd5200ResponseFromJSON(jsonValue));
|
|
209
201
|
}
|
|
@@ -218,9 +210,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
218
210
|
}
|
|
219
211
|
|
|
220
212
|
/**
|
|
221
|
-
*
|
|
213
|
+
* 收到了用AES加密的密文?把它、密钥和随机数(nonce)交给我们,就能还原出原始内容。 ## 功能概述 这是一个标准的AES解密接口。你需要提供经过Base64编码的密文、加密时使用的密钥和nonce(随机数,通常为16字节字符串)。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。 > > **关于随机数 `nonce`** > 通常为16字节字符串,需与加密时一致。
|
|
214
|
+
* AES 解密
|
|
222
215
|
*/
|
|
223
|
-
async
|
|
216
|
+
async postTextAesDecryptRaw(requestParameters: PostTextAesDecryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesDecrypt200Response>> {
|
|
224
217
|
if (requestParameters['postTextAesDecryptRequest'] == null) {
|
|
225
218
|
throw new runtime.RequiredError(
|
|
226
219
|
'postTextAesDecryptRequest',
|
|
@@ -237,22 +230,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
237
230
|
|
|
238
231
|
let urlPath = `/text/aes/decrypt`;
|
|
239
232
|
|
|
240
|
-
|
|
233
|
+
const response = await this.request({
|
|
241
234
|
path: urlPath,
|
|
242
235
|
method: 'POST',
|
|
243
236
|
headers: headerParameters,
|
|
244
237
|
query: queryParameters,
|
|
245
238
|
body: PostTextAesDecryptRequestToJSON(requestParameters['postTextAesDecryptRequest']),
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* 收到了用AES加密的密文?把它、密钥和随机数(nonce)交给我们,就能还原出原始内容。 ## 功能概述 这是一个标准的AES解密接口。你需要提供经过Base64编码的密文、加密时使用的密钥和nonce(随机数,通常为16字节字符串)。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。 > > **关于随机数 `nonce`** > 通常为16字节字符串,需与加密时一致。
|
|
251
|
-
* AES 解密
|
|
252
|
-
*/
|
|
253
|
-
async postTextAesDecryptRaw(requestParameters: PostTextAesDecryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesDecrypt200Response>> {
|
|
254
|
-
const requestOptions = await this.postTextAesDecryptRequestOpts(requestParameters);
|
|
255
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
239
|
+
}, initOverrides);
|
|
256
240
|
|
|
257
241
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesDecrypt200ResponseFromJSON(jsonValue));
|
|
258
242
|
}
|
|
@@ -267,9 +251,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
267
251
|
}
|
|
268
252
|
|
|
269
253
|
/**
|
|
270
|
-
*
|
|
254
|
+
* 需要解密通过高级加密接口加密的数据?这个接口提供与加密接口完全配对的解密功能,支持相同的6种加密模式和3种填充方式。 > [!IMPORTANT] > **解密参数必须与加密时一致** > 解密时,必须提供与加密时相同的密钥、模式和填充方式。对于非GCM模式,还需要提供加密时返回的IV。 ## 功能概述 这是一个功能完整的AES解密接口,能够解密通过高级加密接口加密的所有密文。支持所有6种加密模式和3种填充方式,与加密接口完全配对。 ### 解密流程 1. 获取加密时返回的密文和配置参数 2. 使用相同的密钥、模式、填充方式和IV(如需要) 3. 调用本接口进行解密 4. 获取原始明文 ### 支持的解密模式 - **GCM模式**(推荐):自动验证数据完整性,如果密文被篡改会解密失败 - **CBC模式**:经典块解密模式,需要提供加密时的IV - **CTR/OFB/CFB模式**:流密码解密,需要提供加密时的IV - **ECB模式**:不需要IV,但安全性较低 ### 填充方式处理 - **PKCS7填充**:解密后自动移除填充 - **Zero填充**:解密后自动移除0x00填充 - **None填充**:无填充处理 ## 参数说明 - **`text`**: 待解密的密文(Base64编码,来自加密接口返回的ciphertext字段) - **`key`**: 解密密钥(必须与加密时相同) - **`mode`**: 加密模式(必须与加密时相同) - **`padding`**: 填充方式(可选,默认PKCS7,必须与加密时相同) - **`iv`**: 初始化向量(非GCM模式必须提供,Base64编码) ## 常见错误处理 如果解密失败,请检查以下几点: - 密钥是否与加密时完全相同 - 模式和填充方式是否匹配 - 非GCM模式下是否提供了正确的IV - 密文是否完整且未被修改 - GCM模式下密文是否被篡改
|
|
255
|
+
* AES高级解密
|
|
271
256
|
*/
|
|
272
|
-
async
|
|
257
|
+
async postTextAesDecryptAdvancedRaw(requestParameters: PostTextAesDecryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesDecryptAdvanced200Response>> {
|
|
273
258
|
if (requestParameters['postTextAesDecryptAdvancedRequest'] == null) {
|
|
274
259
|
throw new runtime.RequiredError(
|
|
275
260
|
'postTextAesDecryptAdvancedRequest',
|
|
@@ -286,22 +271,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
286
271
|
|
|
287
272
|
let urlPath = `/text/aes/decrypt-advanced`;
|
|
288
273
|
|
|
289
|
-
|
|
274
|
+
const response = await this.request({
|
|
290
275
|
path: urlPath,
|
|
291
276
|
method: 'POST',
|
|
292
277
|
headers: headerParameters,
|
|
293
278
|
query: queryParameters,
|
|
294
279
|
body: PostTextAesDecryptAdvancedRequestToJSON(requestParameters['postTextAesDecryptAdvancedRequest']),
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* 需要解密通过高级加密接口加密的数据?这个接口提供与加密接口完全配对的解密功能,支持相同的6种加密模式和3种填充方式。 > [!IMPORTANT] > **解密参数必须与加密时一致** > 解密时,必须提供与加密时相同的密钥、模式和填充方式。对于非GCM模式,还需要提供加密时返回的IV。 ## 功能概述 这是一个功能完整的AES解密接口,能够解密通过高级加密接口加密的所有密文。支持所有6种加密模式和3种填充方式,与加密接口完全配对。 ### 解密流程 1. 获取加密时返回的密文和配置参数 2. 使用相同的密钥、模式、填充方式和IV(如需要) 3. 调用本接口进行解密 4. 获取原始明文 ### 支持的解密模式 - **GCM模式**(推荐):自动验证数据完整性,如果密文被篡改会解密失败 - **CBC模式**:经典块解密模式,需要提供加密时的IV - **CTR/OFB/CFB模式**:流密码解密,需要提供加密时的IV - **ECB模式**:不需要IV,但安全性较低 ### 填充方式处理 - **PKCS7填充**:解密后自动移除填充 - **Zero填充**:解密后自动移除0x00填充 - **None填充**:无填充处理 ## 参数说明 - **`text`**: 待解密的密文(Base64编码,来自加密接口返回的ciphertext字段) - **`key`**: 解密密钥(必须与加密时相同) - **`mode`**: 加密模式(必须与加密时相同) - **`padding`**: 填充方式(可选,默认PKCS7,必须与加密时相同) - **`iv`**: 初始化向量(非GCM模式必须提供,Base64编码) ## 常见错误处理 如果解密失败,请检查以下几点: - 密钥是否与加密时完全相同 - 模式和填充方式是否匹配 - 非GCM模式下是否提供了正确的IV - 密文是否完整且未被修改 - GCM模式下密文是否被篡改
|
|
300
|
-
* AES高级解密
|
|
301
|
-
*/
|
|
302
|
-
async postTextAesDecryptAdvancedRaw(requestParameters: PostTextAesDecryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesDecryptAdvanced200Response>> {
|
|
303
|
-
const requestOptions = await this.postTextAesDecryptAdvancedRequestOpts(requestParameters);
|
|
304
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
280
|
+
}, initOverrides);
|
|
305
281
|
|
|
306
282
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesDecryptAdvanced200ResponseFromJSON(jsonValue));
|
|
307
283
|
}
|
|
@@ -316,9 +292,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
316
292
|
}
|
|
317
293
|
|
|
318
294
|
/**
|
|
319
|
-
*
|
|
295
|
+
* 需要安全地传输或存储一些文本信息?AES加密是一个可靠的选择。 ## 功能概述 这是一个标准的AES加密接口。你提供需要加密的明文和密钥,我们返回经过Base64编码的密文。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。
|
|
296
|
+
* AES 加密
|
|
320
297
|
*/
|
|
321
|
-
async
|
|
298
|
+
async postTextAesEncryptRaw(requestParameters: PostTextAesEncryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesEncrypt200Response>> {
|
|
322
299
|
if (requestParameters['postTextAesEncryptRequest'] == null) {
|
|
323
300
|
throw new runtime.RequiredError(
|
|
324
301
|
'postTextAesEncryptRequest',
|
|
@@ -335,22 +312,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
335
312
|
|
|
336
313
|
let urlPath = `/text/aes/encrypt`;
|
|
337
314
|
|
|
338
|
-
|
|
315
|
+
const response = await this.request({
|
|
339
316
|
path: urlPath,
|
|
340
317
|
method: 'POST',
|
|
341
318
|
headers: headerParameters,
|
|
342
319
|
query: queryParameters,
|
|
343
320
|
body: PostTextAesEncryptRequestToJSON(requestParameters['postTextAesEncryptRequest']),
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* 需要安全地传输或存储一些文本信息?AES加密是一个可靠的选择。 ## 功能概述 这是一个标准的AES加密接口。你提供需要加密的明文和密钥,我们返回经过Base64编码的密文。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。
|
|
349
|
-
* AES 加密
|
|
350
|
-
*/
|
|
351
|
-
async postTextAesEncryptRaw(requestParameters: PostTextAesEncryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesEncrypt200Response>> {
|
|
352
|
-
const requestOptions = await this.postTextAesEncryptRequestOpts(requestParameters);
|
|
353
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
321
|
+
}, initOverrides);
|
|
354
322
|
|
|
355
323
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesEncrypt200ResponseFromJSON(jsonValue));
|
|
356
324
|
}
|
|
@@ -365,9 +333,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
365
333
|
}
|
|
366
334
|
|
|
367
335
|
/**
|
|
368
|
-
*
|
|
336
|
+
* 需要更灵活的AES加密方案?这个高级接口支持6种加密模式和3种填充方式,让你根据具体场景选择最合适的加密配置。 > [!IMPORTANT] > **推荐使用GCM模式** > GCM模式提供认证加密(AEAD),不仅能加密数据,还能验证数据完整性,防止密文被篡改。这是目前最推荐的加密模式。 ## 功能概述 这是一个功能全面的AES加密接口,支持多种加密模式和填充方式。你可以根据不同的安全需求和性能要求,灵活选择合适的加密配置。 ### 支持的加密模式 - **GCM模式**(推荐):认证加密模式,提供完整性保护 - **CBC模式**:经典块加密模式,需要IV和填充,适用于文件加密 - **CTR模式**:流密码模式,无需填充,适用于实时数据加密 - **OFB/CFB模式**:流密码模式,无需填充,适用于流数据加密 - **ECB模式**(不推荐):仅用于兼容性需求 ### 支持的填充方式 - **PKCS7填充**(推荐):标准填充方式 - **Zero填充**:使用0x00字节填充 - **None填充**:无填充,用于流密码模式 ### 输出格式支持 - **base64**(默认):标准Base64编码输出,适合传输和存储 - **hex**:十六进制编码输出,方便与在线加密工具对比验证 通过 `output_format` 参数可以直接获取HEX格式的密文,无需额外调用转换接口。 ## 参数说明 - **`text`**: 待加密的明文文本 - **`key`**: 加密密钥(支持任意长度) - **`mode`**: 加密模式(可选,默认GCM) - **`padding`**: 填充方式(可选,默认PKCS7) - **`iv`**: 自定义IV(可选,Base64编码,16字节) - **`output_format`**: 输出格式(可选,默认base64) ## 使用示例 **示例1:HEX格式输出** ```json { \"text\": \"测试文本123\", \"key\": \"1234567890123456\", \"mode\": \"ECB\", \"padding\": \"PKCS7\", \"output_format\": \"hex\" } ``` 返回示例: ```json { \"ciphertext\": \"aaaca6027da10918bb5d23d81939552c\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` **示例2:Base64格式输出(默认)** ```json { \"text\": \"测试文本123\", \"key\": \"1234567890123456\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` 返回示例: ```json { \"ciphertext\": \"qqymAn2hCRi7XSPYGTlVLA==\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` ## 技术规格 - **加密算法**: AES-256 - **编码格式**: Base64/HEX(输入/输出) - **IV长度**: 16字节(128位) - **版本标注**: v3.4.8+ > [!NOTE] > **关于IV(初始化向量)** > - GCM模式无需提供IV > - CBC/CTR/OFB/CFB模式可选提供IV > - ECB模式不使用IV > - 建议每次加密使用不同的IV以确保安全性 > [!TIP] > **关于输出格式** > - 如需与在线加密工具(如 toolhelper.cn)对比结果,建议使用 `output_format: \"hex\"` > - Base64格式更适合网络传输和API调用 > - 两种格式可以相互转换,数据完全一致
|
|
337
|
+
* AES高级加密
|
|
369
338
|
*/
|
|
370
|
-
async
|
|
339
|
+
async postTextAesEncryptAdvancedRaw(requestParameters: PostTextAesEncryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesEncryptAdvanced200Response>> {
|
|
371
340
|
if (requestParameters['postTextAesEncryptAdvancedRequest'] == null) {
|
|
372
341
|
throw new runtime.RequiredError(
|
|
373
342
|
'postTextAesEncryptAdvancedRequest',
|
|
@@ -384,22 +353,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
384
353
|
|
|
385
354
|
let urlPath = `/text/aes/encrypt-advanced`;
|
|
386
355
|
|
|
387
|
-
|
|
356
|
+
const response = await this.request({
|
|
388
357
|
path: urlPath,
|
|
389
358
|
method: 'POST',
|
|
390
359
|
headers: headerParameters,
|
|
391
360
|
query: queryParameters,
|
|
392
361
|
body: PostTextAesEncryptAdvancedRequestToJSON(requestParameters['postTextAesEncryptAdvancedRequest']),
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* 需要更灵活的AES加密方案?这个高级接口支持6种加密模式和3种填充方式,让你根据具体场景选择最合适的加密配置。 > [!IMPORTANT] > **推荐使用GCM模式** > GCM模式提供认证加密(AEAD),不仅能加密数据,还能验证数据完整性,防止密文被篡改。这是目前最推荐的加密模式。 ## 功能概述 这是一个功能全面的AES加密接口,支持多种加密模式和填充方式。你可以根据不同的安全需求和性能要求,灵活选择合适的加密配置。 ### 支持的加密模式 - **GCM模式**(推荐):认证加密模式,提供完整性保护 - **CBC模式**:经典块加密模式,需要IV和填充,适用于文件加密 - **CTR模式**:流密码模式,无需填充,适用于实时数据加密 - **OFB/CFB模式**:流密码模式,无需填充,适用于流数据加密 - **ECB模式**(不推荐):仅用于兼容性需求 ### 支持的填充方式 - **PKCS7填充**(推荐):标准填充方式 - **Zero填充**:使用0x00字节填充 - **None填充**:无填充,用于流密码模式 ### 输出格式支持 - **base64**(默认):标准Base64编码输出,适合传输和存储 - **hex**:十六进制编码输出,方便与在线加密工具对比验证 通过 `output_format` 参数可以直接获取HEX格式的密文,无需额外调用转换接口。 ## 参数说明 - **`text`**: 待加密的明文文本 - **`key`**: 加密密钥(支持任意长度) - **`mode`**: 加密模式(可选,默认GCM) - **`padding`**: 填充方式(可选,默认PKCS7) - **`iv`**: 自定义IV(可选,Base64编码,16字节) - **`output_format`**: 输出格式(可选,默认base64) ## 使用示例 **示例1:HEX格式输出** ```json { \"text\": \"测试文本123\", \"key\": \"1234567890123456\", \"mode\": \"ECB\", \"padding\": \"PKCS7\", \"output_format\": \"hex\" } ``` 返回示例: ```json { \"ciphertext\": \"aaaca6027da10918bb5d23d81939552c\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` **示例2:Base64格式输出(默认)** ```json { \"text\": \"测试文本123\", \"key\": \"1234567890123456\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` 返回示例: ```json { \"ciphertext\": \"qqymAn2hCRi7XSPYGTlVLA==\", \"mode\": \"ECB\", \"padding\": \"PKCS7\" } ``` ## 技术规格 - **加密算法**: AES-256 - **编码格式**: Base64/HEX(输入/输出) - **IV长度**: 16字节(128位) - **版本标注**: v3.4.8+ > [!NOTE] > **关于IV(初始化向量)** > - GCM模式无需提供IV > - CBC/CTR/OFB/CFB模式可选提供IV > - ECB模式不使用IV > - 建议每次加密使用不同的IV以确保安全性 > [!TIP] > **关于输出格式** > - 如需与在线加密工具(如 toolhelper.cn)对比结果,建议使用 `output_format: \"hex\"` > - Base64格式更适合网络传输和API调用 > - 两种格式可以相互转换,数据完全一致
|
|
398
|
-
* AES高级加密
|
|
399
|
-
*/
|
|
400
|
-
async postTextAesEncryptAdvancedRaw(requestParameters: PostTextAesEncryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAesEncryptAdvanced200Response>> {
|
|
401
|
-
const requestOptions = await this.postTextAesEncryptAdvancedRequestOpts(requestParameters);
|
|
402
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
362
|
+
}, initOverrides);
|
|
403
363
|
|
|
404
364
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesEncryptAdvanced200ResponseFromJSON(jsonValue));
|
|
405
365
|
}
|
|
@@ -414,9 +374,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
414
374
|
}
|
|
415
375
|
|
|
416
376
|
/**
|
|
417
|
-
*
|
|
377
|
+
* 想知道一篇文章有多少字、多少个词、或者多少行?这个接口可以帮你快速统计。 ## 功能概述 你提供一段文本,我们会从多个维度进行分析,并返回其字符数、词数、句子数、段落数和行数。这对于文本编辑、内容管理等场景非常有用。
|
|
378
|
+
* 文本分析
|
|
418
379
|
*/
|
|
419
|
-
async
|
|
380
|
+
async postTextAnalyzeRaw(requestParameters: PostTextAnalyzeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAnalyze200Response>> {
|
|
420
381
|
if (requestParameters['postTextAnalyzeRequest'] == null) {
|
|
421
382
|
throw new runtime.RequiredError(
|
|
422
383
|
'postTextAnalyzeRequest',
|
|
@@ -433,22 +394,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
433
394
|
|
|
434
395
|
let urlPath = `/text/analyze`;
|
|
435
396
|
|
|
436
|
-
|
|
397
|
+
const response = await this.request({
|
|
437
398
|
path: urlPath,
|
|
438
399
|
method: 'POST',
|
|
439
400
|
headers: headerParameters,
|
|
440
401
|
query: queryParameters,
|
|
441
402
|
body: PostTextAnalyzeRequestToJSON(requestParameters['postTextAnalyzeRequest']),
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* 想知道一篇文章有多少字、多少个词、或者多少行?这个接口可以帮你快速统计。 ## 功能概述 你提供一段文本,我们会从多个维度进行分析,并返回其字符数、词数、句子数、段落数和行数。这对于文本编辑、内容管理等场景非常有用。
|
|
447
|
-
* 文本分析
|
|
448
|
-
*/
|
|
449
|
-
async postTextAnalyzeRaw(requestParameters: PostTextAnalyzeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextAnalyze200Response>> {
|
|
450
|
-
const requestOptions = await this.postTextAnalyzeRequestOpts(requestParameters);
|
|
451
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
403
|
+
}, initOverrides);
|
|
452
404
|
|
|
453
405
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAnalyze200ResponseFromJSON(jsonValue));
|
|
454
406
|
}
|
|
@@ -463,9 +415,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
463
415
|
}
|
|
464
416
|
|
|
465
417
|
/**
|
|
466
|
-
*
|
|
418
|
+
* 这是一个简单实用的 Base64 解码工具。 ## 功能概述 你提供一个 Base64 编码的字符串,我们帮你解码成原始的 UTF-8 文本。
|
|
419
|
+
* Base64 解码
|
|
467
420
|
*/
|
|
468
|
-
async
|
|
421
|
+
async postTextBase64DecodeRaw(requestParameters: PostTextBase64DecodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextBase64Decode200Response>> {
|
|
469
422
|
if (requestParameters['postTextBase64DecodeRequest'] == null) {
|
|
470
423
|
throw new runtime.RequiredError(
|
|
471
424
|
'postTextBase64DecodeRequest',
|
|
@@ -482,22 +435,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
482
435
|
|
|
483
436
|
let urlPath = `/text/base64/decode`;
|
|
484
437
|
|
|
485
|
-
|
|
438
|
+
const response = await this.request({
|
|
486
439
|
path: urlPath,
|
|
487
440
|
method: 'POST',
|
|
488
441
|
headers: headerParameters,
|
|
489
442
|
query: queryParameters,
|
|
490
443
|
body: PostTextBase64DecodeRequestToJSON(requestParameters['postTextBase64DecodeRequest']),
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* 这是一个简单实用的 Base64 解码工具。 ## 功能概述 你提供一个 Base64 编码的字符串,我们帮你解码成原始的 UTF-8 文本。
|
|
496
|
-
* Base64 解码
|
|
497
|
-
*/
|
|
498
|
-
async postTextBase64DecodeRaw(requestParameters: PostTextBase64DecodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextBase64Decode200Response>> {
|
|
499
|
-
const requestOptions = await this.postTextBase64DecodeRequestOpts(requestParameters);
|
|
500
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
444
|
+
}, initOverrides);
|
|
501
445
|
|
|
502
446
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextBase64Decode200ResponseFromJSON(jsonValue));
|
|
503
447
|
}
|
|
@@ -512,9 +456,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
512
456
|
}
|
|
513
457
|
|
|
514
458
|
/**
|
|
515
|
-
*
|
|
459
|
+
* 这是一个简单实用的 Base64 编码工具。 ## 功能概述 你提供一段原始文本,我们帮你转换成 Base64 编码的字符串。
|
|
460
|
+
* Base64 编码
|
|
516
461
|
*/
|
|
517
|
-
async
|
|
462
|
+
async postTextBase64EncodeRaw(requestParameters: PostTextBase64EncodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextBase64Encode200Response>> {
|
|
518
463
|
if (requestParameters['postTextBase64EncodeRequest'] == null) {
|
|
519
464
|
throw new runtime.RequiredError(
|
|
520
465
|
'postTextBase64EncodeRequest',
|
|
@@ -531,22 +476,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
531
476
|
|
|
532
477
|
let urlPath = `/text/base64/encode`;
|
|
533
478
|
|
|
534
|
-
|
|
479
|
+
const response = await this.request({
|
|
535
480
|
path: urlPath,
|
|
536
481
|
method: 'POST',
|
|
537
482
|
headers: headerParameters,
|
|
538
483
|
query: queryParameters,
|
|
539
484
|
body: PostTextBase64EncodeRequestToJSON(requestParameters['postTextBase64EncodeRequest']),
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* 这是一个简单实用的 Base64 编码工具。 ## 功能概述 你提供一段原始文本,我们帮你转换成 Base64 编码的字符串。
|
|
545
|
-
* Base64 编码
|
|
546
|
-
*/
|
|
547
|
-
async postTextBase64EncodeRaw(requestParameters: PostTextBase64EncodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextBase64Encode200Response>> {
|
|
548
|
-
const requestOptions = await this.postTextBase64EncodeRequestOpts(requestParameters);
|
|
549
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
485
|
+
}, initOverrides);
|
|
550
486
|
|
|
551
487
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextBase64Encode200ResponseFromJSON(jsonValue));
|
|
552
488
|
}
|
|
@@ -561,9 +497,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
561
497
|
}
|
|
562
498
|
|
|
563
499
|
/**
|
|
564
|
-
*
|
|
500
|
+
* 需要在不同文本格式之间转换?这个接口支持Base64、Hex、URL、HTML、Unicode等多种格式互转,还能生成MD5、SHA256等哈希值。 ## 功能概述 你提供待转换的文本、源格式和目标格式,接口会自动完成转换。支持7种双向格式(plain、base64、hex、url、html、unicode、binary)和4种单向哈希(md5、sha1、sha256、sha512)。 ## 格式说明 **双向转换格式**:plain(纯文本)、base64、hex(十六进制)、url、html(HTML实体)、unicode(\\uXXXX转义)、binary(二进制字符串) **单向哈希格式**:md5、sha1、sha256、sha512(仅可作为目标格式,不可逆) ## 链式转换 支持多次调用实现复杂转换,如先将文本转为base64,再将base64转为hex。
|
|
501
|
+
* 格式转换
|
|
565
502
|
*/
|
|
566
|
-
async
|
|
503
|
+
async postTextConvertRaw(requestParameters: PostTextConvertOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextConvert200Response>> {
|
|
567
504
|
if (requestParameters['postTextConvertRequest'] == null) {
|
|
568
505
|
throw new runtime.RequiredError(
|
|
569
506
|
'postTextConvertRequest',
|
|
@@ -580,22 +517,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
580
517
|
|
|
581
518
|
let urlPath = `/text/convert`;
|
|
582
519
|
|
|
583
|
-
|
|
520
|
+
const response = await this.request({
|
|
584
521
|
path: urlPath,
|
|
585
522
|
method: 'POST',
|
|
586
523
|
headers: headerParameters,
|
|
587
524
|
query: queryParameters,
|
|
588
525
|
body: PostTextConvertRequestToJSON(requestParameters['postTextConvertRequest']),
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* 需要在不同文本格式之间转换?这个接口支持Base64、Hex、URL、HTML、Unicode等多种格式互转,还能生成MD5、SHA256等哈希值。 ## 功能概述 你提供待转换的文本、源格式和目标格式,接口会自动完成转换。支持7种双向格式(plain、base64、hex、url、html、unicode、binary)和4种单向哈希(md5、sha1、sha256、sha512)。 ## 格式说明 **双向转换格式**:plain(纯文本)、base64、hex(十六进制)、url、html(HTML实体)、unicode(\\uXXXX转义)、binary(二进制字符串) **单向哈希格式**:md5、sha1、sha256、sha512(仅可作为目标格式,不可逆) ## 链式转换 支持多次调用实现复杂转换,如先将文本转为base64,再将base64转为hex。
|
|
594
|
-
* 格式转换
|
|
595
|
-
*/
|
|
596
|
-
async postTextConvertRaw(requestParameters: PostTextConvertOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextConvert200Response>> {
|
|
597
|
-
const requestOptions = await this.postTextConvertRequestOpts(requestParameters);
|
|
598
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
526
|
+
}, initOverrides);
|
|
599
527
|
|
|
600
528
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextConvert200ResponseFromJSON(jsonValue));
|
|
601
529
|
}
|
|
@@ -610,9 +538,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
610
538
|
}
|
|
611
539
|
|
|
612
540
|
/**
|
|
613
|
-
*
|
|
541
|
+
* 一个用于计算文本 MD5 哈希值的标准工具,推荐使用此版本。 ## 功能概述 通过POST请求的表单体传入文本,返回其32位小写的MD5哈希值。相比GET版本,此方法更适合处理较长或包含敏感信息的文本。
|
|
542
|
+
* MD5 哈希 (POST)
|
|
614
543
|
*/
|
|
615
|
-
async
|
|
544
|
+
async postTextMd5Raw(requestParameters: PostTextMd5OperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetTextMd5200Response>> {
|
|
616
545
|
if (requestParameters['postTextMd5Request'] == null) {
|
|
617
546
|
throw new runtime.RequiredError(
|
|
618
547
|
'postTextMd5Request',
|
|
@@ -629,22 +558,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
629
558
|
|
|
630
559
|
let urlPath = `/text/md5`;
|
|
631
560
|
|
|
632
|
-
|
|
561
|
+
const response = await this.request({
|
|
633
562
|
path: urlPath,
|
|
634
563
|
method: 'POST',
|
|
635
564
|
headers: headerParameters,
|
|
636
565
|
query: queryParameters,
|
|
637
566
|
body: PostTextMd5RequestToJSON(requestParameters['postTextMd5Request']),
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* 一个用于计算文本 MD5 哈希值的标准工具,推荐使用此版本。 ## 功能概述 通过POST请求的表单体传入文本,返回其32位小写的MD5哈希值。相比GET版本,此方法更适合处理较长或包含敏感信息的文本。
|
|
643
|
-
* MD5 哈希 (POST)
|
|
644
|
-
*/
|
|
645
|
-
async postTextMd5Raw(requestParameters: PostTextMd5OperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetTextMd5200Response>> {
|
|
646
|
-
const requestOptions = await this.postTextMd5RequestOpts(requestParameters);
|
|
647
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
567
|
+
}, initOverrides);
|
|
648
568
|
|
|
649
569
|
return new runtime.JSONApiResponse(response, (jsonValue) => GetTextMd5200ResponseFromJSON(jsonValue));
|
|
650
570
|
}
|
|
@@ -659,9 +579,10 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
659
579
|
}
|
|
660
580
|
|
|
661
581
|
/**
|
|
662
|
-
*
|
|
582
|
+
* 下载了一个文件,想确认它在传输过程中有没有损坏?校验MD5值是最常用的方法。 ## 功能概述 你提供原始文本和一个MD5哈希值,我们帮你计算文本的哈希,并与你提供的哈希进行比对,告诉你它们是否匹配。这在文件完整性校验等场景下非常有用。
|
|
583
|
+
* MD5 校验
|
|
663
584
|
*/
|
|
664
|
-
async
|
|
585
|
+
async postTextMd5VerifyRaw(requestParameters: PostTextMd5VerifyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextMd5Verify200Response>> {
|
|
665
586
|
if (requestParameters['postTextMd5VerifyRequest'] == null) {
|
|
666
587
|
throw new runtime.RequiredError(
|
|
667
588
|
'postTextMd5VerifyRequest',
|
|
@@ -678,22 +599,13 @@ export class TextApi extends runtime.BaseAPI {
|
|
|
678
599
|
|
|
679
600
|
let urlPath = `/text/md5/verify`;
|
|
680
601
|
|
|
681
|
-
|
|
602
|
+
const response = await this.request({
|
|
682
603
|
path: urlPath,
|
|
683
604
|
method: 'POST',
|
|
684
605
|
headers: headerParameters,
|
|
685
606
|
query: queryParameters,
|
|
686
607
|
body: PostTextMd5VerifyRequestToJSON(requestParameters['postTextMd5VerifyRequest']),
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* 下载了一个文件,想确认它在传输过程中有没有损坏?校验MD5值是最常用的方法。 ## 功能概述 你提供原始文本和一个MD5哈希值,我们帮你计算文本的哈希,并与你提供的哈希进行比对,告诉你它们是否匹配。这在文件完整性校验等场景下非常有用。
|
|
692
|
-
* MD5 校验
|
|
693
|
-
*/
|
|
694
|
-
async postTextMd5VerifyRaw(requestParameters: PostTextMd5VerifyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTextMd5Verify200Response>> {
|
|
695
|
-
const requestOptions = await this.postTextMd5VerifyRequestOpts(requestParameters);
|
|
696
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
608
|
+
}, initOverrides);
|
|
697
609
|
|
|
698
610
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTextMd5Verify200ResponseFromJSON(jsonValue));
|
|
699
611
|
}
|
|
@@ -81,9 +81,10 @@ export interface PostTranslateTextOperationRequest {
|
|
|
81
81
|
export class TranslateApi extends runtime.BaseAPI {
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* 获取AI智能翻译服务支持的完整语言列表、翻译风格选项、上下文场景选项以及性能指标信息。
|
|
85
|
+
* AI翻译配置
|
|
85
86
|
*/
|
|
86
|
-
async
|
|
87
|
+
async getAiTranslateLanguagesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAiTranslateLanguages200Response>> {
|
|
87
88
|
const queryParameters: any = {};
|
|
88
89
|
|
|
89
90
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -91,21 +92,12 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
91
92
|
|
|
92
93
|
let urlPath = `/ai/translate/languages`;
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
const response = await this.request({
|
|
95
96
|
path: urlPath,
|
|
96
97
|
method: 'GET',
|
|
97
98
|
headers: headerParameters,
|
|
98
99
|
query: queryParameters,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* 获取AI智能翻译服务支持的完整语言列表、翻译风格选项、上下文场景选项以及性能指标信息。
|
|
104
|
-
* AI翻译配置
|
|
105
|
-
*/
|
|
106
|
-
async getAiTranslateLanguagesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAiTranslateLanguages200Response>> {
|
|
107
|
-
const requestOptions = await this.getAiTranslateLanguagesRequestOpts();
|
|
108
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
100
|
+
}, initOverrides);
|
|
109
101
|
|
|
110
102
|
return new runtime.JSONApiResponse(response, (jsonValue) => GetAiTranslateLanguages200ResponseFromJSON(jsonValue));
|
|
111
103
|
}
|
|
@@ -120,9 +112,10 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
120
112
|
}
|
|
121
113
|
|
|
122
114
|
/**
|
|
123
|
-
*
|
|
115
|
+
* 这是一个商业级的AI智能翻译服务,采用最新的神经网络翻译技术和大语言模型,提供远超传统机器翻译的质量。 ## 功能概述 - **单文本翻译**: 专注处理单条文本翻译,适合需要高质量译文的业务场景。 - **多风格适配**: 提供随意口语化、专业商务、学术正式、文学艺术四种翻译风格,能够根据不同场景需求调整翻译的语言风格和表达方式。 - **上下文感知**: 支持通用、商务、技术、医疗、法律、市场营销、娱乐、教育、新闻等九种专业领域的上下文翻译,确保术语准确性和表达地道性。 - **格式保留**: 智能识别并保持原文的格式结构,包括换行、缩进、特殊符号等,确保翻译后的文本保持良好的可读性。 ## 支持的语言 我们支持超过100种语言的互译,详见下方参数列表。
|
|
116
|
+
* AI智能翻译
|
|
124
117
|
*/
|
|
125
|
-
async
|
|
118
|
+
async postAiTranslateRaw(requestParameters: PostAiTranslateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostAiTranslate200Response>> {
|
|
126
119
|
if (requestParameters['targetLang'] == null) {
|
|
127
120
|
throw new runtime.RequiredError(
|
|
128
121
|
'targetLang',
|
|
@@ -150,22 +143,13 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
150
143
|
|
|
151
144
|
let urlPath = `/ai/translate`;
|
|
152
145
|
|
|
153
|
-
|
|
146
|
+
const response = await this.request({
|
|
154
147
|
path: urlPath,
|
|
155
148
|
method: 'POST',
|
|
156
149
|
headers: headerParameters,
|
|
157
150
|
query: queryParameters,
|
|
158
151
|
body: PostAiTranslateRequestToJSON(requestParameters['postAiTranslateRequest']),
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* 这是一个商业级的AI智能翻译服务,采用最新的神经网络翻译技术和大语言模型,提供远超传统机器翻译的质量。 ## 功能概述 - **单文本翻译**: 专注处理单条文本翻译,适合需要高质量译文的业务场景。 - **多风格适配**: 提供随意口语化、专业商务、学术正式、文学艺术四种翻译风格,能够根据不同场景需求调整翻译的语言风格和表达方式。 - **上下文感知**: 支持通用、商务、技术、医疗、法律、市场营销、娱乐、教育、新闻等九种专业领域的上下文翻译,确保术语准确性和表达地道性。 - **格式保留**: 智能识别并保持原文的格式结构,包括换行、缩进、特殊符号等,确保翻译后的文本保持良好的可读性。 ## 支持的语言 我们支持超过100种语言的互译,详见下方参数列表。
|
|
164
|
-
* AI智能翻译
|
|
165
|
-
*/
|
|
166
|
-
async postAiTranslateRaw(requestParameters: PostAiTranslateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostAiTranslate200Response>> {
|
|
167
|
-
const requestOptions = await this.postAiTranslateRequestOpts(requestParameters);
|
|
168
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
152
|
+
}, initOverrides);
|
|
169
153
|
|
|
170
154
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostAiTranslate200ResponseFromJSON(jsonValue));
|
|
171
155
|
}
|
|
@@ -180,9 +164,10 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
180
164
|
}
|
|
181
165
|
|
|
182
166
|
/**
|
|
183
|
-
*
|
|
167
|
+
* 想让翻译结果像打字机一样逐字显示出来?这个流式翻译接口能实现这种效果。 ## 功能概述 不同于传统翻译API一次性返回完整结果,这个接口会实时地、一个字一个字地把翻译内容推给你(就像ChatGPT回复消息那样),非常适合用在聊天应用、直播字幕等需要即时反馈的场景。 ## 它能做什么 - **中英互译**:支持中文和英文之间的双向翻译 - **自动识别**:不确定源语言?设置为 `auto` 让我们自动检测 - **逐字返回**:翻译结果会像打字机一样逐字流式返回,用户体验更流畅 - **音频朗读**:部分翻译结果会附带音频链接,方便朗读 ## 支持的语言 目前专注于中英互译,支持以下选项: - `中文`(简体/繁体) - `英文` - `auto`(自动检测)
|
|
168
|
+
* 流式翻译(中英互译)
|
|
184
169
|
*/
|
|
185
|
-
async
|
|
170
|
+
async postTranslateStreamRaw(requestParameters: PostTranslateStreamOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
|
|
186
171
|
if (requestParameters['postTranslateStreamRequest'] == null) {
|
|
187
172
|
throw new runtime.RequiredError(
|
|
188
173
|
'postTranslateStreamRequest',
|
|
@@ -199,22 +184,13 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
199
184
|
|
|
200
185
|
let urlPath = `/translate/stream`;
|
|
201
186
|
|
|
202
|
-
|
|
187
|
+
const response = await this.request({
|
|
203
188
|
path: urlPath,
|
|
204
189
|
method: 'POST',
|
|
205
190
|
headers: headerParameters,
|
|
206
191
|
query: queryParameters,
|
|
207
192
|
body: PostTranslateStreamRequestToJSON(requestParameters['postTranslateStreamRequest']),
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* 想让翻译结果像打字机一样逐字显示出来?这个流式翻译接口能实现这种效果。 ## 功能概述 不同于传统翻译API一次性返回完整结果,这个接口会实时地、一个字一个字地把翻译内容推给你(就像ChatGPT回复消息那样),非常适合用在聊天应用、直播字幕等需要即时反馈的场景。 ## 它能做什么 - **中英互译**:支持中文和英文之间的双向翻译 - **自动识别**:不确定源语言?设置为 `auto` 让我们自动检测 - **逐字返回**:翻译结果会像打字机一样逐字流式返回,用户体验更流畅 - **音频朗读**:部分翻译结果会附带音频链接,方便朗读 ## 支持的语言 目前专注于中英互译,支持以下选项: - `中文`(简体/繁体) - `英文` - `auto`(自动检测)
|
|
213
|
-
* 流式翻译(中英互译)
|
|
214
|
-
*/
|
|
215
|
-
async postTranslateStreamRaw(requestParameters: PostTranslateStreamOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
|
|
216
|
-
const requestOptions = await this.postTranslateStreamRequestOpts(requestParameters);
|
|
217
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
193
|
+
}, initOverrides);
|
|
218
194
|
|
|
219
195
|
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
220
196
|
return new runtime.JSONApiResponse<string>(response);
|
|
@@ -233,9 +209,10 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
233
209
|
}
|
|
234
210
|
|
|
235
211
|
/**
|
|
236
|
-
*
|
|
212
|
+
* 需要跨越语言的鸿沟进行交流?这个翻译接口是你可靠的\'同声传译\'。 ## 功能概述 你可以将一段源语言文本(我们能自动检测源语言)翻译成你指定的任何目标语言。无论是中译英、日译法,都不在话下。 ## 支持的语言 我们支持超过100种语言的互译,包括但不限于:中文(简体/繁体)、英语、日语、韩语、法语、德语、西班牙语、俄语、阿拉伯语等主流语言,以及各种小语种。详见下方参数列表。
|
|
213
|
+
* 翻译
|
|
237
214
|
*/
|
|
238
|
-
async
|
|
215
|
+
async postTranslateTextRaw(requestParameters: PostTranslateTextOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTranslateText200Response>> {
|
|
239
216
|
if (requestParameters['toLang'] == null) {
|
|
240
217
|
throw new runtime.RequiredError(
|
|
241
218
|
'toLang',
|
|
@@ -263,22 +240,13 @@ export class TranslateApi extends runtime.BaseAPI {
|
|
|
263
240
|
|
|
264
241
|
let urlPath = `/translate/text`;
|
|
265
242
|
|
|
266
|
-
|
|
243
|
+
const response = await this.request({
|
|
267
244
|
path: urlPath,
|
|
268
245
|
method: 'POST',
|
|
269
246
|
headers: headerParameters,
|
|
270
247
|
query: queryParameters,
|
|
271
248
|
body: PostTranslateTextRequestToJSON(requestParameters['postTranslateTextRequest']),
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* 需要跨越语言的鸿沟进行交流?这个翻译接口是你可靠的\'同声传译\'。 ## 功能概述 你可以将一段源语言文本(我们能自动检测源语言)翻译成你指定的任何目标语言。无论是中译英、日译法,都不在话下。 ## 支持的语言 我们支持超过100种语言的互译,包括但不限于:中文(简体/繁体)、英语、日语、韩语、法语、德语、西班牙语、俄语、阿拉伯语等主流语言,以及各种小语种。详见下方参数列表。
|
|
277
|
-
* 翻译
|
|
278
|
-
*/
|
|
279
|
-
async postTranslateTextRaw(requestParameters: PostTranslateTextOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostTranslateText200Response>> {
|
|
280
|
-
const requestOptions = await this.postTranslateTextRequestOpts(requestParameters);
|
|
281
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
249
|
+
}, initOverrides);
|
|
282
250
|
|
|
283
251
|
return new runtime.JSONApiResponse(response, (jsonValue) => PostTranslateText200ResponseFromJSON(jsonValue));
|
|
284
252
|
}
|