Skip to content

Commit

Permalink
bump to 0.8.12
Browse files Browse the repository at this point in the history
fix #57, thanks to @taoliujun reported
  • Loading branch information
TheNorthMemory committed Mar 9, 2024
1 parent bcff5cb commit 284526a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 变更历史

## v0.8.12 (2024-03-09)
- 修正 `Transformer.toObject` 类型标注错误;
- [动态`uri_template`参数](https://github.com/TheNorthMemory/wechatpay-axios-plugin/issues/57)类型标注,感谢 @taoliujun 报告此问题;

## v0.8.11 (2024-03-01)

- 最后一版支持**node10**环境;
Expand Down
29 changes: 17 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export namespace WechatpayAxiosPlugin {
* @param {string} xml - XML string
* @return {object} - Parsed as object
*/
static toObject(xml: object): string;
static toObject(xml: string): object;
/**
* Validation the response data with the `sign` string.
* @param {object} data - The API response data
Expand Down Expand Up @@ -440,6 +440,11 @@ export namespace WechatpayAxiosPlugin {
[key: string]: string | Buffer
}

/**
* Signature for the extra request config such as the `uri_template` parameter(s).
*/
type ExtraRequestConfig<T> = Omit<T, keyof AxiosRequestConfig>;

/**
* Simple and lite of `multipart/form-data` implementation, most similar to `form-data`.
*
Expand Down Expand Up @@ -809,7 +814,7 @@ export namespace WechatpayAxiosPlugin {
*
* @returns {PromiseLike} - The `AxiosPromise`
*/
request<T = any, R = AxiosResponse<T>>(pathname?: string | undefined, method?: string | undefined, data?: object | any, config?: AxiosRequestConfig): PromiseLike<R>;
request<T = any, R = AxiosResponse<T>, D = any>(pathname?: string | undefined, method?: string | undefined, data?: object | any, config?: ExtraRequestConfig<D> & AxiosRequestConfig): PromiseLike<R>;
}

/**
Expand Down Expand Up @@ -882,7 +887,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
GET<T = any, R = AxiosResponse<T>>(config?: AxiosRequestConfig): Promise<R>;
GET<T = any, R = AxiosResponse<T>>(config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} POST - The alias of the HTTP `POST` request
Expand All @@ -891,7 +896,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
POST<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
POST<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} PUT - The alias of the HTTP 'PUT' request
Expand All @@ -900,7 +905,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
PUT<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
PUT<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} PATCH - The alias of the HTTP 'PATCH' request
Expand All @@ -909,15 +914,15 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
PATCH<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
PATCH<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} DELETE - The alias of the HTTP 'DELETE' request
* @param {any} config - The request configuration
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
DELETE<T = any, R = AxiosResponse<T>>(config?: AxiosRequestConfig): Promise<R>;
DELETE<T = any, R = AxiosResponse<T>>(config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} get - The alias of the HTTP `GET` request
Expand All @@ -926,7 +931,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
get<T = any, R = AxiosResponse<T>>(config?: AxiosRequestConfig): Promise<R>;
get<T = any, R = AxiosResponse<T>>(config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} post - The alias of the HTTP `POST` request
Expand All @@ -935,7 +940,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
post<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
post<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} put - The alias of the HTTP 'PUT' request
Expand All @@ -944,7 +949,7 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
put<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
put<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} patch - The alias of the HTTP 'PATCH' request
Expand All @@ -953,15 +958,15 @@ export namespace WechatpayAxiosPlugin {
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
patch<T = any, R = AxiosResponse<T>>(data?: any, config?: AxiosRequestConfig): Promise<R>;
patch<T = any, R = AxiosResponse<T>>(data?: any, config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

/**
* @property {function} delete - The alias of the HTTP 'DELETE' request
* @param {any} config - The request configuration
* @returns {PromiseLike} - The `AxiosPromise`
*/
// @ts-ignore: FIXEME, needs contributing
delete<T = any, R = AxiosResponse<T>>(config?: AxiosRequestConfig): Promise<R>;
delete<T = any, R = AxiosResponse<T>>(config?: ExtraRequestConfig & AxiosRequestConfig): Promise<R>;

[key: string]: this
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechatpay-axios-plugin",
"version": "0.8.11",
"version": "0.8.12",
"description": "微信支付APIv2及v3 NodeJS SDK,支持CLI模式请求OpenAPI,支持v3证书下载,v2付款码支付、企业付款、退款,企业微信-企业支付-企业红包/向员工付款,v2&v3 Native支付、扫码支付、H5支付、JSAPI/小程序支付、合单支付...",
"main": "index.js",
"typings": "index.d.ts",
Expand Down

0 comments on commit 284526a

Please sign in to comment.