cloudstructs 0.9.0 → 0.9.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/.jsii +3 -3
- package/assets/slack-textract/detect.lambda/index.js +5 -6
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/dmarc/index.js +1 -1
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-app/manifest.js +1 -1
- package/lib/slack-app/slack-app.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/ssl-server-test/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +1 -1
- package/lib/toolkit-cleaner/index.js +1 -1
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@slack/logger/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@slack/web-api/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@types/is-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@types/is-stream/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +70 -22
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +106 -62
- package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +2 -6
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +6 -0
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +1 -2
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +15 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +1 -0
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/axios/CHANGELOG.md +19 -0
- package/node_modules/axios/README.md +5 -2
- package/node_modules/axios/dist/axios.js +321 -295
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +3 -3
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +3 -3
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +5 -6
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/lib/adapters/http.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/package.json +25 -25
- package/node_modules/follow-redirects/index.js +1 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/package.json +17 -17
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
|
3
|
-
* that can distribute workloads among their application threads. When process
|
|
4
|
-
*
|
|
5
|
-
* allows running multiple application threads within a single Node.js instance.
|
|
3
|
+
* that can distribute workloads among their application threads. When process isolation
|
|
4
|
+
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html)
|
|
5
|
+
* module instead, which allows running multiple application threads within a single Node.js instance.
|
|
6
6
|
*
|
|
7
7
|
* The cluster module allows easy creation of child processes that all share
|
|
8
8
|
* server ports.
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
52
|
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
|
53
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
|
53
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/cluster.js)
|
|
54
54
|
*/
|
|
55
55
|
declare module "cluster" {
|
|
56
56
|
import * as child from "node:child_process";
|
|
@@ -58,22 +58,74 @@ declare module "cluster" {
|
|
|
58
58
|
import * as net from "node:net";
|
|
59
59
|
type SerializationType = "json" | "advanced";
|
|
60
60
|
export interface ClusterSettings {
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* List of string arguments passed to the Node.js executable.
|
|
63
|
+
* @default process.execArgv
|
|
64
|
+
*/
|
|
65
|
+
execArgv?: string[] | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* File path to worker file.
|
|
68
|
+
* @default process.argv[1]
|
|
69
|
+
*/
|
|
62
70
|
exec?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* String arguments passed to worker.
|
|
73
|
+
* @default process.argv.slice(2)
|
|
74
|
+
*/
|
|
63
75
|
args?: string[] | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Whether or not to send output to parent's stdio.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
64
80
|
silent?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must
|
|
83
|
+
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processspawncommand-args-options)'s
|
|
84
|
+
* [`stdio`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#optionsstdio).
|
|
85
|
+
*/
|
|
65
86
|
stdio?: any[] | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).)
|
|
89
|
+
*/
|
|
66
90
|
uid?: number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).)
|
|
93
|
+
*/
|
|
67
94
|
gid?: number | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number.
|
|
97
|
+
* By default each worker gets its own port, incremented from the primary's `process.debugPort`.
|
|
98
|
+
*/
|
|
68
99
|
inspectPort?: number | (() => number) | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`.
|
|
102
|
+
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#advanced-serialization) for more details.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
69
105
|
serialization?: SerializationType | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Current working directory of the worker process.
|
|
108
|
+
* @default undefined (inherits from parent process)
|
|
109
|
+
*/
|
|
70
110
|
cwd?: string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Hide the forked processes console window that would normally be created on Windows systems.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
71
115
|
windowsHide?: boolean | undefined;
|
|
72
116
|
}
|
|
73
117
|
export interface Address {
|
|
74
118
|
address: string;
|
|
75
119
|
port: number;
|
|
76
|
-
|
|
120
|
+
/**
|
|
121
|
+
* The `addressType` is one of:
|
|
122
|
+
*
|
|
123
|
+
* * `4` (TCPv4)
|
|
124
|
+
* * `6` (TCPv6)
|
|
125
|
+
* * `-1` (Unix domain socket)
|
|
126
|
+
* * `'udp4'` or `'udp6'` (UDPv4 or UDPv6)
|
|
127
|
+
*/
|
|
128
|
+
addressType: 4 | 6 | -1 | "udp4" | "udp6";
|
|
77
129
|
}
|
|
78
130
|
/**
|
|
79
131
|
* A `Worker` object contains all public information and method about a worker.
|
|
@@ -83,17 +135,17 @@ declare module "cluster" {
|
|
|
83
135
|
*/
|
|
84
136
|
export class Worker extends EventEmitter {
|
|
85
137
|
/**
|
|
86
|
-
* Each new worker is given its own unique id, this id is stored in the`id`.
|
|
138
|
+
* Each new worker is given its own unique id, this id is stored in the `id`.
|
|
87
139
|
*
|
|
88
|
-
* While a worker is alive, this is the key that indexes it in`cluster.workers`.
|
|
140
|
+
* While a worker is alive, this is the key that indexes it in `cluster.workers`.
|
|
89
141
|
* @since v0.8.0
|
|
90
142
|
*/
|
|
91
143
|
id: number;
|
|
92
144
|
/**
|
|
93
|
-
* All workers are created using `child_process.fork()
|
|
94
|
-
* from this function is stored as `.process`. In a worker, the global `process`is stored.
|
|
145
|
+
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
|
|
146
|
+
* from this function is stored as `.process`. In a worker, the global `process` is stored.
|
|
95
147
|
*
|
|
96
|
-
* See:
|
|
148
|
+
* See: [Child Process module](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options).
|
|
97
149
|
*
|
|
98
150
|
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
|
|
99
151
|
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
|
|
@@ -104,9 +156,9 @@ declare module "cluster" {
|
|
|
104
156
|
/**
|
|
105
157
|
* Send a message to a worker or primary, optionally with a handle.
|
|
106
158
|
*
|
|
107
|
-
* In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()
|
|
159
|
+
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
|
|
108
160
|
*
|
|
109
|
-
* In a worker, this sends a message to the primary. It is identical to`process.send()`.
|
|
161
|
+
* In a worker, this sends a message to the primary. It is identical to `process.send()`.
|
|
110
162
|
*
|
|
111
163
|
* This example will echo back all messages from the primary:
|
|
112
164
|
*
|
|
@@ -122,7 +174,7 @@ declare module "cluster" {
|
|
|
122
174
|
* }
|
|
123
175
|
* ```
|
|
124
176
|
* @since v0.7.0
|
|
125
|
-
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
|
|
177
|
+
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
|
|
126
178
|
*/
|
|
127
179
|
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
|
128
180
|
send(
|
|
@@ -138,7 +190,7 @@ declare module "cluster" {
|
|
|
138
190
|
): boolean;
|
|
139
191
|
/**
|
|
140
192
|
* This function will kill the worker. In the primary worker, it does this by
|
|
141
|
-
* disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
|
|
193
|
+
* disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`.
|
|
142
194
|
*
|
|
143
195
|
* The `kill()` function kills the worker process without waiting for a graceful
|
|
144
196
|
* disconnect, it has the same behavior as `worker.process.kill()`.
|
|
@@ -146,7 +198,7 @@ declare module "cluster" {
|
|
|
146
198
|
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
|
147
199
|
*
|
|
148
200
|
* In a worker, `process.kill()` exists, but it is not this function;
|
|
149
|
-
* it is `kill()
|
|
201
|
+
* it is [`kill()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processkillpid-signal).
|
|
150
202
|
* @since v0.9.12
|
|
151
203
|
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
|
|
152
204
|
*/
|
|
@@ -156,7 +208,7 @@ declare module "cluster" {
|
|
|
156
208
|
* In a worker, this function will close all servers, wait for the `'close'` event
|
|
157
209
|
* on those servers, and then disconnect the IPC channel.
|
|
158
210
|
*
|
|
159
|
-
* In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
|
|
211
|
+
* In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself.
|
|
160
212
|
*
|
|
161
213
|
* Causes `.exitedAfterDisconnect` to be set.
|
|
162
214
|
*
|
|
@@ -336,20 +388,114 @@ declare module "cluster" {
|
|
|
336
388
|
}
|
|
337
389
|
export interface Cluster extends EventEmitter {
|
|
338
390
|
disconnect(callback?: () => void): void;
|
|
391
|
+
/**
|
|
392
|
+
* Spawn a new worker process.
|
|
393
|
+
*
|
|
394
|
+
* This can only be called from the primary process.
|
|
395
|
+
* @param env Key/value pairs to add to worker process environment.
|
|
396
|
+
* @since v0.6.0
|
|
397
|
+
*/
|
|
339
398
|
fork(env?: any): Worker;
|
|
340
399
|
/** @deprecated since v16.0.0 - use isPrimary. */
|
|
341
400
|
readonly isMaster: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID`
|
|
403
|
+
* is undefined, then `isPrimary` is `true`.
|
|
404
|
+
* @since v16.0.0
|
|
405
|
+
*/
|
|
342
406
|
readonly isPrimary: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* True if the process is not a primary (it is the negation of `cluster.isPrimary`).
|
|
409
|
+
* @since v0.6.0
|
|
410
|
+
*/
|
|
343
411
|
readonly isWorker: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a
|
|
414
|
+
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
|
415
|
+
* is called, whichever comes first.
|
|
416
|
+
*
|
|
417
|
+
* `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute
|
|
418
|
+
* IOCP handles without incurring a large performance hit.
|
|
419
|
+
*
|
|
420
|
+
* `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`.
|
|
421
|
+
* @since v0.11.2
|
|
422
|
+
*/
|
|
344
423
|
schedulingPolicy: number;
|
|
424
|
+
/**
|
|
425
|
+
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
|
426
|
+
* (or [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)) this settings object will contain
|
|
427
|
+
* the settings, including the default values.
|
|
428
|
+
*
|
|
429
|
+
* This object is not intended to be changed or set manually.
|
|
430
|
+
* @since v0.7.1
|
|
431
|
+
*/
|
|
345
432
|
readonly settings: ClusterSettings;
|
|
346
|
-
/** @deprecated since v16.0.0 - use setupPrimary. */
|
|
433
|
+
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) instead. */
|
|
347
434
|
setupMaster(settings?: ClusterSettings): void;
|
|
348
435
|
/**
|
|
349
|
-
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings
|
|
436
|
+
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`.
|
|
437
|
+
*
|
|
438
|
+
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)
|
|
439
|
+
* and have no effect on workers that are already running.
|
|
440
|
+
*
|
|
441
|
+
* The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to
|
|
442
|
+
* [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv).
|
|
443
|
+
*
|
|
444
|
+
* The defaults above apply to the first call only; the defaults for later calls are the current values at the time of
|
|
445
|
+
* `cluster.setupPrimary()` is called.
|
|
446
|
+
*
|
|
447
|
+
* ```js
|
|
448
|
+
* import cluster from 'node:cluster';
|
|
449
|
+
*
|
|
450
|
+
* cluster.setupPrimary({
|
|
451
|
+
* exec: 'worker.js',
|
|
452
|
+
* args: ['--use', 'https'],
|
|
453
|
+
* silent: true,
|
|
454
|
+
* });
|
|
455
|
+
* cluster.fork(); // https worker
|
|
456
|
+
* cluster.setupPrimary({
|
|
457
|
+
* exec: 'worker.js',
|
|
458
|
+
* args: ['--use', 'http'],
|
|
459
|
+
* });
|
|
460
|
+
* cluster.fork(); // http worker
|
|
461
|
+
* ```
|
|
462
|
+
*
|
|
463
|
+
* This can only be called from the primary process.
|
|
464
|
+
* @since v16.0.0
|
|
350
465
|
*/
|
|
351
466
|
setupPrimary(settings?: ClusterSettings): void;
|
|
467
|
+
/**
|
|
468
|
+
* A reference to the current worker object. Not available in the primary process.
|
|
469
|
+
*
|
|
470
|
+
* ```js
|
|
471
|
+
* import cluster from 'node:cluster';
|
|
472
|
+
*
|
|
473
|
+
* if (cluster.isPrimary) {
|
|
474
|
+
* console.log('I am primary');
|
|
475
|
+
* cluster.fork();
|
|
476
|
+
* cluster.fork();
|
|
477
|
+
* } else if (cluster.isWorker) {
|
|
478
|
+
* console.log(`I am worker #${cluster.worker.id}`);
|
|
479
|
+
* }
|
|
480
|
+
* ```
|
|
481
|
+
* @since v0.7.0
|
|
482
|
+
*/
|
|
352
483
|
readonly worker?: Worker | undefined;
|
|
484
|
+
/**
|
|
485
|
+
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
|
486
|
+
*
|
|
487
|
+
* A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it
|
|
488
|
+
* is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted.
|
|
489
|
+
*
|
|
490
|
+
* ```js
|
|
491
|
+
* import cluster from 'node:cluster';
|
|
492
|
+
*
|
|
493
|
+
* for (const worker of Object.values(cluster.workers)) {
|
|
494
|
+
* worker.send('big announcement to all workers');
|
|
495
|
+
* }
|
|
496
|
+
* ```
|
|
497
|
+
* @since v0.7.0
|
|
498
|
+
*/
|
|
353
499
|
readonly workers?: NodeJS.Dict<Worker> | undefined;
|
|
354
500
|
readonly SCHED_NONE: number;
|
|
355
501
|
readonly SCHED_RR: number;
|
|
@@ -106,7 +106,7 @@ declare module "crypto" {
|
|
|
106
106
|
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
|
107
107
|
/** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
|
|
108
108
|
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
|
109
|
-
/** Instructs OpenSSL to use Cisco's
|
|
109
|
+
/** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */
|
|
110
110
|
const SSL_OP_CISCO_ANYCONNECT: number;
|
|
111
111
|
/** Instructs OpenSSL to turn on cookie exchange. */
|
|
112
112
|
const SSL_OP_COOKIE_EXCHANGE: number;
|
|
@@ -43,18 +43,18 @@ declare module "dns/promises" {
|
|
|
43
43
|
* integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
|
|
44
44
|
* and IPv6 addresses are both returned if found.
|
|
45
45
|
*
|
|
46
|
-
* With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`.
|
|
46
|
+
* With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`.
|
|
47
47
|
*
|
|
48
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
|
48
|
+
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
|
|
49
49
|
* Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
|
|
50
50
|
* the host name does not exist but also when the lookup fails in other ways
|
|
51
51
|
* such as no available file descriptors.
|
|
52
52
|
*
|
|
53
|
-
* `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
|
|
53
|
+
* [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS
|
|
54
54
|
* protocol. The implementation uses an operating system facility that can
|
|
55
55
|
* associate names with addresses and vice versa. This implementation can have
|
|
56
56
|
* subtle but important consequences on the behavior of any Node.js program. Please
|
|
57
|
-
* take some time to consult the
|
|
57
|
+
* take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before
|
|
58
58
|
* using `dnsPromises.lookup()`.
|
|
59
59
|
*
|
|
60
60
|
* Example usage:
|
|
@@ -91,9 +91,9 @@ declare module "dns/promises" {
|
|
|
91
91
|
* the operating system's underlying `getnameinfo` implementation.
|
|
92
92
|
*
|
|
93
93
|
* If `address` is not a valid IP address, a `TypeError` will be thrown.
|
|
94
|
-
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
|
|
94
|
+
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
|
|
95
95
|
*
|
|
96
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
|
96
|
+
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
|
|
97
97
|
*
|
|
98
98
|
* ```js
|
|
99
99
|
* const dnsPromises = require('node:dns').promises;
|
|
@@ -119,7 +119,8 @@ declare module "dns/promises" {
|
|
|
119
119
|
*
|
|
120
120
|
* <omitted>
|
|
121
121
|
*
|
|
122
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`
|
|
122
|
+
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
|
|
123
|
+
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
|
|
123
124
|
* @since v10.6.0
|
|
124
125
|
* @param hostname Host name to resolve.
|
|
125
126
|
* @param [rrtype='A'] Resource record type.
|
|
@@ -142,7 +143,7 @@ declare module "dns/promises" {
|
|
|
142
143
|
rrtype: string,
|
|
143
144
|
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
|
144
145
|
/**
|
|
145
|
-
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4
|
|
146
|
+
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
|
|
146
147
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
|
147
148
|
* @since v10.6.0
|
|
148
149
|
* @param hostname Host name to resolve.
|
|
@@ -151,7 +152,7 @@ declare module "dns/promises" {
|
|
|
151
152
|
function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
|
152
153
|
function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
|
153
154
|
/**
|
|
154
|
-
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6
|
|
155
|
+
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6
|
|
155
156
|
* addresses.
|
|
156
157
|
* @since v10.6.0
|
|
157
158
|
* @param hostname Host name to resolve.
|
|
@@ -191,7 +192,7 @@ declare module "dns/promises" {
|
|
|
191
192
|
/**
|
|
192
193
|
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
|
|
193
194
|
* the `Promise` is resolved with an array of objects containing available
|
|
194
|
-
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
|
195
|
+
* certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
|
195
196
|
* @since v15.0.0, v14.17.0
|
|
196
197
|
*/
|
|
197
198
|
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
|
@@ -203,13 +204,13 @@ declare module "dns/promises" {
|
|
|
203
204
|
*/
|
|
204
205
|
function resolveCname(hostname: string): Promise<string[]>;
|
|
205
206
|
/**
|
|
206
|
-
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects
|
|
207
|
+
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects
|
|
207
208
|
* containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
|
|
208
209
|
* @since v10.6.0
|
|
209
210
|
*/
|
|
210
211
|
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
|
211
212
|
/**
|
|
212
|
-
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array
|
|
213
|
+
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array
|
|
213
214
|
* of objects with the following properties:
|
|
214
215
|
*
|
|
215
216
|
* * `flags`
|
|
@@ -233,13 +234,13 @@ declare module "dns/promises" {
|
|
|
233
234
|
*/
|
|
234
235
|
function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
|
|
235
236
|
/**
|
|
236
|
-
* Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server
|
|
237
|
+
* Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server
|
|
237
238
|
* records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
|
|
238
239
|
* @since v10.6.0
|
|
239
240
|
*/
|
|
240
241
|
function resolveNs(hostname: string): Promise<string[]>;
|
|
241
242
|
/**
|
|
242
|
-
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings
|
|
243
|
+
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings
|
|
243
244
|
* containing the reply records.
|
|
244
245
|
* @since v10.6.0
|
|
245
246
|
*/
|
|
@@ -272,7 +273,7 @@ declare module "dns/promises" {
|
|
|
272
273
|
*/
|
|
273
274
|
function resolveSoa(hostname: string): Promise<SoaRecord>;
|
|
274
275
|
/**
|
|
275
|
-
* Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with
|
|
276
|
+
* Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with
|
|
276
277
|
* the following properties:
|
|
277
278
|
*
|
|
278
279
|
* * `priority`
|
|
@@ -292,7 +293,7 @@ declare module "dns/promises" {
|
|
|
292
293
|
*/
|
|
293
294
|
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
294
295
|
/**
|
|
295
|
-
* Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
|
296
|
+
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
|
296
297
|
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
|
297
298
|
* one record. Depending on the use case, these could be either joined together or
|
|
298
299
|
* treated separately.
|
|
@@ -303,12 +304,14 @@ declare module "dns/promises" {
|
|
|
303
304
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
|
304
305
|
* array of host names.
|
|
305
306
|
*
|
|
306
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`
|
|
307
|
+
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
|
|
308
|
+
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
|
|
307
309
|
* @since v10.6.0
|
|
308
310
|
*/
|
|
309
311
|
function reverse(ip: string): Promise<string[]>;
|
|
310
312
|
/**
|
|
311
|
-
* Get the default value for `verbatim` in {@link lookup} and
|
|
313
|
+
* Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
|
|
314
|
+
* The value could be:
|
|
312
315
|
*
|
|
313
316
|
* * `ipv4first`: for `verbatim` defaulting to `false`.
|
|
314
317
|
* * `verbatim`: for `verbatim` defaulting to `true`.
|
|
@@ -348,18 +351,43 @@ declare module "dns/promises" {
|
|
|
348
351
|
* * `ipv4first`: sets default `verbatim` `false`.
|
|
349
352
|
* * `verbatim`: sets default `verbatim` `true`.
|
|
350
353
|
*
|
|
351
|
-
* The default is `verbatim` and
|
|
352
|
-
* higher priority than `--dns-result-order
|
|
353
|
-
*
|
|
354
|
+
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
|
|
355
|
+
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
|
356
|
+
* When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
|
|
357
|
+
* from the main thread won't affect the default dns orders in workers.
|
|
354
358
|
* @since v16.4.0, v14.18.0
|
|
355
359
|
* @param order must be `'ipv4first'` or `'verbatim'`.
|
|
356
360
|
*/
|
|
357
361
|
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
|
362
|
+
const NODATA: "NODATA";
|
|
363
|
+
const FORMERR: "FORMERR";
|
|
364
|
+
const SERVFAIL: "SERVFAIL";
|
|
365
|
+
const NOTFOUND: "NOTFOUND";
|
|
366
|
+
const NOTIMP: "NOTIMP";
|
|
367
|
+
const REFUSED: "REFUSED";
|
|
368
|
+
const BADQUERY: "BADQUERY";
|
|
369
|
+
const BADNAME: "BADNAME";
|
|
370
|
+
const BADFAMILY: "BADFAMILY";
|
|
371
|
+
const BADRESP: "BADRESP";
|
|
372
|
+
const CONNREFUSED: "TIMEOUT";
|
|
373
|
+
const TIMEOUT: "TIMEOUT";
|
|
374
|
+
const EOF: "EOF";
|
|
375
|
+
const FILE: "FILE";
|
|
376
|
+
const NOMEM: "NOMEM";
|
|
377
|
+
const DESTRUCTION: "DESTRUCTION";
|
|
378
|
+
const BADSTR: "BADSTR";
|
|
379
|
+
const BADFLAGS: "BADFLAGS";
|
|
380
|
+
const NONAME: "NONAME";
|
|
381
|
+
const BADHINTS: "BADHINTS";
|
|
382
|
+
const NOTINITIALIZED: "NOTINITIALIZED";
|
|
383
|
+
const LOADIPHLPAPI: "LOADIPHLPAPI";
|
|
384
|
+
const ADDRGETNETWORKPARAMS: "ADDRGETNETWORKPARAMS";
|
|
385
|
+
const CANCELLED: "CANCELLED";
|
|
358
386
|
/**
|
|
359
387
|
* An independent resolver for DNS requests.
|
|
360
388
|
*
|
|
361
389
|
* Creating a new resolver uses the default server settings. Setting
|
|
362
|
-
* the servers used for a resolver using `resolver.setServers()` does not affect
|
|
390
|
+
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect
|
|
363
391
|
* other resolvers:
|
|
364
392
|
*
|
|
365
393
|
* ```js
|
|
@@ -400,6 +428,11 @@ declare module "dns/promises" {
|
|
|
400
428
|
*/
|
|
401
429
|
class Resolver {
|
|
402
430
|
constructor(options?: ResolverOptions);
|
|
431
|
+
/**
|
|
432
|
+
* Cancel all outstanding DNS queries made by this resolver. The corresponding
|
|
433
|
+
* callbacks will be called with an error with code `ECANCELLED`.
|
|
434
|
+
* @since v8.3.0
|
|
435
|
+
*/
|
|
403
436
|
cancel(): void;
|
|
404
437
|
getServers: typeof getServers;
|
|
405
438
|
resolve: typeof resolve;
|
|
@@ -416,6 +449,21 @@ declare module "dns/promises" {
|
|
|
416
449
|
resolveSrv: typeof resolveSrv;
|
|
417
450
|
resolveTxt: typeof resolveTxt;
|
|
418
451
|
reverse: typeof reverse;
|
|
452
|
+
/**
|
|
453
|
+
* The resolver instance will send its requests from the specified IP address.
|
|
454
|
+
* This allows programs to specify outbound interfaces when used on multi-homed
|
|
455
|
+
* systems.
|
|
456
|
+
*
|
|
457
|
+
* If a v4 or v6 address is not specified, it is set to the default and the
|
|
458
|
+
* operating system will choose a local address automatically.
|
|
459
|
+
*
|
|
460
|
+
* The resolver will use the v4 local address when making requests to IPv4 DNS
|
|
461
|
+
* servers, and the v6 local address when making requests to IPv6 DNS servers.
|
|
462
|
+
* The `rrtype` of resolution requests has no impact on the local address used.
|
|
463
|
+
* @since v15.1.0, v14.17.0
|
|
464
|
+
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
|
|
465
|
+
* @param [ipv6='::0'] A string representation of an IPv6 address.
|
|
466
|
+
*/
|
|
419
467
|
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
|
420
468
|
setServers: typeof setServers;
|
|
421
469
|
}
|