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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/internal/src/apis/ClipzyApi.d.ts +0 -12
  3. package/dist/internal/src/apis/ClipzyApi.js +15 -36
  4. package/dist/internal/src/apis/ConvertApi.d.ts +0 -8
  5. package/dist/internal/src/apis/ConvertApi.js +10 -24
  6. package/dist/internal/src/apis/DailyApi.d.ts +0 -4
  7. package/dist/internal/src/apis/DailyApi.js +5 -12
  8. package/dist/internal/src/apis/DefaultApi.d.ts +0 -20
  9. package/dist/internal/src/apis/DefaultApi.js +25 -60
  10. package/dist/internal/src/apis/GameApi.d.ts +0 -20
  11. package/dist/internal/src/apis/GameApi.js +25 -60
  12. package/dist/internal/src/apis/ImageApi.d.ts +0 -44
  13. package/dist/internal/src/apis/ImageApi.js +55 -132
  14. package/dist/internal/src/apis/MiscApi.d.ts +0 -60
  15. package/dist/internal/src/apis/MiscApi.js +75 -180
  16. package/dist/internal/src/apis/NetworkApi.d.ts +0 -40
  17. package/dist/internal/src/apis/NetworkApi.js +50 -120
  18. package/dist/internal/src/apis/PoemApi.d.ts +0 -4
  19. package/dist/internal/src/apis/PoemApi.js +5 -12
  20. package/dist/internal/src/apis/RandomApi.d.ts +0 -16
  21. package/dist/internal/src/apis/RandomApi.js +20 -48
  22. package/dist/internal/src/apis/SocialApi.d.ts +0 -32
  23. package/dist/internal/src/apis/SocialApi.js +40 -96
  24. package/dist/internal/src/apis/StatusApi.d.ts +0 -8
  25. package/dist/internal/src/apis/StatusApi.js +10 -24
  26. package/dist/internal/src/apis/TextApi.d.ts +0 -44
  27. package/dist/internal/src/apis/TextApi.js +55 -132
  28. package/dist/internal/src/apis/TranslateApi.d.ts +0 -16
  29. package/dist/internal/src/apis/TranslateApi.js +20 -48
  30. package/dist/internal/src/apis/WebParseApi.d.ts +0 -16
  31. package/dist/internal/src/apis/WebParseApi.js +20 -48
  32. package/dist/internal/src/models/GetMiscHolidayCalendar200ResponseHolidaysInner.d.ts +1 -1
  33. package/dist/internal/src/models/GetMiscWeather200Response.d.ts +1 -1
  34. package/dist/internal/src/models/PostAiTranslateRequest.d.ts +2 -2
  35. package/dist/internal/src/models/PostSearchAggregateRequest.d.ts +2 -2
  36. package/dist/internal/src/models/PostSensitiveWordAnalyze200ResponseResultsInner.d.ts +2 -2
  37. package/dist/internal/src/models/PostTextAesDecryptAdvancedRequest.d.ts +2 -2
  38. package/dist/internal/src/models/PostTextAesEncryptAdvancedRequest.d.ts +3 -3
  39. package/dist/internal/src/models/PostTextConvertRequest.d.ts +2 -2
  40. package/dist/internal/src/models/PostTranslateStream400Response.d.ts +1 -1
  41. package/dist/internal/src/runtime.js +0 -15
  42. package/dist/src/errors.d.ts +85 -0
  43. package/dist/src/errors.js +247 -0
  44. package/dist/src/index.d.ts +5 -6
  45. package/dist/src/index.js +9 -10
  46. package/internal/.openapi-generator/VERSION +1 -1
  47. package/internal/src/apis/ClipzyApi.ts +15 -39
  48. package/internal/src/apis/ConvertApi.ts +10 -26
  49. package/internal/src/apis/DailyApi.ts +5 -13
  50. package/internal/src/apis/DefaultApi.ts +25 -65
  51. package/internal/src/apis/GameApi.ts +25 -65
  52. package/internal/src/apis/ImageApi.ts +55 -143
  53. package/internal/src/apis/MiscApi.ts +75 -195
  54. package/internal/src/apis/NetworkApi.ts +50 -130
  55. package/internal/src/apis/PoemApi.ts +5 -13
  56. package/internal/src/apis/RandomApi.ts +20 -52
  57. package/internal/src/apis/SocialApi.ts +40 -104
  58. package/internal/src/apis/StatusApi.ts +10 -26
  59. package/internal/src/apis/TextApi.ts +55 -143
  60. package/internal/src/apis/TranslateApi.ts +20 -52
  61. package/internal/src/apis/WebParseApi.ts +20 -52
  62. package/internal/src/models/GetMiscHolidayCalendar200ResponseHolidaysInner.ts +1 -1
  63. package/internal/src/models/GetMiscWeather200Response.ts +1 -1
  64. package/internal/src/models/PostAiTranslateRequest.ts +2 -2
  65. package/internal/src/models/PostSearchAggregateRequest.ts +2 -2
  66. package/internal/src/models/PostSensitiveWordAnalyze200ResponseResultsInner.ts +2 -2
  67. package/internal/src/models/PostTextAesDecryptAdvancedRequest.ts +2 -2
  68. package/internal/src/models/PostTextAesEncryptAdvancedRequest.ts +3 -3
  69. package/internal/src/models/PostTextConvertRequest.ts +2 -2
  70. package/internal/src/models/PostTranslateStream400Response.ts +1 -1
  71. package/internal/src/runtime.ts +0 -18
  72. package/package.json +1 -1
  73. package/src/errors.ts +282 -0
  74. package/src/index.ts +12 -8
