aws-delivlib 15.0.16 → 15.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/lib/publishing/github/node_modules/.yarn-integrity +2 -2
  2. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/README.md +1 -1
  3. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert.d.ts +5 -5
  4. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/async_hooks.d.ts +26 -6
  5. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.d.ts +1 -2
  6. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/child_process.d.ts +2 -2
  7. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/cluster.d.ts +15 -15
  8. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/console.d.ts +17 -17
  9. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts +35 -28
  10. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dgram.d.ts +1 -1
  11. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
  12. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns.d.ts +16 -16
  13. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/domain.d.ts +1 -1
  14. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/events.d.ts +1 -2
  15. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs/promises.d.ts +16 -9
  16. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs.d.ts +28 -19
  17. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.d.ts +7 -6
  18. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.typedarray.d.ts +1 -0
  19. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http.d.ts +2 -2
  20. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http2.d.ts +6 -3
  21. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/https.d.ts +1 -1
  22. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/index.d.ts +7 -5
  23. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.d.ts +3 -7
  24. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/module.d.ts +63 -29
  25. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts +2 -5
  26. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/os.d.ts +8 -7
  27. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/package.json +13 -3
  28. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path.d.ts +1 -1
  29. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/perf_hooks.d.ts +8 -8
  30. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/process.d.ts +21 -11
  31. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/punycode.d.ts +1 -1
  32. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/querystring.d.ts +1 -1
  33. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline/promises.d.ts +0 -1
  34. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline.d.ts +13 -13
  35. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/repl.d.ts +14 -16
  36. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sea.d.ts +1 -1
  37. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sqlite.d.ts +182 -2
  38. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream.d.ts +8 -19
  39. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/string_decoder.d.ts +1 -1
  40. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test.d.ts +53 -15
  41. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers/promises.d.ts +1 -1
  42. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers.d.ts +1 -1
  43. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tls.d.ts +2 -48
  44. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/trace_events.d.ts +6 -6
  45. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/{compatibility → ts5.1/compatibility}/disposable.d.ts +0 -4
  46. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.1/index.d.ts +98 -0
  47. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  48. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +1 -0
  49. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/index.d.ts +9 -5
  50. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  51. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/index.d.ts +96 -0
  52. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tty.d.ts +1 -1
  53. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/url.d.ts +52 -19
  54. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util.d.ts +16 -295
  55. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/v8.d.ts +29 -32
  56. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vm.d.ts +17 -10
  57. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/wasi.d.ts +1 -1
  58. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/worker_threads.d.ts +34 -18
  59. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib.d.ts +5 -7
  60. package/lib/publishing/github/node_modules/undici-types/agent.d.ts +7 -7
  61. package/lib/publishing/github/node_modules/undici-types/api.d.ts +24 -24
  62. package/lib/publishing/github/node_modules/undici-types/balanced-pool.d.ts +11 -11
  63. package/lib/publishing/github/node_modules/undici-types/cache-interceptor.d.ts +172 -0
  64. package/lib/publishing/github/node_modules/undici-types/client.d.ts +12 -13
  65. package/lib/publishing/github/node_modules/undici-types/cookies.d.ts +2 -0
  66. package/lib/publishing/github/node_modules/undici-types/diagnostics-channel.d.ts +10 -10
  67. package/lib/publishing/github/node_modules/undici-types/dispatcher.d.ts +117 -92
  68. package/lib/publishing/github/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -2
  69. package/lib/publishing/github/node_modules/undici-types/errors.d.ts +69 -47
  70. package/lib/publishing/github/node_modules/undici-types/fetch.d.ts +17 -16
  71. package/lib/publishing/github/node_modules/undici-types/formdata.d.ts +7 -7
  72. package/lib/publishing/github/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  73. package/lib/publishing/github/node_modules/undici-types/global-origin.d.ts +5 -5
  74. package/lib/publishing/github/node_modules/undici-types/h2c-client.d.ts +75 -0
  75. package/lib/publishing/github/node_modules/undici-types/handlers.d.ts +7 -7
  76. package/lib/publishing/github/node_modules/undici-types/header.d.ts +157 -1
  77. package/lib/publishing/github/node_modules/undici-types/index.d.ts +51 -47
  78. package/lib/publishing/github/node_modules/undici-types/interceptors.d.ts +25 -8
  79. package/lib/publishing/github/node_modules/undici-types/mock-agent.d.ts +33 -18
  80. package/lib/publishing/github/node_modules/undici-types/mock-call-history.d.ts +111 -0
  81. package/lib/publishing/github/node_modules/undici-types/mock-client.d.ts +4 -4
  82. package/lib/publishing/github/node_modules/undici-types/mock-errors.d.ts +3 -3
  83. package/lib/publishing/github/node_modules/undici-types/mock-interceptor.d.ts +19 -19
  84. package/lib/publishing/github/node_modules/undici-types/mock-pool.d.ts +4 -4
  85. package/lib/publishing/github/node_modules/undici-types/package.json +1 -1
  86. package/lib/publishing/github/node_modules/undici-types/patch.d.ts +0 -4
  87. package/lib/publishing/github/node_modules/undici-types/pool-stats.d.ts +8 -8
  88. package/lib/publishing/github/node_modules/undici-types/pool.d.ts +12 -12
  89. package/lib/publishing/github/node_modules/undici-types/proxy-agent.d.ts +4 -4
  90. package/lib/publishing/github/node_modules/undici-types/readable.d.ts +18 -15
  91. package/lib/publishing/github/node_modules/undici-types/retry-agent.d.ts +1 -1
  92. package/lib/publishing/github/node_modules/undici-types/retry-handler.d.ts +10 -10
  93. package/lib/publishing/github/node_modules/undici-types/util.d.ts +3 -3
  94. package/lib/publishing/github/node_modules/undici-types/utility.d.ts +7 -0
  95. package/lib/publishing/github/node_modules/undici-types/webidl.d.ts +44 -6
  96. package/lib/publishing/github/node_modules/undici-types/websocket.d.ts +35 -1
  97. package/package.json +2 -2
  98. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/index.d.ts +0 -9
  99. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  100. package/lib/publishing/github/node_modules/undici-types/file.d.ts +0 -39
  101. package/lib/publishing/github/node_modules/undici-types/filereader.d.ts +0 -54
