@node-red/editor-client 3.0.2 → 3.1.0-beta.2
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.
- package/locales/de/editor.json +2 -0
- package/locales/de/infotips.json +0 -0
- package/locales/de/jsonata.json +0 -0
- package/locales/en-US/editor.json +37 -6
- package/locales/en-US/infotips.json +0 -0
- package/locales/en-US/jsonata.json +0 -0
- package/locales/fr/editor.json +1238 -0
- package/locales/fr/infotips.json +23 -0
- package/locales/fr/jsonata.json +274 -0
- package/locales/ja/editor.json +48 -9
- package/locales/ko/editor.json +233 -31
- package/locales/ko/infotips.json +0 -0
- package/locales/ko/jsonata.json +0 -0
- package/locales/pt-BR/editor.json +1208 -0
- package/locales/pt-BR/infotips.json +23 -0
- package/locales/pt-BR/jsonata.json +274 -0
- package/locales/ru/editor.json +2 -0
- package/locales/ru/infotips.json +0 -0
- package/locales/ru/jsonata.json +0 -0
- package/locales/zh-CN/editor.json +1175 -1049
- package/locales/zh-TW/editor.json +3 -0
- package/package.json +1 -1
- package/public/red/about +140 -0
- package/public/red/red.js +2699 -1397
- package/public/red/red.min.js +4 -3
- package/public/red/style.min.css +1 -1
- package/public/red/tours/3.0/images/context-menu.png +0 -0
- package/public/red/tours/3.0/welcome.js +155 -0
- package/public/red/tours/images/context-menu.png +0 -0
- package/public/red/tours/images/global-env-vars.png +0 -0
- package/public/red/tours/images/hiding-flows.png +0 -0
- package/public/red/tours/images/locking-flows.png +0 -0
- package/public/red/tours/images/mermaid.png +0 -0
- package/public/red/tours/images/node-help.png +0 -0
- package/public/red/tours/images/tab-changes.png +0 -0
- package/public/red/tours/welcome.js +111 -94
- package/public/types/node/assert/strict.d.ts +11 -0
- package/public/types/node/assert.d.ts +898 -64
- package/public/types/node/async_hooks.d.ts +362 -94
- package/public/types/node/buffer.d.ts +2158 -14
- package/public/types/node/child_process.d.ts +1109 -257
- package/public/types/node/cluster.d.ts +349 -200
- package/public/types/node/console.d.ts +313 -43
- package/public/types/node/crypto.d.ts +3329 -656
- package/public/types/node/dgram.d.ts +459 -58
- package/public/types/node/diagnostics_channel.d.ts +155 -0
- package/public/types/node/dns/promises.d.ts +371 -0
- package/public/types/node/dns.d.ts +532 -265
- package/public/types/node/domain.d.ts +159 -16
- package/public/types/node/events.d.ts +589 -30
- package/public/types/node/fs/promises.d.ts +1097 -0
- package/public/types/node/fs.d.ts +2484 -958
- package/public/types/node/globals.d.ts +43 -503
- package/public/types/node/http.d.ts +1156 -145
- package/public/types/node/http2.d.ts +1610 -470
- package/public/types/node/https.d.ts +462 -72
- package/public/types/node/module.d.ts +72 -13
- package/public/types/node/net.d.ts +663 -131
- package/public/types/node/os.d.ts +238 -25
- package/public/types/node/path.d.ts +57 -23
- package/public/types/node/perf_hooks.d.ts +424 -112
- package/public/types/node/process.d.ts +1261 -193
- package/public/types/node/querystring.d.ts +107 -7
- package/public/types/node/readline.d.ts +443 -74
- package/public/types/node/stream/consumers.d.ts +15 -0
- package/public/types/node/stream/promises.d.ts +45 -0
- package/public/types/node/stream/web.d.ts +395 -0
- package/public/types/node/stream.d.ts +1081 -177
- package/public/types/node/string_decoder.d.ts +57 -0
- package/public/types/node/test.d.ts +193 -0
- package/public/types/node/timers/promises.d.ts +96 -0
- package/public/types/node/timers.d.ts +87 -12
- package/public/types/node/tls.d.ts +457 -222
- package/public/types/node/trace_events.d.ts +107 -10
- package/public/types/node/tty.d.ts +158 -23
- package/public/types/node/url.d.ts +734 -28
- package/public/types/node/util.d.ts +1542 -164
- package/public/types/node/v8.d.ts +261 -73
- package/public/types/node/vm.d.ts +384 -32
- package/public/types/node/wasi.d.ts +92 -23
- package/public/types/node/worker_threads.d.ts +531 -123
- package/public/types/node/zlib.d.ts +216 -63
- package/public/types/node-red/func.d.ts +3 -0
- package/public/vendor/jquery/css/base/images/ui-icons_444444_256x240.png +0 -0
- package/public/vendor/jquery/css/base/images/ui-icons_555555_256x240.png +0 -0
- package/public/vendor/jquery/css/base/images/ui-icons_777620_256x240.png +0 -0
- package/public/vendor/jquery/css/base/images/ui-icons_777777_256x240.png +0 -0
- package/public/vendor/jquery/css/base/images/ui-icons_cc0000_256x240.png +0 -0
- package/public/vendor/jquery/css/base/images/ui-icons_ffffff_256x240.png +0 -0
- package/public/vendor/jquery/css/base/jquery-ui.min.css +4 -4
- package/public/vendor/mermaid/mermaid.min.js +1284 -0
- package/public/vendor/monaco/dist/{ade705761eb7e702770d.ttf → 7064e66c3890a12c47b4.ttf} +0 -0
- package/public/vendor/monaco/dist/css.worker.js +1 -1
- package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
- package/public/vendor/monaco/dist/editor.js +1 -1
- package/public/vendor/monaco/dist/editor.js.LICENSE.txt +5 -1
- package/public/vendor/monaco/dist/editor.worker.js +1 -1
- package/public/vendor/monaco/dist/html.worker.js +1 -1
- package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
- package/public/vendor/monaco/dist/json.worker.js +1 -1
- package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
- package/public/vendor/monaco/dist/locale/cs.js +319 -71
- package/public/vendor/monaco/dist/locale/de.js +323 -75
- package/public/vendor/monaco/dist/locale/es.js +318 -70
- package/public/vendor/monaco/dist/locale/fr.js +327 -79
- package/public/vendor/monaco/dist/locale/it.js +325 -77
- package/public/vendor/monaco/dist/locale/ja.js +337 -89
- package/public/vendor/monaco/dist/locale/ko.js +324 -76
- package/public/vendor/monaco/dist/locale/pl.js +322 -74
- package/public/vendor/monaco/dist/locale/pt-br.js +321 -73
- package/public/vendor/monaco/dist/locale/qps-ploc.js +1580 -1332
- package/public/vendor/monaco/dist/locale/ru.js +324 -76
- package/public/vendor/monaco/dist/locale/tr.js +326 -78
- package/public/vendor/monaco/dist/locale/zh-hans.js +328 -80
- package/public/vendor/monaco/dist/locale/zh-hant.js +321 -73
- package/public/vendor/monaco/dist/theme/forge.json +236 -0
- package/public/vendor/monaco/dist/theme/github-dark.json +348 -0
- package/public/vendor/monaco/dist/theme/github-light.json +348 -0
- package/public/vendor/monaco/dist/theme/nord.json +93 -0
- package/public/vendor/monaco/dist/ts.worker.js +1 -1
- package/public/vendor/monaco/dist/ts.worker.js.LICENSE.txt +14 -6
- package/public/vendor/vendor.js +9 -15
- /package/public/red/tours/{images → 3.0/images}/continuous-search.png +0 -0
- /package/public/red/tours/{images → 3.0/images}/debug-path-tooltip.png +0 -0
- /package/public/red/tours/{images → 3.0/images}/junction-quick-add.png +0 -0
- /package/public/red/tours/{images → 3.0/images}/junction-slice.gif +0 -0
- /package/public/red/tours/{images → 3.0/images}/split-wire-with-links.gif +0 -0
|
@@ -1,54 +1,105 @@
|
|
|
1
1
|
|
|
2
2
|
/* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
6
|
+
* separate module.
|
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/https.js)
|
|
8
|
+
*/
|
|
4
9
|
declare module 'https' {
|
|
5
|
-
import { Duplex } from 'stream';
|
|
6
|
-
import * as tls from 'tls';
|
|
7
|
-
import * as http from 'http';
|
|
8
|
-
import { URL } from 'url';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
import { Duplex } from 'node:stream';
|
|
11
|
+
import * as tls from 'node:tls';
|
|
12
|
+
import * as http from 'node:http';
|
|
13
|
+
import { URL } from 'node:url';
|
|
14
|
+
type ServerOptions<
|
|
15
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
16
|
+
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
|
17
|
+
> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
|
|
18
|
+
type RequestOptions = http.RequestOptions &
|
|
19
|
+
tls.SecureContextOptions & {
|
|
20
|
+
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
|
|
21
|
+
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
22
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
23
|
+
};
|
|
17
24
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
18
25
|
rejectUnauthorized?: boolean | undefined;
|
|
19
26
|
maxCachedSessions?: number | undefined;
|
|
20
27
|
}
|
|
21
|
-
|
|
28
|
+
/**
|
|
29
|
+
* An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information.
|
|
30
|
+
* @since v0.4.5
|
|
31
|
+
*/
|
|
22
32
|
class Agent extends http.Agent {
|
|
23
33
|
constructor(options?: AgentOptions);
|
|
24
34
|
options: AgentOptions;
|
|
25
35
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
interface Server<
|
|
37
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
38
|
+
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
|
39
|
+
> extends http.Server<Request, Response> {}
|
|
40
|
+
/**
|
|
41
|
+
* See `http.Server` for more information.
|
|
42
|
+
* @since v0.3.4
|
|
43
|
+
*/
|
|
44
|
+
class Server<
|
|
45
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
46
|
+
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
|
47
|
+
> extends tls.Server {
|
|
48
|
+
constructor(requestListener?: http.RequestListener<Request, Response>);
|
|
49
|
+
constructor(
|
|
50
|
+
options: ServerOptions<Request, Response>,
|
|
51
|
+
requestListener?: http.RequestListener<Request, Response>,
|
|
52
|
+
);
|
|
31
53
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
32
54
|
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
33
|
-
addListener(
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
addListener(
|
|
56
|
+
event: 'newSession',
|
|
57
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
|
58
|
+
): this;
|
|
59
|
+
addListener(
|
|
60
|
+
event: 'OCSPRequest',
|
|
61
|
+
listener: (
|
|
62
|
+
certificate: Buffer,
|
|
63
|
+
issuer: Buffer,
|
|
64
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
65
|
+
) => void,
|
|
66
|
+
): this;
|
|
67
|
+
addListener(
|
|
68
|
+
event: 'resumeSession',
|
|
69
|
+
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
70
|
+
): this;
|
|
36
71
|
addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
37
72
|
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
38
73
|
addListener(event: 'close', listener: () => void): this;
|
|
39
74
|
addListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
|
40
75
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
|
41
76
|
addListener(event: 'listening', listener: () => void): this;
|
|
42
|
-
addListener(event: 'checkContinue', listener: http.RequestListener): this;
|
|
43
|
-
addListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
|
77
|
+
addListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
78
|
+
addListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
44
79
|
addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
45
|
-
addListener(
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
addListener(
|
|
81
|
+
event: 'connect',
|
|
82
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
83
|
+
): this;
|
|
84
|
+
addListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
85
|
+
addListener(
|
|
86
|
+
event: 'upgrade',
|
|
87
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
88
|
+
): this;
|
|
48
89
|
emit(event: string, ...args: any[]): boolean;
|
|
49
90
|
emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
|
|
50
|
-
emit(
|
|
51
|
-
|
|
91
|
+
emit(
|
|
92
|
+
event: 'newSession',
|
|
93
|
+
sessionId: Buffer,
|
|
94
|
+
sessionData: Buffer,
|
|
95
|
+
callback: (err: Error, resp: Buffer) => void,
|
|
96
|
+
): boolean;
|
|
97
|
+
emit(
|
|
98
|
+
event: 'OCSPRequest',
|
|
99
|
+
certificate: Buffer,
|
|
100
|
+
issuer: Buffer,
|
|
101
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
102
|
+
): boolean;
|
|
52
103
|
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
|
53
104
|
emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
|
|
54
105
|
emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
|
|
@@ -56,88 +107,427 @@ declare module 'https' {
|
|
|
56
107
|
emit(event: 'connection', socket: Duplex): boolean;
|
|
57
108
|
emit(event: 'error', err: Error): boolean;
|
|
58
109
|
emit(event: 'listening'): boolean;
|
|
59
|
-
emit(
|
|
60
|
-
|
|
110
|
+
emit(
|
|
111
|
+
event: 'checkContinue',
|
|
112
|
+
req: InstanceType<Request>,
|
|
113
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
114
|
+
): boolean;
|
|
115
|
+
emit(
|
|
116
|
+
event: 'checkExpectation',
|
|
117
|
+
req: InstanceType<Request>,
|
|
118
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
119
|
+
): boolean;
|
|
61
120
|
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
|
|
62
|
-
emit(event: 'connect', req:
|
|
63
|
-
emit(
|
|
64
|
-
|
|
121
|
+
emit(event: 'connect', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
122
|
+
emit(
|
|
123
|
+
event: 'request',
|
|
124
|
+
req: InstanceType<Request>,
|
|
125
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
126
|
+
): boolean;
|
|
127
|
+
emit(event: 'upgrade', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
65
128
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
66
129
|
on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
67
|
-
on(
|
|
68
|
-
|
|
69
|
-
|
|
130
|
+
on(
|
|
131
|
+
event: 'newSession',
|
|
132
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
|
133
|
+
): this;
|
|
134
|
+
on(
|
|
135
|
+
event: 'OCSPRequest',
|
|
136
|
+
listener: (
|
|
137
|
+
certificate: Buffer,
|
|
138
|
+
issuer: Buffer,
|
|
139
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
140
|
+
) => void,
|
|
141
|
+
): this;
|
|
142
|
+
on(
|
|
143
|
+
event: 'resumeSession',
|
|
144
|
+
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
145
|
+
): this;
|
|
70
146
|
on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
71
147
|
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
72
148
|
on(event: 'close', listener: () => void): this;
|
|
73
149
|
on(event: 'connection', listener: (socket: Duplex) => void): this;
|
|
74
150
|
on(event: 'error', listener: (err: Error) => void): this;
|
|
75
151
|
on(event: 'listening', listener: () => void): this;
|
|
76
|
-
on(event: 'checkContinue', listener: http.RequestListener): this;
|
|
77
|
-
on(event: 'checkExpectation', listener: http.RequestListener): this;
|
|
152
|
+
on(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
153
|
+
on(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
78
154
|
on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
79
|
-
on(event: 'connect', listener: (req:
|
|
80
|
-
on(event: 'request', listener: http.RequestListener): this;
|
|
81
|
-
on(event: 'upgrade', listener: (req:
|
|
155
|
+
on(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
156
|
+
on(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
157
|
+
on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
82
158
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
83
159
|
once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
84
|
-
once(
|
|
85
|
-
|
|
86
|
-
|
|
160
|
+
once(
|
|
161
|
+
event: 'newSession',
|
|
162
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
|
163
|
+
): this;
|
|
164
|
+
once(
|
|
165
|
+
event: 'OCSPRequest',
|
|
166
|
+
listener: (
|
|
167
|
+
certificate: Buffer,
|
|
168
|
+
issuer: Buffer,
|
|
169
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
170
|
+
) => void,
|
|
171
|
+
): this;
|
|
172
|
+
once(
|
|
173
|
+
event: 'resumeSession',
|
|
174
|
+
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
175
|
+
): this;
|
|
87
176
|
once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
88
177
|
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
89
178
|
once(event: 'close', listener: () => void): this;
|
|
90
179
|
once(event: 'connection', listener: (socket: Duplex) => void): this;
|
|
91
180
|
once(event: 'error', listener: (err: Error) => void): this;
|
|
92
181
|
once(event: 'listening', listener: () => void): this;
|
|
93
|
-
once(event: 'checkContinue', listener: http.RequestListener): this;
|
|
94
|
-
once(event: 'checkExpectation', listener: http.RequestListener): this;
|
|
182
|
+
once(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
183
|
+
once(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
95
184
|
once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
96
|
-
once(event: 'connect', listener: (req:
|
|
97
|
-
once(event: 'request', listener: http.RequestListener): this;
|
|
98
|
-
once(event: 'upgrade', listener: (req:
|
|
185
|
+
once(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
186
|
+
once(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
187
|
+
once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
99
188
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
100
189
|
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
101
|
-
prependListener(
|
|
102
|
-
|
|
103
|
-
|
|
190
|
+
prependListener(
|
|
191
|
+
event: 'newSession',
|
|
192
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
|
193
|
+
): this;
|
|
194
|
+
prependListener(
|
|
195
|
+
event: 'OCSPRequest',
|
|
196
|
+
listener: (
|
|
197
|
+
certificate: Buffer,
|
|
198
|
+
issuer: Buffer,
|
|
199
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
200
|
+
) => void,
|
|
201
|
+
): this;
|
|
202
|
+
prependListener(
|
|
203
|
+
event: 'resumeSession',
|
|
204
|
+
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
205
|
+
): this;
|
|
104
206
|
prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
105
207
|
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
106
208
|
prependListener(event: 'close', listener: () => void): this;
|
|
107
209
|
prependListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
|
108
210
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
|
109
211
|
prependListener(event: 'listening', listener: () => void): this;
|
|
110
|
-
prependListener(event: 'checkContinue', listener: http.RequestListener): this;
|
|
111
|
-
prependListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
|
212
|
+
prependListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
213
|
+
prependListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
112
214
|
prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
113
|
-
prependListener(
|
|
114
|
-
|
|
115
|
-
|
|
215
|
+
prependListener(
|
|
216
|
+
event: 'connect',
|
|
217
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
218
|
+
): this;
|
|
219
|
+
prependListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
220
|
+
prependListener(
|
|
221
|
+
event: 'upgrade',
|
|
222
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
223
|
+
): this;
|
|
116
224
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
117
225
|
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
118
|
-
prependOnceListener(
|
|
119
|
-
|
|
120
|
-
|
|
226
|
+
prependOnceListener(
|
|
227
|
+
event: 'newSession',
|
|
228
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
|
229
|
+
): this;
|
|
230
|
+
prependOnceListener(
|
|
231
|
+
event: 'OCSPRequest',
|
|
232
|
+
listener: (
|
|
233
|
+
certificate: Buffer,
|
|
234
|
+
issuer: Buffer,
|
|
235
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
236
|
+
) => void,
|
|
237
|
+
): this;
|
|
238
|
+
prependOnceListener(
|
|
239
|
+
event: 'resumeSession',
|
|
240
|
+
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
241
|
+
): this;
|
|
121
242
|
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
122
243
|
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
123
244
|
prependOnceListener(event: 'close', listener: () => void): this;
|
|
124
245
|
prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
|
125
246
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
|
126
247
|
prependOnceListener(event: 'listening', listener: () => void): this;
|
|
127
|
-
prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this;
|
|
128
|
-
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
|
248
|
+
prependOnceListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
249
|
+
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
129
250
|
prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
130
|
-
prependOnceListener(
|
|
131
|
-
|
|
132
|
-
|
|
251
|
+
prependOnceListener(
|
|
252
|
+
event: 'connect',
|
|
253
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
254
|
+
): this;
|
|
255
|
+
prependOnceListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
256
|
+
prependOnceListener(
|
|
257
|
+
event: 'upgrade',
|
|
258
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
259
|
+
): this;
|
|
133
260
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
261
|
+
/**
|
|
262
|
+
* ```js
|
|
263
|
+
* // curl -k https://localhost:8000/
|
|
264
|
+
* const https = require('https');
|
|
265
|
+
* const fs = require('fs');
|
|
266
|
+
*
|
|
267
|
+
* const options = {
|
|
268
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
269
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
|
|
270
|
+
* };
|
|
271
|
+
*
|
|
272
|
+
* https.createServer(options, (req, res) => {
|
|
273
|
+
* res.writeHead(200);
|
|
274
|
+
* res.end('hello world\n');
|
|
275
|
+
* }).listen(8000);
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* Or
|
|
279
|
+
*
|
|
280
|
+
* ```js
|
|
281
|
+
* const https = require('https');
|
|
282
|
+
* const fs = require('fs');
|
|
283
|
+
*
|
|
284
|
+
* const options = {
|
|
285
|
+
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
|
286
|
+
* passphrase: 'sample'
|
|
287
|
+
* };
|
|
288
|
+
*
|
|
289
|
+
* https.createServer(options, (req, res) => {
|
|
290
|
+
* res.writeHead(200);
|
|
291
|
+
* res.end('hello world\n');
|
|
292
|
+
* }).listen(8000);
|
|
293
|
+
* ```
|
|
294
|
+
* @since v0.3.4
|
|
295
|
+
* @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
|
|
296
|
+
* @param requestListener A listener to be added to the `'request'` event.
|
|
297
|
+
*/
|
|
298
|
+
function createServer<
|
|
299
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
300
|
+
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
|
301
|
+
>(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
|
|
302
|
+
function createServer<
|
|
303
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
304
|
+
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
|
305
|
+
>(
|
|
306
|
+
options: ServerOptions<Request, Response>,
|
|
307
|
+
requestListener?: http.RequestListener<Request, Response>,
|
|
308
|
+
): Server<Request, Response>;
|
|
309
|
+
/**
|
|
310
|
+
* Makes a request to a secure web server.
|
|
311
|
+
*
|
|
312
|
+
* The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`,
|
|
313
|
+
* `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`.
|
|
314
|
+
*
|
|
315
|
+
* `options` can be an object, a string, or a `URL` object. If `options` is a
|
|
316
|
+
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
|
317
|
+
*
|
|
318
|
+
* `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to
|
|
319
|
+
* upload a file with a POST request, then write to the `ClientRequest` object.
|
|
320
|
+
*
|
|
321
|
+
* ```js
|
|
322
|
+
* const https = require('https');
|
|
323
|
+
*
|
|
324
|
+
* const options = {
|
|
325
|
+
* hostname: 'encrypted.google.com',
|
|
326
|
+
* port: 443,
|
|
327
|
+
* path: '/',
|
|
328
|
+
* method: 'GET'
|
|
329
|
+
* };
|
|
330
|
+
*
|
|
331
|
+
* const req = https.request(options, (res) => {
|
|
332
|
+
* console.log('statusCode:', res.statusCode);
|
|
333
|
+
* console.log('headers:', res.headers);
|
|
334
|
+
*
|
|
335
|
+
* res.on('data', (d) => {
|
|
336
|
+
* process.stdout.write(d);
|
|
337
|
+
* });
|
|
338
|
+
* });
|
|
339
|
+
*
|
|
340
|
+
* req.on('error', (e) => {
|
|
341
|
+
* console.error(e);
|
|
342
|
+
* });
|
|
343
|
+
* req.end();
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* Example using options from `tls.connect()`:
|
|
347
|
+
*
|
|
348
|
+
* ```js
|
|
349
|
+
* const options = {
|
|
350
|
+
* hostname: 'encrypted.google.com',
|
|
351
|
+
* port: 443,
|
|
352
|
+
* path: '/',
|
|
353
|
+
* method: 'GET',
|
|
354
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
355
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
|
|
356
|
+
* };
|
|
357
|
+
* options.agent = new https.Agent(options);
|
|
358
|
+
*
|
|
359
|
+
* const req = https.request(options, (res) => {
|
|
360
|
+
* // ...
|
|
361
|
+
* });
|
|
362
|
+
* ```
|
|
363
|
+
*
|
|
364
|
+
* Alternatively, opt out of connection pooling by not using an `Agent`.
|
|
365
|
+
*
|
|
366
|
+
* ```js
|
|
367
|
+
* const options = {
|
|
368
|
+
* hostname: 'encrypted.google.com',
|
|
369
|
+
* port: 443,
|
|
370
|
+
* path: '/',
|
|
371
|
+
* method: 'GET',
|
|
372
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
373
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
374
|
+
* agent: false
|
|
375
|
+
* };
|
|
376
|
+
*
|
|
377
|
+
* const req = https.request(options, (res) => {
|
|
378
|
+
* // ...
|
|
379
|
+
* });
|
|
380
|
+
* ```
|
|
381
|
+
*
|
|
382
|
+
* Example using a `URL` as `options`:
|
|
383
|
+
*
|
|
384
|
+
* ```js
|
|
385
|
+
* const options = new URL('https://abc:xyz@example.com');
|
|
386
|
+
*
|
|
387
|
+
* const req = https.request(options, (res) => {
|
|
388
|
+
* // ...
|
|
389
|
+
* });
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
|
393
|
+
*
|
|
394
|
+
* ```js
|
|
395
|
+
* const tls = require('tls');
|
|
396
|
+
* const https = require('https');
|
|
397
|
+
* const crypto = require('crypto');
|
|
398
|
+
*
|
|
399
|
+
* function sha256(s) {
|
|
400
|
+
* return crypto.createHash('sha256').update(s).digest('base64');
|
|
401
|
+
* }
|
|
402
|
+
* const options = {
|
|
403
|
+
* hostname: 'github.com',
|
|
404
|
+
* port: 443,
|
|
405
|
+
* path: '/',
|
|
406
|
+
* method: 'GET',
|
|
407
|
+
* checkServerIdentity: function(host, cert) {
|
|
408
|
+
* // Make sure the certificate is issued to the host we are connected to
|
|
409
|
+
* const err = tls.checkServerIdentity(host, cert);
|
|
410
|
+
* if (err) {
|
|
411
|
+
* return err;
|
|
412
|
+
* }
|
|
413
|
+
*
|
|
414
|
+
* // Pin the public key, similar to HPKP pin-sha25 pinning
|
|
415
|
+
* const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
|
|
416
|
+
* if (sha256(cert.pubkey) !== pubkey256) {
|
|
417
|
+
* const msg = 'Certificate verification error: ' +
|
|
418
|
+
* `The public key of '${cert.subject.CN}' ` +
|
|
419
|
+
* 'does not match our pinned fingerprint';
|
|
420
|
+
* return new Error(msg);
|
|
421
|
+
* }
|
|
422
|
+
*
|
|
423
|
+
* // Pin the exact certificate, rather than the pub key
|
|
424
|
+
* const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +
|
|
425
|
+
* 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';
|
|
426
|
+
* if (cert.fingerprint256 !== cert256) {
|
|
427
|
+
* const msg = 'Certificate verification error: ' +
|
|
428
|
+
* `The certificate of '${cert.subject.CN}' ` +
|
|
429
|
+
* 'does not match our pinned fingerprint';
|
|
430
|
+
* return new Error(msg);
|
|
431
|
+
* }
|
|
432
|
+
*
|
|
433
|
+
* // This loop is informational only.
|
|
434
|
+
* // Print the certificate and public key fingerprints of all certs in the
|
|
435
|
+
* // chain. Its common to pin the public key of the issuer on the public
|
|
436
|
+
* // internet, while pinning the public key of the service in sensitive
|
|
437
|
+
* // environments.
|
|
438
|
+
* do {
|
|
439
|
+
* console.log('Subject Common Name:', cert.subject.CN);
|
|
440
|
+
* console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256);
|
|
441
|
+
*
|
|
442
|
+
* hash = crypto.createHash('sha256');
|
|
443
|
+
* console.log(' Public key ping-sha256:', sha256(cert.pubkey));
|
|
444
|
+
*
|
|
445
|
+
* lastprint256 = cert.fingerprint256;
|
|
446
|
+
* cert = cert.issuerCertificate;
|
|
447
|
+
* } while (cert.fingerprint256 !== lastprint256);
|
|
448
|
+
*
|
|
449
|
+
* },
|
|
450
|
+
* };
|
|
451
|
+
*
|
|
452
|
+
* options.agent = new https.Agent(options);
|
|
453
|
+
* const req = https.request(options, (res) => {
|
|
454
|
+
* console.log('All OK. Server matched our pinned cert or public key');
|
|
455
|
+
* console.log('statusCode:', res.statusCode);
|
|
456
|
+
* // Print the HPKP values
|
|
457
|
+
* console.log('headers:', res.headers['public-key-pins']);
|
|
458
|
+
*
|
|
459
|
+
* res.on('data', (d) => {});
|
|
460
|
+
* });
|
|
461
|
+
*
|
|
462
|
+
* req.on('error', (e) => {
|
|
463
|
+
* console.error(e.message);
|
|
464
|
+
* });
|
|
465
|
+
* req.end();
|
|
466
|
+
* ```
|
|
467
|
+
*
|
|
468
|
+
* Outputs for example:
|
|
469
|
+
*
|
|
470
|
+
* ```text
|
|
471
|
+
* Subject Common Name: github.com
|
|
472
|
+
* Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16
|
|
473
|
+
* Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=
|
|
474
|
+
* Subject Common Name: DigiCert SHA2 Extended Validation Server CA
|
|
475
|
+
* Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A
|
|
476
|
+
* Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=
|
|
477
|
+
* Subject Common Name: DigiCert High Assurance EV Root CA
|
|
478
|
+
* Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF
|
|
479
|
+
* Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=
|
|
480
|
+
* All OK. Server matched our pinned cert or public key
|
|
481
|
+
* statusCode: 200
|
|
482
|
+
* headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=";
|
|
483
|
+
* pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=";
|
|
484
|
+
* pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
|
|
485
|
+
* ```
|
|
486
|
+
* @since v0.3.6
|
|
487
|
+
* @param options Accepts all `options` from `request`, with some differences in default values:
|
|
488
|
+
*/
|
|
489
|
+
function request(
|
|
490
|
+
options: RequestOptions | string | URL,
|
|
491
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
492
|
+
): http.ClientRequest;
|
|
493
|
+
function request(
|
|
494
|
+
url: string | URL,
|
|
495
|
+
options: RequestOptions,
|
|
496
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
497
|
+
): http.ClientRequest;
|
|
498
|
+
/**
|
|
499
|
+
* Like `http.get()` but for HTTPS.
|
|
500
|
+
*
|
|
501
|
+
* `options` can be an object, a string, or a `URL` object. If `options` is a
|
|
502
|
+
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
|
503
|
+
*
|
|
504
|
+
* ```js
|
|
505
|
+
* const https = require('https');
|
|
506
|
+
*
|
|
507
|
+
* https.get('https://encrypted.google.com/', (res) => {
|
|
508
|
+
* console.log('statusCode:', res.statusCode);
|
|
509
|
+
* console.log('headers:', res.headers);
|
|
510
|
+
*
|
|
511
|
+
* res.on('data', (d) => {
|
|
512
|
+
* process.stdout.write(d);
|
|
513
|
+
* });
|
|
514
|
+
*
|
|
515
|
+
* }).on('error', (e) => {
|
|
516
|
+
* console.error(e);
|
|
517
|
+
* });
|
|
518
|
+
* ```
|
|
519
|
+
* @since v0.3.6
|
|
520
|
+
* @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
|
|
521
|
+
*/
|
|
522
|
+
function get(
|
|
523
|
+
options: RequestOptions | string | URL,
|
|
524
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
525
|
+
): http.ClientRequest;
|
|
526
|
+
function get(
|
|
527
|
+
url: string | URL,
|
|
528
|
+
options: RequestOptions,
|
|
529
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
530
|
+
): http.ClientRequest;
|
|
141
531
|
let globalAgent: Agent;
|
|
142
532
|
}
|
|
143
533
|
declare module 'node:https' {
|