腾讯云 云解析API
- 支持 TypeScript
- 完整的类型定义
- 支持 GET and POST
- 支持
HmacSHA1
and HmacSHA256
加密算法 - 使用强大更易使用axios进行数据发送
安装 (Installing)
npm:
$ npm install tc2-domain-api
yarn:
$ yarn add tc2-domain-api
例子 Example
const { TCDomainAPI } = require('tc2-domain-api');
const api = new TCDomainAPI({
});
api.domainList().then(r => console.log);
async function domList() {
try {
const r = await api.domainList();
} catch(e) { }
}
import { TCDomainAPI } from 'tc2-domain-api';
const api = new TCDomainAPI({
});
api.recordList({
domain: 'example.com'
}).then((result) => {
if (result.data.ok) {
} else {
}
});
interface IWrongType {
}
api.recordList<IWrongType>({
domain: 'example.com'
}).then((result) => {
if (result.data.ok) {
} else {
}
});
options:
export interface IConfig {
SecretId: string;
SecretKey: string;
SignatureMethod?: ShaType;
method?: Methods;
axiosConfig?: AxiosRequestConfig;
}
License
MIT