@@ -18,9 +18,10 @@ import { GetStatusRatelimit200ResponseFromJSON, GetStatusUsage200ResponseFromJSO
18
18
  */
19
19
  export class StatusApi extends runtime.BaseAPI {
20
20
  /**
21
- * Creates request options for getStatusRatelimit without sending the request
21
+ * 想了解我们API的当前负载情况吗?这个接口为你提供了服务的“心电图”。 ## 功能概述 此接口返回我们后端自适应限流器的实时状态。你可以看到当前并发请求数、并发上限、系统负载、请求接受/拒绝数等核心指标。这对于监控API健康状况和性能表现至关重要。 > [!IMPORTANT] > 此接口为管理接口,需要提供有效的管理员级别API密钥才能访问。 ### 认证方式 请在请求头中添加 `Authorization: Bearer <你的API密钥>`。
22
+ * 限流状态
22
23
  */
23
- async getStatusRatelimitRequestOpts(requestParameters) {
24
+ async getStatusRatelimitRaw(requestParameters, initOverrides) {
24
25
  if (requestParameters['authorization'] == null) {
25
26
  throw new runtime.RequiredError('authorization', 'Required parameter "authorization" was null or undefined when calling getStatusRatelimit().');
26
27
  }
@@ -30,20 +31,12 @@ export class StatusApi extends runtime.BaseAPI {
30
31
  headerParameters['Authorization'] = String(requestParameters['authorization']);
31
32
  }
32
33
  let urlPath = `/status/ratelimit`;
33
- return {
34
+ const response = await this.request({
34
35
  path: urlPath,
35
36
  method: 'GET',
36
37
  headers: headerParameters,
37
38
  query: queryParameters,
38
- };
39
- }
40
- /**
41
- * 想了解我们API的当前负载情况吗?这个接口为你提供了服务的“心电图”。 ## 功能概述 此接口返回我们后端自适应限流器的实时状态。你可以看到当前并发请求数、并发上限、系统负载、请求接受/拒绝数等核心指标。这对于监控API健康状况和性能表现至关重要。 > [!IMPORTANT] > 此接口为管理接口,需要提供有效的管理员级别API密钥才能访问。 ### 认证方式 请在请求头中添加 `Authorization: Bearer <你的API密钥>`。
42
- * 限流状态
43
- */
44
- async getStatusRatelimitRaw(requestParameters, initOverrides) {
45
- const requestOptions = await this.getStatusRatelimitRequestOpts(requestParameters);
46
- const response = await this.request(requestOptions, initOverrides);
39
+ }, initOverrides);
47
40
  return new runtime.JSONApiResponse(response, (jsonValue) => GetStatusRatelimit200ResponseFromJSON(jsonValue));
48
41
  }
49
42
  /**
@@ -55,29 +48,22 @@ export class StatusApi extends runtime.BaseAPI {
55
48
  return await response.value();
56
49
  }
57
50
  /**
58
- * Creates request options for getStatusUsage without sending the request
51
+ * 想知道哪个API接口最受欢迎吗?这个接口提供了详细的“账单”。 ## 功能概述 此接口用于获取每个API端点(Endpoint)的使用情况统计。你可以查询所有端点的列表,也可以通过 `path` 参数指定查询某一个特定端点。返回信息包括调用次数和平均处理时长
52
+ * 获取API端点使用统计
59
53
  */
60
- async getStatusUsageRequestOpts(requestParameters) {
54
+ async getStatusUsageRaw(requestParameters, initOverrides) {
61
55
  const queryParameters = {};
62
56
  if (requestParameters['path'] != null) {
63
57
  queryParameters['path'] = requestParameters['path'];
64
58
  }
65
59
  const headerParameters = {};
66
60
  let urlPath = `/status/usage`;
67
- return {
61
+ const response = await this.request({
68
62
  path: urlPath,
69
63
  method: 'GET',
70
64
  headers: headerParameters,
71
65
  query: queryParameters,
72
- };
73
- }
74
- /**
75
- * 想知道哪个API接口最受欢迎吗?这个接口提供了详细的“账单”。 ## 功能概述 此接口用于获取每个API端点(Endpoint)的使用情况统计。你可以查询所有端点的列表,也可以通过 `path` 参数指定查询某一个特定端点。返回信息包括调用次数和平均处理时长
76
- * 获取API端点使用统计
77
- */
78
- async getStatusUsageRaw(requestParameters, initOverrides) {
79
- const requestOptions = await this.getStatusUsageRequestOpts(requestParameters);
80
- const response = await this.request(requestOptions, initOverrides);
66
+ }, initOverrides);
81
67
  return new runtime.JSONApiResponse(response, (jsonValue) => GetStatusUsage200ResponseFromJSON(jsonValue));
82
68
  }
83
69
  /**
@@ -48,10 +48,6 @@ export interface PostTextMd5VerifyOperationRequest {
48
48
  *
49
49
  */
50
50
  export declare class TextApi extends runtime.BaseAPI {
51
- /**
52
- * Creates request options for getTextMd5 without sending the request
53
- */
54
- getTextMd5RequestOpts(requestParameters: GetTextMd5Request): Promise<runtime.RequestOpts>;
55
51
  /**
56
52
  * 一个快速计算文本 MD5 哈希值的工具,适用于短文本且不关心参数暴露的场景。 ## 功能概述 通过GET请求的查询参数传入文本,返回其32位小写的MD5哈希值。 > [!NOTE] > 对于较长或敏感的文本,我们推荐使用本接口的 POST 版本,以避免URL长度限制和参数暴露问题。
57
53
  * MD5 哈希
@@ -62,10 +58,6 @@ export declare class TextApi extends runtime.BaseAPI {
62
58
  * MD5 哈希
63
59
  */
64
60
  getTextMd5(requestParameters: GetTextMd5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetTextMd5200Response>;
65
- /**
66
- * Creates request options for postTextAesDecrypt without sending the request
67
- */
68
- postTextAesDecryptRequestOpts(requestParameters: PostTextAesDecryptOperationRequest): Promise<runtime.RequestOpts>;
69
61
  /**
70
62
  * 收到了用AES加密的密文?把它、密钥和随机数(nonce)交给我们,就能还原出原始内容。 ## 功能概述 这是一个标准的AES解密接口。你需要提供经过Base64编码的密文、加密时使用的密钥和nonce(随机数,通常为16字节字符串)。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。 > > **关于随机数 `nonce`** > 通常为16字节字符串,需与加密时一致。
71
63
  * AES 解密
@@ -76,10 +68,6 @@ export declare class TextApi extends runtime.BaseAPI {
76
68
  * AES 解密
77
69
  */
78
70
  postTextAesDecrypt(requestParameters: PostTextAesDecryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextAesDecrypt200Response>;
79
- /**
80
- * Creates request options for postTextAesDecryptAdvanced without sending the request
81
- */
82
- postTextAesDecryptAdvancedRequestOpts(requestParameters: PostTextAesDecryptAdvancedOperationRequest): Promise<runtime.RequestOpts>;
83
71
  /**
84
72
  * 需要解密通过高级加密接口加密的数据?这个接口提供与加密接口完全配对的解密功能,支持相同的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模式下密文是否被篡改
85
73
  * AES高级解密
@@ -90,10 +78,6 @@ export declare class TextApi extends runtime.BaseAPI {
90
78
  * AES高级解密
91
79
  */
92
80
  postTextAesDecryptAdvanced(requestParameters: PostTextAesDecryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextAesDecryptAdvanced200Response>;
93
- /**
94
- * Creates request options for postTextAesEncrypt without sending the request
95
- */
96
- postTextAesEncryptRequestOpts(requestParameters: PostTextAesEncryptOperationRequest): Promise<runtime.RequestOpts>;
97
81
  /**
98
82
  * 需要安全地传输或存储一些文本信息?AES加密是一个可靠的选择。 ## 功能概述 这是一个标准的AES加密接口。你提供需要加密的明文和密钥,我们返回经过Base64编码的密文。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。
99
83
  * AES 加密
@@ -104,10 +88,6 @@ export declare class TextApi extends runtime.BaseAPI {
104
88
  * AES 加密
105
89
  */
106
90
  postTextAesEncrypt(requestParameters: PostTextAesEncryptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextAesEncrypt200Response>;
107
- /**
108
- * Creates request options for postTextAesEncryptAdvanced without sending the request
109
- */
110
- postTextAesEncryptAdvancedRequestOpts(requestParameters: PostTextAesEncryptAdvancedOperationRequest): Promise<runtime.RequestOpts>;
111
91
  /**
112
92
  * 需要更灵活的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调用 > - 两种格式可以相互转换,数据完全一致
113
93
  * AES高级加密
@@ -118,10 +98,6 @@ export declare class TextApi extends runtime.BaseAPI {
118
98
  * AES高级加密
119
99
  */
120
100
  postTextAesEncryptAdvanced(requestParameters: PostTextAesEncryptAdvancedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextAesEncryptAdvanced200Response>;
121
- /**
122
- * Creates request options for postTextAnalyze without sending the request
123
- */
124
- postTextAnalyzeRequestOpts(requestParameters: PostTextAnalyzeOperationRequest): Promise<runtime.RequestOpts>;
125
101
  /**
126
102
  * 想知道一篇文章有多少字、多少个词、或者多少行?这个接口可以帮你快速统计。 ## 功能概述 你提供一段文本,我们会从多个维度进行分析,并返回其字符数、词数、句子数、段落数和行数。这对于文本编辑、内容管理等场景非常有用。
127
103
  * 文本分析
@@ -132,10 +108,6 @@ export declare class TextApi extends runtime.BaseAPI {
132
108
  * 文本分析
133
109
  */
134
110
  postTextAnalyze(requestParameters: PostTextAnalyzeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextAnalyze200Response>;
135
- /**
136
- * Creates request options for postTextBase64Decode without sending the request
137
- */
138
- postTextBase64DecodeRequestOpts(requestParameters: PostTextBase64DecodeOperationRequest): Promise<runtime.RequestOpts>;
139
111
  /**
140
112
  * 这是一个简单实用的 Base64 解码工具。 ## 功能概述 你提供一个 Base64 编码的字符串,我们帮你解码成原始的 UTF-8 文本。
141
113
  * Base64 解码
@@ -146,10 +118,6 @@ export declare class TextApi extends runtime.BaseAPI {
146
118
  * Base64 解码
147
119
  */
148
120
  postTextBase64Decode(requestParameters: PostTextBase64DecodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextBase64Decode200Response>;
149
- /**
150
- * Creates request options for postTextBase64Encode without sending the request
151
- */
152
- postTextBase64EncodeRequestOpts(requestParameters: PostTextBase64EncodeOperationRequest): Promise<runtime.RequestOpts>;
153
121
  /**
154
122
  * 这是一个简单实用的 Base64 编码工具。 ## 功能概述 你提供一段原始文本,我们帮你转换成 Base64 编码的字符串。
155
123
  * Base64 编码
@@ -160,10 +128,6 @@ export declare class TextApi extends runtime.BaseAPI {
160
128
  * Base64 编码
161
129
  */
162
130
  postTextBase64Encode(requestParameters: PostTextBase64EncodeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextBase64Encode200Response>;
163
- /**
164
- * Creates request options for postTextConvert without sending the request
165
- */
166
- postTextConvertRequestOpts(requestParameters: PostTextConvertOperationRequest): Promise<runtime.RequestOpts>;
167
131
  /**
168
132
  * 需要在不同文本格式之间转换?这个接口支持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。
169
133
  * 格式转换
@@ -174,10 +138,6 @@ export declare class TextApi extends runtime.BaseAPI {
174
138
  * 格式转换
175
139
  */
176
140
  postTextConvert(requestParameters: PostTextConvertOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostTextConvert200Response>;
177
- /**
178
- * Creates request options for postTextMd5 without sending the request
179
- */
180
- postTextMd5RequestOpts(requestParameters: PostTextMd5OperationRequest): Promise<runtime.RequestOpts>;
181
141
  /**
182
142
  * 一个用于计算文本 MD5 哈希值的标准工具,推荐使用此版本。 ## 功能概述 通过POST请求的表单体传入文本,返回其32位小写的MD5哈希值。相比GET版本,此方法更适合处理较长或包含敏感信息的文本。
183
143
  * MD5 哈希 (POST)
@@ -188,10 +148,6 @@ export declare class TextApi extends runtime.BaseAPI {
188
148
  * MD5 哈希 (POST)
189
149
  */
190
150
  postTextMd5(requestParameters: PostTextMd5OperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetTextMd5200Response>;
191
- /**
192
- * Creates request options for postTextMd5Verify without sending the request
193
- */
194
- postTextMd5VerifyRequestOpts(requestParameters: PostTextMd5VerifyOperationRequest): Promise<runtime.RequestOpts>;
195
151
  /**
196
152
  * 下载了一个文件,想确认它在传输过程中有没有损坏?校验MD5值是最常用的方法。 ## 功能概述 你提供原始文本和一个MD5哈希值,我们帮你计算文本的哈希,并与你提供的哈希进行比对,告诉你它们是否匹配。这在文件完整性校验等场景下非常有用。
197
153
  * MD5 校验
@@ -18,9 +18,10 @@ import { GetTextMd5200ResponseFromJSON, PostTextAesDecrypt200ResponseFromJSON, P
18
18
  */
19
19
  export class TextApi extends runtime.BaseAPI {
20
20
  /**
21
- * Creates request options for getTextMd5 without sending the request
21
+ * 一个快速计算文本 MD5 哈希值的工具,适用于短文本且不关心参数暴露的场景。 ## 功能概述 通过GET请求的查询参数传入文本,返回其32位小写的MD5哈希值。 > [!NOTE] > 对于较长或敏感的文本,我们推荐使用本接口的 POST 版本,以避免URL长度限制和参数暴露问题。
22
+ * MD5 哈希
22
23
  */
23
- async getTextMd5RequestOpts(requestParameters) {
24
+ async getTextMd5Raw(requestParameters, initOverrides) {
24
25
  if (requestParameters['text'] == null) {
25
26
  throw new runtime.RequiredError('text', 'Required parameter "text" was null or undefined when calling getTextMd5().');
26
27
  }
@@ -30,20 +31,12 @@ export class TextApi extends runtime.BaseAPI {
30
31
  }
31
32
  const headerParameters = {};
32
33
  let urlPath = `/text/md5`;
33
- return {
34
+ const response = await this.request({
34
35
  path: urlPath,
35
36
  method: 'GET',
36
37
  headers: headerParameters,
37
38
  query: queryParameters,
38
- };
39
- }
40
- /**
41
- * 一个快速计算文本 MD5 哈希值的工具,适用于短文本且不关心参数暴露的场景。 ## 功能概述 通过GET请求的查询参数传入文本,返回其32位小写的MD5哈希值。 > [!NOTE] > 对于较长或敏感的文本,我们推荐使用本接口的 POST 版本,以避免URL长度限制和参数暴露问题。
42
- * MD5 哈希
43
- */
44
- async getTextMd5Raw(requestParameters, initOverrides) {
45
- const requestOptions = await this.getTextMd5RequestOpts(requestParameters);
46
- const response = await this.request(requestOptions, initOverrides);
39
+ }, initOverrides);
47
40
  return new runtime.JSONApiResponse(response, (jsonValue) => GetTextMd5200ResponseFromJSON(jsonValue));
48
41
  }
49
42
  /**
@@ -55,9 +48,10 @@ export class TextApi extends runtime.BaseAPI {
55
48
  return await response.value();
56
49
  }
57
50
  /**
58
- * Creates request options for postTextAesDecrypt without sending the request
51
+ * 收到了用AES加密的密文?把它、密钥和随机数(nonce)交给我们,就能还原出原始内容。 ## 功能概述 这是一个标准的AES解密接口。你需要提供经过Base64编码的密文、加密时使用的密钥和nonce(随机数,通常为16字节字符串)。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。 > > **关于随机数 `nonce`** > 通常为16字节字符串,需与加密时一致。
52
+ * AES 解密
59
53
  */
60
- async postTextAesDecryptRequestOpts(requestParameters) {
54
+ async postTextAesDecryptRaw(requestParameters, initOverrides) {
61
55
  if (requestParameters['postTextAesDecryptRequest'] == null) {
62
56
  throw new runtime.RequiredError('postTextAesDecryptRequest', 'Required parameter "postTextAesDecryptRequest" was null or undefined when calling postTextAesDecrypt().');
63
57
  }
@@ -65,21 +59,13 @@ export class TextApi extends runtime.BaseAPI {
65
59
  const headerParameters = {};
66
60
  headerParameters['Content-Type'] = 'application/json';
67
61
  let urlPath = `/text/aes/decrypt`;
68
- return {
62
+ const response = await this.request({
69
63
  path: urlPath,
70
64
  method: 'POST',
71
65
  headers: headerParameters,
72
66
  query: queryParameters,
73
67
  body: PostTextAesDecryptRequestToJSON(requestParameters['postTextAesDecryptRequest']),
74
- };
75
- }
76
- /**
77
- * 收到了用AES加密的密文?把它、密钥和随机数(nonce)交给我们,就能还原出原始内容。 ## 功能概述 这是一个标准的AES解密接口。你需要提供经过Base64编码的密文、加密时使用的密钥和nonce(随机数,通常为16字节字符串)。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。 > > **关于随机数 `nonce`** > 通常为16字节字符串,需与加密时一致。
78
- * AES 解密
79
- */
80
- async postTextAesDecryptRaw(requestParameters, initOverrides) {
81
- const requestOptions = await this.postTextAesDecryptRequestOpts(requestParameters);
82
- const response = await this.request(requestOptions, initOverrides);
68
+ }, initOverrides);
83
69
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesDecrypt200ResponseFromJSON(jsonValue));
84
70
  }
85
71
  /**
@@ -91,9 +77,10 @@ export class TextApi extends runtime.BaseAPI {
91
77
  return await response.value();
92
78
  }
93
79
  /**
94
- * Creates request options for postTextAesDecryptAdvanced without sending the request
80
+ * 需要解密通过高级加密接口加密的数据?这个接口提供与加密接口完全配对的解密功能,支持相同的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模式下密文是否被篡改
81
+ * AES高级解密
95
82
  */
96
- async postTextAesDecryptAdvancedRequestOpts(requestParameters) {
83
+ async postTextAesDecryptAdvancedRaw(requestParameters, initOverrides) {
97
84
  if (requestParameters['postTextAesDecryptAdvancedRequest'] == null) {
98
85
  throw new runtime.RequiredError('postTextAesDecryptAdvancedRequest', 'Required parameter "postTextAesDecryptAdvancedRequest" was null or undefined when calling postTextAesDecryptAdvanced().');
99
86
  }
@@ -101,21 +88,13 @@ export class TextApi extends runtime.BaseAPI {
101
88
  const headerParameters = {};
102
89
  headerParameters['Content-Type'] = 'application/json';
103
90
  let urlPath = `/text/aes/decrypt-advanced`;
104
- return {
91
+ const response = await this.request({
105
92
  path: urlPath,
106
93
  method: 'POST',
107
94
  headers: headerParameters,
108
95
  query: queryParameters,
109
96
  body: PostTextAesDecryptAdvancedRequestToJSON(requestParameters['postTextAesDecryptAdvancedRequest']),
110
- };
111
- }
112
- /**
113
- * 需要解密通过高级加密接口加密的数据?这个接口提供与加密接口完全配对的解密功能,支持相同的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模式下密文是否被篡改
114
- * AES高级解密
115
- */
116
- async postTextAesDecryptAdvancedRaw(requestParameters, initOverrides) {
117
- const requestOptions = await this.postTextAesDecryptAdvancedRequestOpts(requestParameters);
118
- const response = await this.request(requestOptions, initOverrides);
97
+ }, initOverrides);
119
98
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesDecryptAdvanced200ResponseFromJSON(jsonValue));
120
99
  }
121
100
  /**
@@ -127,9 +106,10 @@ export class TextApi extends runtime.BaseAPI {
127
106
  return await response.value();
128
107
  }
129
108
  /**
130
- * Creates request options for postTextAesEncrypt without sending the request
109
+ * 需要安全地传输或存储一些文本信息?AES加密是一个可靠的选择。 ## 功能概述 这是一个标准的AES加密接口。你提供需要加密的明文和密钥,我们返回经过Base64编码的密文。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。
110
+ * AES 加密
131
111
  */
132
- async postTextAesEncryptRequestOpts(requestParameters) {
112
+ async postTextAesEncryptRaw(requestParameters, initOverrides) {
133
113
  if (requestParameters['postTextAesEncryptRequest'] == null) {
134
114
  throw new runtime.RequiredError('postTextAesEncryptRequest', 'Required parameter "postTextAesEncryptRequest" was null or undefined when calling postTextAesEncrypt().');
135
115
  }
@@ -137,21 +117,13 @@ export class TextApi extends runtime.BaseAPI {
137
117
  const headerParameters = {};
138
118
  headerParameters['Content-Type'] = 'application/json';
139
119
  let urlPath = `/text/aes/encrypt`;
140
- return {
120
+ const response = await this.request({
141
121
  path: urlPath,
142
122
  method: 'POST',
143
123
  headers: headerParameters,
144
124
  query: queryParameters,
145
125
  body: PostTextAesEncryptRequestToJSON(requestParameters['postTextAesEncryptRequest']),
146
- };
147
- }
148
- /**
149
- * 需要安全地传输或存储一些文本信息?AES加密是一个可靠的选择。 ## 功能概述 这是一个标准的AES加密接口。你提供需要加密的明文和密钥,我们返回经过Base64编码的密文。 > [!IMPORTANT] > **关于密钥 `key`** > 我们支持 AES-128, AES-192, 和 AES-256。请确保你提供的密钥 `key` 的长度(字节数)正好是 **16**、**24** 或 **32**,以分别对应这三种加密强度。
150
- * AES 加密
151
- */
152
- async postTextAesEncryptRaw(requestParameters, initOverrides) {
153
- const requestOptions = await this.postTextAesEncryptRequestOpts(requestParameters);
154
- const response = await this.request(requestOptions, initOverrides);
126
+ }, initOverrides);
155
127
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesEncrypt200ResponseFromJSON(jsonValue));
156
128
  }
157
129
  /**
@@ -163,9 +135,10 @@ export class TextApi extends runtime.BaseAPI {
163
135
  return await response.value();
164
136
  }
165
137
  /**
166
- * Creates request options for postTextAesEncryptAdvanced without sending the request
138
+ * 需要更灵活的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调用 > - 两种格式可以相互转换,数据完全一致
139
+ * AES高级加密
167
140
  */
168
- async postTextAesEncryptAdvancedRequestOpts(requestParameters) {
141
+ async postTextAesEncryptAdvancedRaw(requestParameters, initOverrides) {
169
142
  if (requestParameters['postTextAesEncryptAdvancedRequest'] == null) {
170
143
  throw new runtime.RequiredError('postTextAesEncryptAdvancedRequest', 'Required parameter "postTextAesEncryptAdvancedRequest" was null or undefined when calling postTextAesEncryptAdvanced().');
171
144
  }
@@ -173,21 +146,13 @@ export class TextApi extends runtime.BaseAPI {
173
146
  const headerParameters = {};
174
147
  headerParameters['Content-Type'] = 'application/json';
175
148
  let urlPath = `/text/aes/encrypt-advanced`;
176
- return {
149
+ const response = await this.request({
177
150
  path: urlPath,
178
151
  method: 'POST',
179
152
  headers: headerParameters,
180
153
  query: queryParameters,
181
154
  body: PostTextAesEncryptAdvancedRequestToJSON(requestParameters['postTextAesEncryptAdvancedRequest']),
182
- };
183
- }
184
- /**
185
- * 需要更灵活的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调用 > - 两种格式可以相互转换,数据完全一致
186
- * AES高级加密
187
- */
188
- async postTextAesEncryptAdvancedRaw(requestParameters, initOverrides) {
189
- const requestOptions = await this.postTextAesEncryptAdvancedRequestOpts(requestParameters);
190
- const response = await this.request(requestOptions, initOverrides);
155
+ }, initOverrides);
191
156
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAesEncryptAdvanced200ResponseFromJSON(jsonValue));
192
157
  }
193
158
  /**
@@ -199,9 +164,10 @@ export class TextApi extends runtime.BaseAPI {
199
164
  return await response.value();
200
165
  }
201
166
  /**
202
- * Creates request options for postTextAnalyze without sending the request
167
+ * 想知道一篇文章有多少字、多少个词、或者多少行?这个接口可以帮你快速统计。 ## 功能概述 你提供一段文本,我们会从多个维度进行分析,并返回其字符数、词数、句子数、段落数和行数。这对于文本编辑、内容管理等场景非常有用。
168
+ * 文本分析
203
169
  */
204
- async postTextAnalyzeRequestOpts(requestParameters) {
170
+ async postTextAnalyzeRaw(requestParameters, initOverrides) {
205
171
  if (requestParameters['postTextAnalyzeRequest'] == null) {
206
172
  throw new runtime.RequiredError('postTextAnalyzeRequest', 'Required parameter "postTextAnalyzeRequest" was null or undefined when calling postTextAnalyze().');
207
173
  }
@@ -209,21 +175,13 @@ export class TextApi extends runtime.BaseAPI {
209
175
  const headerParameters = {};
210
176
  headerParameters['Content-Type'] = 'application/json';
211
177
  let urlPath = `/text/analyze`;
212
- return {
178
+ const response = await this.request({
213
179
  path: urlPath,
214
180
  method: 'POST',
215
181
  headers: headerParameters,
216
182
  query: queryParameters,
217
183
  body: PostTextAnalyzeRequestToJSON(requestParameters['postTextAnalyzeRequest']),
218
- };
219
- }
220
- /**
221
- * 想知道一篇文章有多少字、多少个词、或者多少行?这个接口可以帮你快速统计。 ## 功能概述 你提供一段文本,我们会从多个维度进行分析,并返回其字符数、词数、句子数、段落数和行数。这对于文本编辑、内容管理等场景非常有用。
222
- * 文本分析
223
- */
224
- async postTextAnalyzeRaw(requestParameters, initOverrides) {
225
- const requestOptions = await this.postTextAnalyzeRequestOpts(requestParameters);
226
- const response = await this.request(requestOptions, initOverrides);
184
+ }, initOverrides);
227
185
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextAnalyze200ResponseFromJSON(jsonValue));
228
186
  }
229
187
  /**
@@ -235,9 +193,10 @@ export class TextApi extends runtime.BaseAPI {
235
193
  return await response.value();
236
194
  }
237
195
  /**
238
- * Creates request options for postTextBase64Decode without sending the request
196
+ * 这是一个简单实用的 Base64 解码工具。 ## 功能概述 你提供一个 Base64 编码的字符串,我们帮你解码成原始的 UTF-8 文本。
197
+ * Base64 解码
239
198
  */
240
- async postTextBase64DecodeRequestOpts(requestParameters) {
199
+ async postTextBase64DecodeRaw(requestParameters, initOverrides) {
241
200
  if (requestParameters['postTextBase64DecodeRequest'] == null) {
242
201
  throw new runtime.RequiredError('postTextBase64DecodeRequest', 'Required parameter "postTextBase64DecodeRequest" was null or undefined when calling postTextBase64Decode().');
243
202
  }
@@ -245,21 +204,13 @@ export class TextApi extends runtime.BaseAPI {
245
204
  const headerParameters = {};
246
205
  headerParameters['Content-Type'] = 'application/json';
247
206
  let urlPath = `/text/base64/decode`;
248
- return {
207
+ const response = await this.request({
249
208
  path: urlPath,
250
209
  method: 'POST',
251
210
  headers: headerParameters,
252
211
  query: queryParameters,
253
212
  body: PostTextBase64DecodeRequestToJSON(requestParameters['postTextBase64DecodeRequest']),
254
- };
255
- }
256
- /**
257
- * 这是一个简单实用的 Base64 解码工具。 ## 功能概述 你提供一个 Base64 编码的字符串,我们帮你解码成原始的 UTF-8 文本。
258
- * Base64 解码
259
- */
260
- async postTextBase64DecodeRaw(requestParameters, initOverrides) {
261
- const requestOptions = await this.postTextBase64DecodeRequestOpts(requestParameters);
262
- const response = await this.request(requestOptions, initOverrides);
213
+ }, initOverrides);
263
214
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextBase64Decode200ResponseFromJSON(jsonValue));
264
215
  }
265
216
  /**
@@ -271,9 +222,10 @@ export class TextApi extends runtime.BaseAPI {
271
222
  return await response.value();
272
223
  }
273
224
  /**
274
- * Creates request options for postTextBase64Encode without sending the request
225
+ * 这是一个简单实用的 Base64 编码工具。 ## 功能概述 你提供一段原始文本,我们帮你转换成 Base64 编码的字符串。
226
+ * Base64 编码
275
227
  */
276
- async postTextBase64EncodeRequestOpts(requestParameters) {
228
+ async postTextBase64EncodeRaw(requestParameters, initOverrides) {
277
229
  if (requestParameters['postTextBase64EncodeRequest'] == null) {
278
230
  throw new runtime.RequiredError('postTextBase64EncodeRequest', 'Required parameter "postTextBase64EncodeRequest" was null or undefined when calling postTextBase64Encode().');
279
231
  }
@@ -281,21 +233,13 @@ export class TextApi extends runtime.BaseAPI {
281
233
  const headerParameters = {};
282
234
  headerParameters['Content-Type'] = 'application/json';
283
235
  let urlPath = `/text/base64/encode`;
284
- return {
236
+ const response = await this.request({
285
237
  path: urlPath,
286
238
  method: 'POST',
287
239
  headers: headerParameters,
288
240
  query: queryParameters,
289
241
  body: PostTextBase64EncodeRequestToJSON(requestParameters['postTextBase64EncodeRequest']),
290
- };
291
- }
292
- /**
293
- * 这是一个简单实用的 Base64 编码工具。 ## 功能概述 你提供一段原始文本,我们帮你转换成 Base64 编码的字符串。
294
- * Base64 编码
295
- */
296
- async postTextBase64EncodeRaw(requestParameters, initOverrides) {
297
- const requestOptions = await this.postTextBase64EncodeRequestOpts(requestParameters);
298
- const response = await this.request(requestOptions, initOverrides);
242
+ }, initOverrides);
299
243
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextBase64Encode200ResponseFromJSON(jsonValue));
300
244
  }
301
245
  /**
@@ -307,9 +251,10 @@ export class TextApi extends runtime.BaseAPI {
307
251
  return await response.value();
308
252
  }
309
253
  /**
310
- * Creates request options for postTextConvert without sending the request
254
+ * 需要在不同文本格式之间转换?这个接口支持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。
255
+ * 格式转换
311
256
  */
312
- async postTextConvertRequestOpts(requestParameters) {
257
+ async postTextConvertRaw(requestParameters, initOverrides) {
313
258
  if (requestParameters['postTextConvertRequest'] == null) {
314
259
  throw new runtime.RequiredError('postTextConvertRequest', 'Required parameter "postTextConvertRequest" was null or undefined when calling postTextConvert().');
315
260
  }
@@ -317,21 +262,13 @@ export class TextApi extends runtime.BaseAPI {
317
262
  const headerParameters = {};
318
263
  headerParameters['Content-Type'] = 'application/json';
319
264
  let urlPath = `/text/convert`;
320
- return {
265
+ const response = await this.request({
321
266
  path: urlPath,
322
267
  method: 'POST',
323
268
  headers: headerParameters,
324
269
  query: queryParameters,
325
270
  body: PostTextConvertRequestToJSON(requestParameters['postTextConvertRequest']),
326
- };
327
- }
328
- /**
329
- * 需要在不同文本格式之间转换?这个接口支持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。
330
- * 格式转换
331
- */
332
- async postTextConvertRaw(requestParameters, initOverrides) {
333
- const requestOptions = await this.postTextConvertRequestOpts(requestParameters);
334
- const response = await this.request(requestOptions, initOverrides);
271
+ }, initOverrides);
335
272
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextConvert200ResponseFromJSON(jsonValue));
336
273
  }
337
274
  /**
@@ -343,9 +280,10 @@ export class TextApi extends runtime.BaseAPI {
343
280
  return await response.value();
344
281
  }
345
282
  /**
346
- * Creates request options for postTextMd5 without sending the request
283
+ * 一个用于计算文本 MD5 哈希值的标准工具,推荐使用此版本。 ## 功能概述 通过POST请求的表单体传入文本,返回其32位小写的MD5哈希值。相比GET版本,此方法更适合处理较长或包含敏感信息的文本。
284
+ * MD5 哈希 (POST)
347
285
  */
348
- async postTextMd5RequestOpts(requestParameters) {
286
+ async postTextMd5Raw(requestParameters, initOverrides) {
349
287
  if (requestParameters['postTextMd5Request'] == null) {
350
288
  throw new runtime.RequiredError('postTextMd5Request', 'Required parameter "postTextMd5Request" was null or undefined when calling postTextMd5().');
351
289
  }
@@ -353,21 +291,13 @@ export class TextApi extends runtime.BaseAPI {
353
291
  const headerParameters = {};
354
292
  headerParameters['Content-Type'] = 'application/json';
355
293
  let urlPath = `/text/md5`;
356
- return {
294
+ const response = await this.request({
357
295
  path: urlPath,
358
296
  method: 'POST',
359
297
  headers: headerParameters,
360
298
  query: queryParameters,
361
299
  body: PostTextMd5RequestToJSON(requestParameters['postTextMd5Request']),
362
- };
363
- }
364
- /**
365
- * 一个用于计算文本 MD5 哈希值的标准工具,推荐使用此版本。 ## 功能概述 通过POST请求的表单体传入文本,返回其32位小写的MD5哈希值。相比GET版本,此方法更适合处理较长或包含敏感信息的文本。
366
- * MD5 哈希 (POST)
367
- */
368
- async postTextMd5Raw(requestParameters, initOverrides) {
369
- const requestOptions = await this.postTextMd5RequestOpts(requestParameters);
370
- const response = await this.request(requestOptions, initOverrides);
300
+ }, initOverrides);
371
301
  return new runtime.JSONApiResponse(response, (jsonValue) => GetTextMd5200ResponseFromJSON(jsonValue));
372
302
  }
373
303
  /**
@@ -379,9 +309,10 @@ export class TextApi extends runtime.BaseAPI {
379
309
  return await response.value();
380
310
  }
381
311
  /**
382
- * Creates request options for postTextMd5Verify without sending the request
312
+ * 下载了一个文件,想确认它在传输过程中有没有损坏?校验MD5值是最常用的方法。 ## 功能概述 你提供原始文本和一个MD5哈希值,我们帮你计算文本的哈希,并与你提供的哈希进行比对,告诉你它们是否匹配。这在文件完整性校验等场景下非常有用。
313
+ * MD5 校验
383
314
  */
384
- async postTextMd5VerifyRequestOpts(requestParameters) {
315
+ async postTextMd5VerifyRaw(requestParameters, initOverrides) {
385
316
  if (requestParameters['postTextMd5VerifyRequest'] == null) {
386
317
  throw new runtime.RequiredError('postTextMd5VerifyRequest', 'Required parameter "postTextMd5VerifyRequest" was null or undefined when calling postTextMd5Verify().');
387
318
  }
@@ -389,21 +320,13 @@ export class TextApi extends runtime.BaseAPI {
389
320
  const headerParameters = {};
390
321
  headerParameters['Content-Type'] = 'application/json';
391
322
  let urlPath = `/text/md5/verify`;
392
- return {
323
+ const response = await this.request({
393
324
  path: urlPath,
394
325
  method: 'POST',
395
326
  headers: headerParameters,
396
327
  query: queryParameters,
397
328
  body: PostTextMd5VerifyRequestToJSON(requestParameters['postTextMd5VerifyRequest']),
398
- };
399
- }
400
- /**
401
- * 下载了一个文件,想确认它在传输过程中有没有损坏?校验MD5值是最常用的方法。 ## 功能概述 你提供原始文本和一个MD5哈希值,我们帮你计算文本的哈希,并与你提供的哈希进行比对,告诉你它们是否匹配。这在文件完整性校验等场景下非常有用。
402
- * MD5 校验
403
- */
404
- async postTextMd5VerifyRaw(requestParameters, initOverrides) {
405
- const requestOptions = await this.postTextMd5VerifyRequestOpts(requestParameters);
406
- const response = await this.request(requestOptions, initOverrides);
329
+ }, initOverrides);
407
330
  return new runtime.JSONApiResponse(response, (jsonValue) => PostTextMd5Verify200ResponseFromJSON(jsonValue));
408
331
  }
409
332
  /**