@@ -1,24 +1,24 @@
1
- import { IncomingHttpHeaders } from "./header";
1
+ import { IncomingHttpHeaders } from './header'
2
2
  import Client from './client'
3
3
 
4
4
  export default Errors
5
5
 
6
6
  declare namespace Errors {
7
7
  export class UndiciError extends Error {
8
- name: string;
9
- code: string;
8
+ name: string
9
+ code: string
10
10
  }
11
11
 
12
12
  /** Connect timeout error. */
13
13
  export class ConnectTimeoutError extends UndiciError {
14
- name: 'ConnectTimeoutError';
15
- code: 'UND_ERR_CONNECT_TIMEOUT';
14
+ name: 'ConnectTimeoutError'
15
+ code: 'UND_ERR_CONNECT_TIMEOUT'
16
16
  }
17
17
 
18
18
  /** A header exceeds the `headersTimeout` option. */
19
19
  export class HeadersTimeoutError extends UndiciError {
20
- name: 'HeadersTimeoutError';
21
- code: 'UND_ERR_HEADERS_TIMEOUT';
20
+ name: 'HeadersTimeoutError'
21
+ code: 'UND_ERR_HEADERS_TIMEOUT'
22
22
  }
23
23
 
24
24
  /** Headers overflow error. */
@@ -29,8 +29,24 @@ declare namespace Errors {
29
29
 
30
30
  /** A body exceeds the `bodyTimeout` option. */
31
31
  export class BodyTimeoutError extends UndiciError {
32
- name: 'BodyTimeoutError';
33
- code: 'UND_ERR_BODY_TIMEOUT';
32
+ name: 'BodyTimeoutError'
33
+ code: 'UND_ERR_BODY_TIMEOUT'
34
+ }
35
+
36
+ export class ResponseError extends UndiciError {
37
+ constructor (
38
+ message: string,
39
+ code: number,
40
+ options: {
41
+ headers?: IncomingHttpHeaders | string[] | null,
42
+ body?: null | Record<string, any> | string
43
+ }
44
+ )
45
+ name: 'ResponseError'
46
+ code: 'UND_ERR_RESPONSE'
47
+ statusCode: number
48
+ body: null | Record<string, any> | string
49
+ headers: IncomingHttpHeaders | string[] | null
34
50
  }
35
51
 
36
52
  export class ResponseStatusCodeError extends UndiciError {
@@ -39,91 +55,91 @@ declare namespace Errors {
39
55
  statusCode?: number,
40
56
  headers?: IncomingHttpHeaders | string[] | null,
41
57
  body?: null | Record<string, any> | string
42
- );
43
- name: 'ResponseStatusCodeError';
44
- code: 'UND_ERR_RESPONSE_STATUS_CODE';
58
+ )
59
+ name: 'ResponseStatusCodeError'
60
+ code: 'UND_ERR_RESPONSE_STATUS_CODE'
45
61
  body: null | Record<string, any> | string
46
62
  status: number
47
63
  statusCode: number
48
- headers: IncomingHttpHeaders | string[] | null;
64
+ headers: IncomingHttpHeaders | string[] | null
49
65
  }
50
66
 
51
67
  /** Passed an invalid argument. */
52
68
  export class InvalidArgumentError extends UndiciError {
53
- name: 'InvalidArgumentError';
54
- code: 'UND_ERR_INVALID_ARG';
69
+ name: 'InvalidArgumentError'
70
+ code: 'UND_ERR_INVALID_ARG'
55
71
  }
56
72
 
57
73
  /** Returned an invalid value. */
58
74
  export class InvalidReturnValueError extends UndiciError {
59
- name: 'InvalidReturnValueError';
60
- code: 'UND_ERR_INVALID_RETURN_VALUE';
75
+ name: 'InvalidReturnValueError'
76
+ code: 'UND_ERR_INVALID_RETURN_VALUE'
61
77
  }
62
78
 
63
79
  /** The request has been aborted by the user. */
64
80
  export class RequestAbortedError extends UndiciError {
65
- name: 'AbortError';
66
- code: 'UND_ERR_ABORTED';
81
+ name: 'AbortError'
82
+ code: 'UND_ERR_ABORTED'
67
83
  }
68
84
 
69
85
  /** Expected error with reason. */
70
86
  export class InformationalError extends UndiciError {
71
- name: 'InformationalError';
72
- code: 'UND_ERR_INFO';
87
+ name: 'InformationalError'
88
+ code: 'UND_ERR_INFO'
73
89
  }
74
90
 
75
91
  /** Request body length does not match content-length header. */
76
92
  export class RequestContentLengthMismatchError extends UndiciError {
77
- name: 'RequestContentLengthMismatchError';
78
- code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
93
+ name: 'RequestContentLengthMismatchError'
94
+ code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
79
95
  }
80
96
 
81
97
  /** Response body length does not match content-length header. */
82
98
  export class ResponseContentLengthMismatchError extends UndiciError {
83
- name: 'ResponseContentLengthMismatchError';
84
- code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
99
+ name: 'ResponseContentLengthMismatchError'
100
+ code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
85
101
  }
86
102
 
87
103
  /** Trying to use a destroyed client. */
88
104
  export class ClientDestroyedError extends UndiciError {
89
- name: 'ClientDestroyedError';
90
- code: 'UND_ERR_DESTROYED';
105
+ name: 'ClientDestroyedError'
106
+ code: 'UND_ERR_DESTROYED'
91
107
  }
92
108
 
93
109
  /** Trying to use a closed client. */
94
110
  export class ClientClosedError extends UndiciError {
95
- name: 'ClientClosedError';
96
- code: 'UND_ERR_CLOSED';
111
+ name: 'ClientClosedError'
112
+ code: 'UND_ERR_CLOSED'
97
113
  }
98
114
 
99
115
  /** There is an error with the socket. */
100
116
  export class SocketError extends UndiciError {
101
- name: 'SocketError';
102
- code: 'UND_ERR_SOCKET';
117
+ name: 'SocketError'
118
+ code: 'UND_ERR_SOCKET'
103
119
  socket: Client.SocketInfo | null
104
120
  }
105
121
 
106
122
  /** Encountered unsupported functionality. */
107
123
  export class NotSupportedError extends UndiciError {
108
- name: 'NotSupportedError';
109
- code: 'UND_ERR_NOT_SUPPORTED';
124
+ name: 'NotSupportedError'
125
+ code: 'UND_ERR_NOT_SUPPORTED'
110
126
  }
111
127
 
112
128
  /** No upstream has been added to the BalancedPool. */
113
129
  export class BalancedPoolMissingUpstreamError extends UndiciError {
114
- name: 'MissingUpstreamError';
115
- code: 'UND_ERR_BPL_MISSING_UPSTREAM';
130
+ name: 'MissingUpstreamError'
131
+ code: 'UND_ERR_BPL_MISSING_UPSTREAM'
116
132
  }
117
133
 
118
134
  export class HTTPParserError extends UndiciError {
119
- name: 'HTTPParserError';
120
- code: string;
135
+ name: 'HTTPParserError'
136
+ code: string
121
137
  }
122
138
 
123
139
  /** The response exceed the length allowed. */
124
140
  export class ResponseExceededMaxSizeError extends UndiciError {
125
- name: 'ResponseExceededMaxSizeError';
126
- code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
141
+ name: 'ResponseExceededMaxSizeError'
142
+ code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
127
143
  }
128
144
 
129
145
  export class RequestRetryError extends UndiciError {
@@ -132,18 +148,24 @@ declare namespace Errors {
132
148
  statusCode: number,
133
149
  headers?: IncomingHttpHeaders | string[] | null,
134
150
  body?: null | Record<string, any> | string
135
- );
136
- name: 'RequestRetryError';
137
- code: 'UND_ERR_REQ_RETRY';
138
- statusCode: number;
151
+ )
152
+ name: 'RequestRetryError'
153
+ code: 'UND_ERR_REQ_RETRY'
154
+ statusCode: number
139
155
  data: {
140
156
  count: number;
141
- };
142
- headers: Record<string, string | string[]>;
157
+ }
158
+
159
+ headers: Record<string, string | string[]>
143
160
  }
