GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AxT-Team/uapi-sdk-typescript: Official TypeScript / Node.js SDK for UAPI / uapis.cn — strongly typed wrapper around 100+ free public endpoints

BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
internal
internal
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
banner.png
banner.png
 
 
openapitools.json
openapitools.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
prettier.config.js
prettier.config.js
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

uapi-sdk-typescript

Banner

Node.js Docs npm

Note

所有接口的 Node.js (TypeScript) 示例都可以在 UApi 的接口文档页面,向下滚动至 快速启动 区块后直接复制。

快速开始

npm i uapi-sdk-typescript
import { UapiClient } from 'uapi-sdk-typescript'

const client = new UapiClient('https://uapis.cn', 'YOUR_API_KEY')
const result = await (client as any).social.getSocialQqUserinfo({ qq: '10001' })
console.log(result)

特性

现在你不再需要反反复复的查阅文档了。

只需在 IDE 中键入 client.,所有核心模块——如 social、game、image——即刻同步展现。进一步输入即可直接定位到 getSocialQqUserinfo 这样的具体方法,其名称与文档的 operationId 严格保持一致,确保了开发过程的直观与高效。

所有方法签名只接受真实且必需的参数。当你在构建请求时,TypeScript 会即时提示 qq、username 等键名,这彻底杜绝了在对象字面量中因键名拼写错误而导致的运行时错误。

针对 401、404、429 等标准 HTTP 响应,SDK 已将其统一映射为具名的错误类型。这些错误均附带 code、status、details 等关键上下文信息,确保你在日志或 APM 中能第一时间准确、快速地诊断问题。

HTTP 封装基于 Axios,默认 15 秒超时并自动携带 Authorization 头;如果你想接入代理、重试或额外的 Header,只需要在实例化后对 Axios 拦截器做扩展即可。

如果你需要查看字段细节或内部逻辑,仓库中的 ./internal 目录同步保留了由 openapi-generator 生成的完整结构体,随时可供参考。

错误模型概览

HTTP 状态码 SDK 错误类型 附加信息
401/403 UnauthorizedError code、status
404 NotFoundError / NoMatchError code、status
400 InvalidParameterError / InvalidParamsError code、status、details
429 ServiceBusyError code、status、retry_after_seconds
5xx InternalServerErrorError / ApiErrorError code、status、details
其他 4xx UapiError code、status、details

其他 SDK

语言 仓库地址
Go https://github.com/AxT-Team/uapi-sdk-go
Python https://github.com/AxT-Team/uapi-sdk-python
TypeScript(当前) https://github.com/AxT-Team/uapi-sdk-typescript
Browser (TypeScript/JavaScript) https://github.com/AxT-Team/uapi-browser-sdk
Java https://github.com/AxT-Team/uapi-sdk-java
PHP https://github.com/AxT-Team/uapi-sdk-php
C# https://github.com/AxT-Team/uapi-sdk-csharp
C++ https://github.com/AxT-Team/uapi-sdk-cpp
Rust https://github.com/AxT-Team/uapi-sdk-rust

文档

访问 UApi文档首页 并选择任意接口,向下滚动到 快速启动 区块即可看到最新的 TypeScript 示例代码。

About

Official TypeScript / Node.js SDK for UAPI / uapis.cn — strongly typed wrapper around 100+ free public endpoints

uapis.cn/docs/sdk/typescript

Topics

fetchfree-apijavascriptnodejsopenapipublic-apisdktypescriptuapiuapis

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.