Fixed transport.request querystring type (#1240)

This commit is contained in:
Tomas Della Vedova
2020-07-01 10:38:55 +02:00
committed by GitHub
parent 71a74be321
commit aa7d7b02ad
2 changed files with 11 additions and 1 deletions

2
lib/Transport.d.ts vendored
View File

@ -80,7 +80,7 @@ export interface TransportRequestParams {
path: string;
body?: RequestBody;
bulkBody?: RequestNDBody;
querystring?: Record<string, any>;
querystring?: Record<string, any> | string;
}
export interface TransportRequestOptions {

View File

@ -102,6 +102,16 @@ expectType<Transport>(transport)
expectType<TransportRequestCallback>(transport.request(params, options, (err, result) => {}))
// querystring as string
transport.request({
method: 'GET',
path: '/search',
querystring: 'baz=faz'
}, options, (err, result) => {
expectType<ApiError>(err)
expectType<ApiResponse>(result)
})
// body as object
transport.request(params, options, (err, result) => {
expectType<ApiError>(err)