144
161
 
145
162
  export class SecureProxyConnectionError extends UndiciError {
146
- name: 'SecureProxyConnectionError';
147
- code: 'UND_ERR_PRX_TLS';
163
+ constructor (
164
+ cause?: Error,
165
+ message?: string,
166
+ options?: Record<any, any>
167
+ )
168
+ name: 'SecureProxyConnectionError'
169
+ code: 'UND_ERR_PRX_TLS'
148
170
  }
149
171
  }
@@ -6,7 +6,7 @@ import { Blob } from 'buffer'
6
6
  import { URL, URLSearchParams } from 'url'
7
7
  import { ReadableStream } from 'stream/web'
8
8
  import { FormData } from './formdata'
9
-
9
+ import { HeaderRecord } from './header'
10
10
  import Dispatcher from './dispatcher'
11
11
 
12
12
  export type RequestInfo = string | URL | Request
@@ -36,17 +36,17 @@ export class BodyMixin {
36
36
  /**
37
37
  * @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments.
38
38
  * It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows:
39
- *
39
+ *
40
40
  * @example
41
41
  * ```js
42
42
  * import { Busboy } from '@fastify/busboy'
43
43
  * import { Readable } from 'node:stream'
44
- *
44
+ *
45
45
  * const response = await fetch('...')
46
46
  * const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
47
- *
47
+ *
48
48
  * // handle events emitted from `busboy`
49
- *
49
+ *
50
50
  * Readable.fromWeb(response.body).pipe(busboy)
51
51
  * ```
52
52
  */
@@ -67,7 +67,7 @@ export interface SpecIterable<T> {
67
67
  [Symbol.iterator](): SpecIterator<T>;
68
68
  }
69
69
 
70
- export type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
70
+ export type HeadersInit = [string, string][] | HeaderRecord | Headers
71
71
 
72
72
  export declare class Headers implements SpecIterable<[string, string]> {
73
73
  constructor (init?: HeadersInit)
@@ -119,20 +119,21 @@ type RequestDestination =
119
119
  | 'xslt'
120
120
 
121
121
  export interface RequestInit {
122
- method?: string
123
- keepalive?: boolean
124
- headers?: HeadersInit
125
122
  body?: BodyInit | null
126
- redirect?: RequestRedirect
127
- integrity?: string
128
- signal?: AbortSignal | null
123
+ cache?: RequestCache
129
124
  credentials?: RequestCredentials
125
+ dispatcher?: Dispatcher
126
+ duplex?: RequestDuplex
127
+ headers?: HeadersInit
128
+ integrity?: string
129
+ keepalive?: boolean
130
+ method?: string
130
131
  mode?: RequestMode
132
+ redirect?: RequestRedirect
131
133
  referrer?: string
132
134
  referrerPolicy?: ReferrerPolicy
135
+ signal?: AbortSignal | null
133
136
  window?: null
134
- dispatcher?: Dispatcher
135
- duplex?: RequestDuplex
136
137
  }
137
138
 
138
139
  export type ReferrerPolicy =
@@ -144,7 +145,7 @@ export type ReferrerPolicy =
144
145
  | 'same-origin'
145
146
  | 'strict-origin'
146
147
  | 'strict-origin-when-cross-origin'
147
- | 'unsafe-url';
148
+ | 'unsafe-url'
148
149
 
149
150
  export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
150
151
 
@@ -204,6 +205,6 @@ export declare class Response extends BodyMixin {
204
205
  readonly clone: () => Response
205
206
 
206
207
  static error (): Response
207
- static json(data: any, init?: ResponseInit): Response
208
+ static json (data: any, init?: ResponseInit): Response
208
209
  static redirect (url: string | URL, status: ResponseRedirectStatus): Response
209
210
  }
@@ -1,7 +1,7 @@
1
1
  // Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT)
2
2
  /// <reference types="node" />
3
3
 
4
- import { File } from './file'
4
+ import { File } from 'buffer'
5
5
  import { SpecIterableIterator } from './fetch'
6
6
 
7
7
  /**
@@ -24,7 +24,7 @@ export declare class FormData {
24
24
  or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
25
25
  * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
26
26
  */
27
- append(name: string, value: unknown, fileName?: string): void
27
+ append (name: string, value: unknown, fileName?: string): void
28
28
 
29
29
  /**
30
30
  * Set a new value for an existing key inside FormData,
@@ -36,7 +36,7 @@ export declare class FormData {
36
36
  * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
37
37
  *
38
38
  */
39
- set(name: string, value: unknown, fileName?: string): void
39
+ set (name: string, value: unknown, fileName?: string): void
40
40
 
41
41
  /**
42
42
  * Returns the first value associated with a given key from within a `FormData` object.
@@ -46,7 +46,7 @@ export declare class FormData {
46
46
  *
47
47
  * @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
48
48
  */
49
- get(name: string): FormDataEntryValue | null
49
+ get (name: string): FormDataEntryValue | null
50
50
 
51
51
  /**
52
52
  * Returns all the values associated with a given key from within a `FormData` object.
@@ -55,7 +55,7 @@ export declare class FormData {
55
55
  *
56
56
  * @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
57
57
  */
58
- getAll(name: string): FormDataEntryValue[]
58
+ getAll (name: string): FormDataEntryValue[]
59
59
 
60
60
  /**
61
61
  * Returns a boolean stating whether a `FormData` object contains a certain key.
@@ -64,14 +64,14 @@ export declare class FormData {
64
64
  *
65
65
  * @return A boolean value.
66
66
  */
67
- has(name: string): boolean
67
+ has (name: string): boolean
68
68
 
69
69
  /**
70
70
  * Deletes a key and its value(s) from a `FormData` object.
71
71
  *
72
72
  * @param name The name of the key you want to delete.
73
73
  */
74
- delete(name: string): void
74
+ delete (name: string): void
75
75
 
76
76
  /**
77
77
  * Executes given callback function for each field of the FormData instance
@@ -1,9 +1,9 @@
1
- import Dispatcher from "./dispatcher";
1
+ import Dispatcher from './dispatcher'
2
+
3
+ declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher> (dispatcher: DispatcherImplementation): void
4
+ declare function getGlobalDispatcher (): Dispatcher
2
5
 
3
6
  export {
4
7
  getGlobalDispatcher,
5
8
  setGlobalDispatcher
6
9
  }
7
-
8
- declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
9
- declare function getGlobalDispatcher(): Dispatcher;
@@ -1,7 +1,7 @@
1
+ declare function setGlobalOrigin (origin: string | URL | undefined): void
2
+ declare function getGlobalOrigin (): URL | undefined
3
+
1
4
  export {
2
- setGlobalOrigin,
3
- getGlobalOrigin
5
+ setGlobalOrigin,
6
+ getGlobalOrigin
4
7
  }
5
-
6
- declare function setGlobalOrigin(origin: string | URL | undefined): void;
7
- declare function getGlobalOrigin(): URL | undefined;
@@ -0,0 +1,75 @@
1
+ import { URL } from 'url'
2
+ import Dispatcher from './dispatcher'
3
+ import buildConnector from './connector'
4
+
5
+ type H2ClientOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
6
+
7
+ /**
8
+ * A basic H2C client, mapped on top a single TCP connection. Pipelining is disabled by default.
9
+ */
10
+ export class H2CClient extends Dispatcher {
11
+ constructor (url: string | URL, options?: H2CClient.Options)
12
+ /** Property to get and set the pipelining factor. */
13
+ pipelining: number
14
+ /** `true` after `client.close()` has been called. */
15
+ closed: boolean
16
+ /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
17
+ destroyed: boolean
18
+
19
+ // Override dispatcher APIs.
20
+ override connect (
21
+ options: H2ClientOptions
22
+ ): Promise<Dispatcher.ConnectData>
23
+ override connect (
24
+ options: H2ClientOptions,
25
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
+ ): void
27
+ }
28
+
29
+ export declare namespace H2CClient {
30
+ export interface Options {
31
+ /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
32
+ maxHeaderSize?: number;
33
+ /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
34
+ headersTimeout?: number;
35
+ /** TODO */
36
+ connectTimeout?: number;
37
+ /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
38
+ bodyTimeout?: number;
39
+ /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
40
+ keepAliveTimeout?: number;
41
+ /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
42
+ keepAliveMaxTimeout?: number;
43
+ /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
44
+ keepAliveTimeoutThreshold?: number;
45
+ /** TODO */
46
+ socketPath?: string;
47
+ /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
48
+ pipelining?: number;
49
+ /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
50
+ strictContentLength?: boolean;
51
+ /** TODO */
52
+ maxCachedSessions?: number;
53
+ /** TODO */
54
+ maxRedirections?: number;
55
+ /** TODO */
56
+ connect?: Omit<Partial<buildConnector.BuildOptions>, 'allowH2'> | buildConnector.connector;
57
+ /** TODO */
58
+ maxRequestsPerClient?: number;
59
+ /** TODO */
60
+ localAddress?: string;
61
+ /** Max response body size in bytes, -1 is disabled */
62
+ maxResponseSize?: number;
63
+ /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
64
+ autoSelectFamily?: boolean;
65
+ /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
66
+ autoSelectFamilyAttemptTimeout?: number;
67
+ /**
68
+ * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
69
+ * @default 100
70
+ */
71
+ maxConcurrentStreams?: number
72
+ }
73
+ }
74
+
75
+ export default H2CClient
@@ -1,15 +1,15 @@
1
- import Dispatcher from "./dispatcher";
1
+ import Dispatcher from './dispatcher'
2
2
 
3
- export declare class RedirectHandler implements Dispatcher.DispatchHandlers {
4
- constructor(
3
+ export declare class RedirectHandler implements Dispatcher.DispatchHandler {
4
+ constructor (
5
5
  dispatch: Dispatcher,
6
6
  maxRedirections: number,
7
7
  opts: Dispatcher.DispatchOptions,
8
- handler: Dispatcher.DispatchHandlers,
8
+ handler: Dispatcher.DispatchHandler,
9
9
  redirectionLimitReached: boolean
10
- );
10
+ )
11
11
  }
12
12
 
13
- export declare class DecoratorHandler implements Dispatcher.DispatchHandlers {
14
- constructor(handler: Dispatcher.DispatchHandlers);
13
+ export declare class DecoratorHandler implements Dispatcher.DispatchHandler {
14
+ constructor (handler: Dispatcher.DispatchHandler)
15
15
  }
@@ -1,4 +1,160 @@
1
+ import { Autocomplete } from './utility'
2
+
1
3
  /**
2
4
  * The header type declaration of `undici`.
3
5
  */
4
- export type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
6
+ export type IncomingHttpHeaders = Record<string, string | string[] | undefined>
7
+
8
+ type HeaderNames = Autocomplete<
9
+ | 'Accept'
10
+ | 'Accept-CH'
11
+ | 'Accept-Charset'
12
+ | 'Accept-Encoding'
13
+ | 'Accept-Language'
14
+ | 'Accept-Patch'
15
+ | 'Accept-Post'
16
+ | 'Accept-Ranges'
17
+ | 'Access-Control-Allow-Credentials'
18
+ | 'Access-Control-Allow-Headers'
19
+ | 'Access-Control-Allow-Methods'
20
+ | 'Access-Control-Allow-Origin'
21
+ | 'Access-Control-Expose-Headers'
22
+ | 'Access-Control-Max-Age'
23
+ | 'Access-Control-Request-Headers'
24
+ | 'Access-Control-Request-Method'
25
+ | 'Age'
26
+ | 'Allow'
27
+ | 'Alt-Svc'
28
+ | 'Alt-Used'
29
+ | 'Authorization'
30
+ | 'Cache-Control'
31
+ | 'Clear-Site-Data'
32
+ | 'Connection'
33
+ | 'Content-Disposition'
34
+ | 'Content-Encoding'
35
+ | 'Content-Language'
36
+ | 'Content-Length'
37
+ | 'Content-Location'
38
+ | 'Content-Range'
39
+ | 'Content-Security-Policy'
40
+ | 'Content-Security-Policy-Report-Only'
41
+ | 'Content-Type'
42
+ | 'Cookie'
43
+ | 'Cross-Origin-Embedder-Policy'
44
+ | 'Cross-Origin-Opener-Policy'
45
+ | 'Cross-Origin-Resource-Policy'
46
+ | 'Date'
47
+ | 'Device-Memory'
48
+ | 'ETag'
49
+ | 'Expect'
50
+ | 'Expect-CT'
51
+ | 'Expires'
52
+ | 'Forwarded'
53
+ | 'From'
54
+ | 'Host'
55
+ | 'If-Match'
56
+ | 'If-Modified-Since'
57
+ | 'If-None-Match'
58
+ | 'If-Range'
59
+ | 'If-Unmodified-Since'
60
+ | 'Keep-Alive'
61
+ | 'Last-Modified'
62
+ | 'Link'
63
+ | 'Location'
64
+ | 'Max-Forwards'
65
+ | 'Origin'
66
+ | 'Permissions-Policy'
67
+ | 'Priority'
68
+ | 'Proxy-Authenticate'
69
+ | 'Proxy-Authorization'
70
+ | 'Range'
71
+ | 'Referer'
72
+ | 'Referrer-Policy'
73
+ | 'Retry-After'
74
+ | 'Sec-Fetch-Dest'
75
+ | 'Sec-Fetch-Mode'
76
+ | 'Sec-Fetch-Site'
77
+ | 'Sec-Fetch-User'
78
+ | 'Sec-Purpose'
79
+ | 'Sec-WebSocket-Accept'
80
+ | 'Server'
81
+ | 'Server-Timing'
82
+ | 'Service-Worker-Navigation-Preload'
83
+ | 'Set-Cookie'
84
+ | 'SourceMap'
85
+ | 'Strict-Transport-Security'
86
+ | 'TE'
87
+ | 'Timing-Allow-Origin'
88
+ | 'Trailer'
89
+ | 'Transfer-Encoding'
90
+ | 'Upgrade'
91
+ | 'Upgrade-Insecure-Requests'
92
+ | 'User-Agent'
93
+ | 'Vary'
94
+ | 'Via'
95
+ | 'WWW-Authenticate'
96
+ | 'X-Content-Type-Options'
97
+ | 'X-Frame-Options'
98
+ >
99
+
100
+ type IANARegisteredMimeType = Autocomplete<
101
+ | 'audio/aac'
102
+ | 'video/x-msvideo'
103
+ | 'image/avif'
104
+ | 'video/av1'
105
+ | 'application/octet-stream'
106
+ | 'image/bmp'
107
+ | 'text/css'
108
+ | 'text/csv'
109
+ | 'application/vnd.ms-fontobject'
110
+ | 'application/epub+zip'
111
+ | 'image/gif'
112
+ | 'application/gzip'
113
+ | 'text/html'
114
+ | 'image/x-icon'
115
+ | 'text/calendar'
116
+ | 'image/jpeg'
117
+ | 'text/javascript'
118
+ | 'application/json'
119
+ | 'application/ld+json'
120
+ | 'audio/x-midi'
121
+ | 'audio/mpeg'
122
+ | 'video/mp4'
123
+ | 'video/mpeg'
124
+ | 'audio/ogg'
125
+ | 'video/ogg'
126
+ | 'application/ogg'
127
+ | 'audio/opus'
128
+ | 'font/otf'
129
+ | 'application/pdf'
130
+ | 'image/png'
131
+ | 'application/rtf'
132
+ | 'image/svg+xml'
133
+ | 'image/tiff'
134
+ | 'video/mp2t'
135
+ | 'font/ttf'
136
+ | 'text/plain'
137
+ | 'application/wasm'
138
+ | 'video/webm'
139
+ | 'audio/webm'
140
+ | 'image/webp'
141
+ | 'font/woff'
142
+ | 'font/woff2'
143
+ | 'application/xhtml+xml'
144
+ | 'application/xml'
145
+ | 'application/zip'
146
+ | 'video/3gpp'
147
+ | 'video/3gpp2'
148
+ | 'model/gltf+json'
149
+ | 'model/gltf-binary'
150
+ >
151
+
152
+ type KnownHeaderValues = {
153
+ 'content-type': IANARegisteredMimeType
154
+ }
155
+
156
+ export type HeaderRecord = {
157
+ [K in HeaderNames | Lowercase<HeaderNames>]?: Lowercase<K> extends keyof KnownHeaderValues
158
+ ? KnownHeaderValues[Lowercase<K>]
159
+ : string
160
+ }