UNPKG

1.01 kBTypeScriptView Raw
1import type { Options } from 'got';
2export interface GetGotOptions extends Options {
3 /**
4 * @default false
5 */
6 logStart?: boolean;
7 /**
8 * Log when request is finished.
9 *
10 * @default false
11 */
12 logFinished?: boolean;
13 /**
14 * Log actual response object.
15 *
16 * @default false
17 */
18 logResponse?: boolean;
19 /**
20 * @default true
21 * Set to false to exclude `prefixUrl` from logs (both success and error)
22 */
23 logWithPrefixUrl?: boolean;
24 /**
25 * @default true
26 * Set to false to strip searchParams from url when logging (both success and error)
27 */
28 logWithSearchParams?: boolean;
29 /**
30 * Max length of response object before it's truncated.
31 *
32 * @default 10_000
33 */
34 maxResponseLength?: number;
35}
36export interface GotRequestContext extends Record<string, any> {
37 /**
38 * Millisecond-timestamp of when the request was started. To be able to count "time spent".
39 */
40 started: number;
41}