Skip to content

Commit 810bcb1

Browse files
committed
node
1 parent 5f7bf93 commit 810bcb1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/node-api-client/src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export interface APIClientRequestHeaders {
9999
export type APIClientRequestOpts = {
100100
headers?: APIClientRequestHeaders;
101101
timeout?: number;
102+
isFormData?: boolean;
102103
};
103104
export class APIClient {
104105
private hostname: string;
@@ -136,7 +137,7 @@ export class APIClient {
136137
endpoint: string,
137138
query?: { [key: string]: any },
138139
body?: Params,
139-
opts: http.RequestOptions & { timeout?: number; isFormData?: boolean } = {}
140+
opts: APIClientRequestOpts = {}
140141
): Promise<Resp> {
141142
const fullPath = this.buildFullPath(endpoint, query);
142143
const headers: http.OutgoingHttpHeaders = opts.isFormData
@@ -168,7 +169,7 @@ export class APIClient {
168169
endpoint: string,
169170
query?: { [key: string]: any },
170171
body?: Params,
171-
opts: http.RequestOptions & { timeout?: number; isFormData?: boolean } = {}
172+
opts: APIClientRequestOpts = {}
172173
): Promise<Resp> {
173174
const fullPath = this.buildFullPath(endpoint, query);
174175
const headers: http.OutgoingHttpHeaders = opts.isFormData
@@ -200,7 +201,7 @@ export class APIClient {
200201
endpoint: string,
201202
query?: { [key: string]: any },
202203
body?: Params,
203-
opts: http.RequestOptions & { timeout?: number } = {}
204+
opts: APIClientRequestOpts = {}
204205
): Promise<Resp> {
205206
const fullPath = this.buildFullPath(endpoint, query);
206207
const bodyContent = JSON.stringify(body);
@@ -225,7 +226,7 @@ export class APIClient {
225226
endpoint: string,
226227
query?: { [key: string]: any },
227228
body?: void,
228-
opts: http.RequestOptions & { timeout?: number } = {}
229+
opts: APIClientRequestOpts = {}
229230
): Promise<Resp> {
230231
const fullPath = this.buildFullPath(endpoint, query);
231232
return this.request<Resp, void>({

0 commit comments

Comments
 (0)