uapi-browser-sdk 0.1.3 → 0.1.4

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 CHANGED
@@ -1,20 +1,20 @@
1
1
  # uapi-browser-sdk
2
-
3
- ![Banner](https://raw.githubusercontent.com/AxT-Team/uapi-browser-sdk/main/banner.png)
4
-
2
+
3
+ ![Banner](https://raw.githubusercontent.com/uapis/uapi-browser-sdk/main/banner.png)
4
+
5
5
  [![Browser TS](https://img.shields.io/badge/TypeScript-ES2020-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
6
6
  [![Docs](https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square)](https://uapis.cn/)
7
7
  [![npm](https://img.shields.io/npm/v/uapi-browser-sdk?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/uapi-browser-sdk)
8
-
9
- > [!NOTE]
10
- > 所有接口的 Browser (TypeScript) 示例都可以在 [UApi](https://uapis.cn/docs/introduction) 的接口文档页面,向下滚动至 **快速启动** 区块后直接复制。
11
-
12
- ## 快速开始
13
-
14
- ```bash
15
- npm i uapi-browser-sdk
16
- ```
17
-
8
+
9
+ > [!NOTE]
10
+ > 所有接口的 Browser (TypeScript) 示例都可以在 [UApi](https://uapis.cn/docs/introduction) 的接口文档页面,向下滚动至 **快速启动** 区块后直接复制。
11
+
12
+ ## 快速开始
13
+
14
+ ```bash
15
+ npm i uapi-browser-sdk
16
+ ```
17
+
18
18
  ```ts
19
19
  import { UapiClient } from 'uapi-browser-sdk'
20
20
 
@@ -57,45 +57,45 @@ import { UapiClient } from 'https://esm.run/uapi-browser-sdk@latest';
57
57
  三种 CDN 均会返回同一份浏览器模块,可按自己的缓存/区域策略选择。
58
58
 
59
59
  ## 特性
60
-
61
- 现在你不再需要反反复复的查阅文档了。
62
-
63
- 只需在 IDE 中键入 `client.`,所有核心模块——如 `social`、`game`、`image`——即刻同步展现。进一步输入即可直接定位到 `getSocialQqUserinfo` 这样的具体方法,其名称与文档的 `operationId` 严格保持一致,确保了开发过程的直观与高效。
64
-
65
- 所有方法签名只接受真实且必需的参数。当你在构建请求时,TypeScript 会即时提示 `qq`、`username` 等键名,这彻底杜绝了在对象字面量中因键名拼写错误而导致的运行时错误。
66
-
67
- 针对 401、404、429 等标准 HTTP 响应,SDK 已将其统一映射为 `UapiError`。错误对象自带 `code`、`status` 与 `details` 字段,确保你在浏览器日志中能第一时间准确、快速地诊断问题。
68
-
69
- SDK 采用原生 `fetch`,自动补上 `Authorization` 头且不依赖任何 Node.js API;需要自定义超时或重试时,只要包装 `_request` 或替换调用处即可。
70
-
71
- 如果你需要查看字段细节或内部逻辑,仓库中的 `./internal` 目录同步保留了由 `openapi-generator` 生成的完整结构体,随时可供参考。
72
-
73
- ## 错误模型概览
74
-
75
- | HTTP 状态码 | SDK 错误类型 | 附加信息 |
76
- |-------------|-------------|----------------------------------------------|
77
- | 401/403 | `UapiError` | `code`、`status`、`details` |
78
- | 404 | `UapiError` | `code`、`status` |
79
- | 400 | `UapiError` | `code`、`status`、`details` |
80
- | 429 | `UapiError` | `code`、`status`、`retry_after_seconds` |
81
- | 5xx | `UapiError` | `code`、`status` |
82
-
83
- ## 其他 SDK
84
-
85
- | 语言 | 仓库地址 |
86
- |-------------|--------------------------------------------------------------|
87
- | Go | https://github.com/AxT-Team/uapi-sdk-go |
88
- | Python | https://github.com/AxT-Team/uapi-sdk-python |
89
- | TypeScript| https://github.com/AxT-Team/uapi-sdk-typescript |
90
- | Browser (TypeScript/JavaScript)(当前)| https://github.com/AxT-Team/uapi-browser-sdk |
91
- | Java | https://github.com/AxT-Team/uapi-sdk-java |
92
- | PHP | https://github.com/AxT-Team/uapi-sdk-php |
93
- | C# | https://github.com/AxT-Team/uapi-sdk-csharp |
94
- | C++ | https://github.com/AxT-Team/uapi-sdk-cpp |
95
- | Rust | https://github.com/AxT-Team/uapi-sdk-rust |
96
-
97
- ## 文档
98
-
99
- 访问 [UApi文档首页](https://uapis.cn/docs/introduction) 并选择任意接口,向下滚动到 **快速启动** 区块即可看到最新的 Browser (TypeScript) 示例代码。
100
-
101
-
60
+
61
+ 现在你不再需要反反复复的查阅文档了。
62
+
63
+ 只需在 IDE 中键入 `client.`,所有核心模块——如 `social`、`game`、`image`——即刻同步展现。进一步输入即可直接定位到 `getSocialQqUserinfo` 这样的具体方法,其名称与文档的 `operationId` 严格保持一致,确保了开发过程的直观与高效。
64
+
65
+ 所有方法签名只接受真实且必需的参数。当你在构建请求时,TypeScript 会即时提示 `qq`、`username` 等键名,这彻底杜绝了在对象字面量中因键名拼写错误而导致的运行时错误。
66
+
67
+ 针对 401、404、429 等标准 HTTP 响应,SDK 已将其统一映射为 `UapiError`。错误对象自带 `code`、`status` 与 `details` 字段,确保你在浏览器日志中能第一时间准确、快速地诊断问题。
68
+
69
+ SDK 采用原生 `fetch`,自动补上 `Authorization` 头且不依赖任何 Node.js API;需要自定义超时或重试时,只要包装 `_request` 或替换调用处即可。
70
+
71
+ 如果你需要查看字段细节或内部逻辑,仓库中的 `./internal` 目录同步保留了由 `openapi-generator` 生成的完整结构体,随时可供参考。
72
+
73
+ ## 错误模型概览
74
+
75
+ | HTTP 状态码 | SDK 错误类型 | 附加信息 |
76
+ |-------------|-------------|----------------------------------------------|
77
+ | 401/403 | `UapiError` | `code`、`status`、`details` |
78
+ | 404 | `UapiError` | `code`、`status` |
79
+ | 400 | `UapiError` | `code`、`status`、`details` |
80
+ | 429 | `UapiError` | `code`、`status`、`retry_after_seconds` |
81
+ | 5xx | `UapiError` | `code`、`status` |
82
+
83
+ ## 其他 SDK
84
+
85
+ | 语言 | 仓库地址 |
86
+ |-------------|--------------------------------------------------------------|
87
+ | Go | https://github.com/AxT-Team/uapi-sdk-go |
88
+ | Python | https://github.com/AxT-Team/uapi-sdk-python |
89
+ | TypeScript| https://github.com/AxT-Team/uapi-sdk-typescript |
90
+ | Browser (TypeScript/JavaScript)(当前)| https://github.com/AxT-Team/uapi-browser-sdk |
91
+ | Java | https://github.com/AxT-Team/uapi-sdk-java |
92
+ | PHP | https://github.com/AxT-Team/uapi-sdk-php |
93
+ | C# | https://github.com/AxT-Team/uapi-sdk-csharp |
94
+ | C++ | https://github.com/AxT-Team/uapi-sdk-cpp |
95
+ | Rust | https://github.com/AxT-Team/uapi-sdk-rust |
96
+
97
+ ## 文档
98
+
99
+ 访问 [UApi文档首页](https://uapis.cn/docs/introduction) 并选择任意接口,向下滚动到 **快速启动** 区块即可看到最新的 Browser (TypeScript) 示例代码。
100
+
101
+
package/dist/index.d.ts CHANGED
@@ -81,6 +81,7 @@ declare class MiscApi {
81
81
  getMiscTrackingQuery(args?: any): Promise<any>;
82
82
  getMiscWeather(args?: any): Promise<any>;
83
83
  getMiscWorldtime(args?: any): Promise<any>;
84
+ postMiscDateDiff(args?: any): Promise<any>;
84
85
  }
85
86
  declare class NetworkApi {
86
87
  private c;
@@ -132,10 +133,13 @@ declare class TextApi {
132
133
  constructor(c: UapiClient);
133
134
  getTextMd5(args?: any): Promise<any>;
134
135
  postTextAesDecrypt(args?: any): Promise<any>;
136
+ postTextAesDecryptAdvanced(args?: any): Promise<any>;
135
137
  postTextAesEncrypt(args?: any): Promise<any>;
138
+ postTextAesEncryptAdvanced(args?: any): Promise<any>;
136
139
  postTextAnalyze(args?: any): Promise<any>;
137
140
  postTextBase64Decode(args?: any): Promise<any>;
138
141
  postTextBase64Encode(args?: any): Promise<any>;
142
+ postTextConvert(args?: any): Promise<any>;
139
143
  postTextMd5(args?: any): Promise<any>;
140
144
  postTextMd5Verify(args?: any): Promise<any>;
141
145
  }