
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
tc2-domain-api
Advanced tools
HmacSHA1
and HmacSHA256
加密算法npm:
$ npm install tc2-domain-api
yarn:
$ yarn add tc2-domain-api
const { TCDomainAPI } = require('tc2-domain-api');
const api = new TCDomainAPI({
// options...
});
// use Promise
api.domainList().then(r => console.log);
// use async Function
async function domList() {
try {
const r = await api.domainList();
} catch(e) { }
}
import { TCDomainAPI } from 'tc2-domain-api';
const api = new TCDomainAPI({
// options...
});
api.recordList({
domain: 'example.com'
}).then((result) => {
if (result.data.ok) {
// 正确的类型推论
// Correct type inference
} else {
// 错误的类型定义 需要你来定义
// Wrong type definition, you need to define
}
});
// 定义错误的类型
// Define wrong
interface IWrongType {
// You define types
}
//
api.recordList<IWrongType>({
domain: 'example.com'
}).then((result) => {
if (result.data.ok) {
// 正确的类型推论
// Correct type inference
} else {
// 错误的类型定义 需要你来定义
// Wrong type definition, you need to define
// 正确推论出错误类型
// Correct inference of the type of error
}
});
options:
export interface IConfig {
/**
* 在[云API](https://cloud.tencent.com/login)密钥上申请的标识身份的 SecretId,一个 SecretId 对应唯一的 SecretKey , 而 SecretKey 会用来生成请求签名 Signature。
* 具体可参考 [签名方法](https://cloud.tencent.com/document/api/377/4214) 页面。
*/
SecretId: string;
/**
* 用于签名
*/
SecretKey: string;
/**
* 可选 hash 算法 'HmacSHA1' | 'HmacSHA256'
* 默认 'HmacSHA1'
*/
SignatureMethod?: ShaType;
/**
* 选择传送方式默认 GET 可选 GET | POST
*/
method?: Methods;
/**
* 因为基于axios进行发送请求所以你可以进行一些额外的配置,
* 你的配置将会通过
* ```ts
* Object.assign(defaultConfig[, you config])
* ```
* 进行简单合并所以你的优先级大于defaultConfig
*
* ```ts
* // 默认配置
* {
* baseURL: 'https://cns.api.qcloud.com/v2/index.php',
* timeout: 1000 * 60 * 5, // 默认 五分钟后超时
* headers: {
* post: {
* 'content-type': 'application/x-www-form-urlencoded'
* }
* }
* }
* ```
*/
axiosConfig?: AxiosRequestConfig;
}
MIT
FAQs
腾讯云,云解析API,提供完整的类型定义,完全支持Typescript
The npm package tc2-domain-api receives a total of 0 weekly downloads. As such, tc2-domain-api popularity was classified as not popular.
We found that tc2-domain-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.