[Backport 7.x] Fixed transport.request querystring type (#1241)

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2020-07-01 10:39:34 +02:00
committed by GitHub
parent 91ba1c3b6e
commit bd6f4f256b
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)