UNPKG

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