@suveren/gateway 0.7.4 → 0.8.0
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/content/integrations/mollie.json +103 -28
- package/dist/control-plane/index.mjs +248 -58
- package/dist/mcp-server/http.mjs +577 -124
- package/dist/ui/assets/index-BFnSVa9N.js +110 -0
- package/dist/ui/assets/{index-CkWaRck1.css → index-BYVb_0oG.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/node_modules/@hap/core/dist/index.d.mts +285 -13
- package/node_modules/@hap/core/dist/index.d.ts +285 -13
- package/node_modules/@hap/core/dist/index.js +281 -13
- package/node_modules/@hap/core/dist/index.mjs +266 -12
- package/node_modules/@hap/core/package.json +4 -2
- package/node_modules/@hap/core/src/did-key.ts +126 -0
- package/node_modules/@hap/core/src/frame.ts +115 -14
- package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
- package/node_modules/@hap/core/src/identity.ts +21 -5
- package/node_modules/@hap/core/src/index.ts +3 -0
- package/node_modules/@hap/core/src/mandate.ts +207 -0
- package/node_modules/@hap/core/src/receipt.ts +74 -0
- package/node_modules/@hap/core/src/types.ts +87 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/package.json +16 -10
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.buffer.d.ts +10 -5
- package/node_modules/@types/node/crypto.d.ts +2 -4
- package/node_modules/@types/node/dgram.d.ts +119 -4
- package/node_modules/@types/node/ffi.d.ts +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +61 -65
- package/node_modules/@types/node/fs.d.ts +86 -76
- package/node_modules/@types/node/http.d.ts +17 -1
- package/node_modules/@types/node/http2.d.ts +12 -4
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/inspector.d.ts +2 -1
- package/node_modules/@types/node/net.d.ts +108 -16
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +52 -0
- package/node_modules/@types/node/quic.d.ts +246 -38
- package/node_modules/@types/node/sqlite.d.ts +6 -2
- package/node_modules/@types/node/stream/iter.d.ts +4 -4
- package/node_modules/@types/node/test.d.ts +36 -0
- package/node_modules/@types/node/tls.d.ts +24 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/tty.d.ts +4 -3
- package/node_modules/@types/node/vfs.d.ts +210 -0
- package/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +6 -3
- package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
- package/node_modules/express-rate-limit/dist/index.mjs +6 -3
- package/node_modules/express-rate-limit/{license.md → license} +7 -6
- package/node_modules/express-rate-limit/package.json +5 -5
- package/node_modules/express-rate-limit/readme.md +1 -0
- package/node_modules/fast-uri/index.js +215 -47
- package/node_modules/fast-uri/lib/schemes.js +9 -4
- package/node_modules/fast-uri/lib/utils.js +396 -92
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/fast-uri/test/equal.test.js +31 -3
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +7 -3
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
- package/node_modules/fast-uri/test/security.test.js +75 -3
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/hono/dist/cjs/client/client.js +25 -11
- package/node_modules/hono/dist/cjs/client/utils.js +4 -1
- package/node_modules/hono/dist/cjs/context.js +4 -0
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -3
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/cjs/request.js +8 -4
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +46 -69
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/cjs/router/utils.js +27 -0
- package/node_modules/hono/dist/cjs/utils/body.js +15 -3
- package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
- package/node_modules/hono/dist/cjs/utils/url.js +9 -1
- package/node_modules/hono/dist/client/client.js +25 -11
- package/node_modules/hono/dist/client/utils.js +4 -1
- package/node_modules/hono/dist/context.js +4 -0
- package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
- package/node_modules/hono/dist/helper/ssg/utils.js +30 -10
- package/node_modules/hono/dist/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
- package/node_modules/hono/dist/middleware/etag/index.js +3 -3
- package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/request.js +8 -4
- package/node_modules/hono/dist/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
- package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/router/trie-router/node.js +46 -69
- package/node_modules/hono/dist/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/router/utils.js +5 -0
- package/node_modules/hono/dist/types/context.d.ts +4 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
- package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
- package/node_modules/hono/dist/types/utils/url.d.ts +4 -0
- package/node_modules/hono/dist/utils/body.js +15 -3
- package/node_modules/hono/dist/utils/cookie.js +1 -1
- package/node_modules/hono/dist/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/utils/stream.js +7 -1
- package/node_modules/hono/dist/utils/url.js +9 -1
- package/node_modules/hono/package.json +1 -1
- package/node_modules/ip-address/README.md +92 -82
- package/node_modules/ip-address/dist/common.d.ts +20 -0
- package/node_modules/ip-address/dist/common.js +36 -0
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
- package/node_modules/ip-address/dist/ipv4.js +75 -0
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
- package/node_modules/ip-address/dist/ipv6.js +120 -30
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/ip-address/dist/v4/constants.js +40 -1
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
- package/node_modules/ip-address/dist/v6/constants.js +47 -1
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/is-plain-object/README.md +39 -95
- package/node_modules/is-plain-object/dist/is-plain-object.js +0 -2
- package/node_modules/is-plain-object/is-plain-object.d.ts +6 -1
- package/node_modules/is-plain-object/package.json +8 -34
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +10 -20
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -38
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +19 -38
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
- package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
- package/node_modules/jose/dist/types/jwks/remote.d.ts +17 -28
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +12 -21
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -29
- package/node_modules/jose/dist/types/jwt/sign.d.ts +12 -19
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +17 -28
- package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
- package/node_modules/jose/dist/types/key/export.d.ts +4 -4
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
- package/node_modules/jose/dist/types/key/import.d.ts +10 -17
- package/node_modules/jose/dist/types/types.d.ts +48 -86
- package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
- package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
- package/node_modules/jose/dist/webapi/index.js +70 -32
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -10
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -71
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -158
- package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -18
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -64
- package/node_modules/jose/dist/webapi/jwks/local.js +49 -74
- package/node_modules/jose/dist/webapi/jwks/remote.js +91 -160
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -20
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -30
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -23
- package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -70
- package/node_modules/jose/dist/webapi/jws/general/verify.js +47 -41
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -22
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +58 -100
- package/node_modules/jose/dist/webapi/jwt/sign.js +18 -50
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -63
- package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
- package/node_modules/jose/dist/webapi/key/export.js +32 -37
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -44
- package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -39
- package/node_modules/jose/dist/webapi/key/import.js +52 -52
- package/node_modules/jose/dist/webapi/lib/asn1.js +130 -164
- package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -123
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
- package/node_modules/jose/dist/webapi/lib/deflate.js +46 -40
- package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +210 -176
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +105 -107
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +19 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +58 -72
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +90 -103
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +134 -185
- package/node_modules/jose/dist/webapi/lib/key.js +84 -121
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
- package/node_modules/jose/dist/webapi/lib/key_management.js +200 -225
- package/node_modules/jose/dist/webapi/lib/key_options.js +8 -0
- package/node_modules/jose/dist/webapi/lib/options.js +57 -44
- package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +28 -33
- package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
- package/node_modules/jose/dist/webapi/util/errors.js +94 -84
- package/node_modules/jose/package.json +17 -81
- package/package.json +2 -2
- package/profiles/calendar/0.5.profile.json +190 -0
- package/profiles/charge/0.5.profile.json +210 -0
- package/profiles/customers/0.7.profile.json +157 -0
- package/profiles/deploy/0.9.profile.json +176 -0
- package/profiles/email/0.6.profile.json +208 -0
- package/profiles/index.json +9 -1
- package/profiles/publish/0.5.profile.json +186 -0
- package/profiles/purchase/0.5.profile.json +231 -0
- package/profiles/records/0.5.profile.json +117 -0
- package/dist/ui/assets/index-0Q2eNytX.js +0 -110
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/HISTORY.md +0 -114
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare module "node:fs" {
|
|
2
|
-
import { NonSharedBuffer } from "node:buffer";
|
|
2
|
+
import { BufferView, NonSharedBuffer } from "node:buffer";
|
|
3
3
|
import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
|
|
4
4
|
import { FileHandle } from "node:fs/promises";
|
|
5
5
|
import * as stream from "node:stream";
|
|
@@ -3029,6 +3029,19 @@ declare module "node:fs" {
|
|
|
3029
3029
|
* If no `options` object is specified, it will default with the above values.
|
|
3030
3030
|
*/
|
|
3031
3031
|
function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number;
|
|
3032
|
+
interface ReadFileOptions extends Abortable {
|
|
3033
|
+
encoding?: BufferEncoding | null | undefined;
|
|
3034
|
+
flag?: OpenMode | undefined;
|
|
3035
|
+
}
|
|
3036
|
+
interface ReadFileOptionsWithStringEncoding extends ReadFileOptions {
|
|
3037
|
+
encoding: BufferEncoding;
|
|
3038
|
+
}
|
|
3039
|
+
interface ReadFileOptionsWithBufferEncoding extends ReadFileOptions {
|
|
3040
|
+
encoding?: null | undefined;
|
|
3041
|
+
}
|
|
3042
|
+
interface ReadFileOptionsWithBuffer<T extends NodeJS.ArrayBufferView> extends ReadFileOptionsWithBufferEncoding {
|
|
3043
|
+
buffer: T | ((size: number) => T);
|
|
3044
|
+
}
|
|
3032
3045
|
/**
|
|
3033
3046
|
* Asynchronously reads the entire contents of a file.
|
|
3034
3047
|
*
|
|
@@ -3046,6 +3059,11 @@ declare module "node:fs" {
|
|
|
3046
3059
|
*
|
|
3047
3060
|
* If no encoding is specified, then the raw buffer is returned.
|
|
3048
3061
|
*
|
|
3062
|
+
* If `buffer` is provided and no encoding is specified, the returned `Buffer` is
|
|
3063
|
+
* a view over the supplied buffer containing only the bytes read. If the
|
|
3064
|
+
* supplied buffer is too small to contain the entire file, the callback is
|
|
3065
|
+
* called with an error.
|
|
3066
|
+
*
|
|
3049
3067
|
* If `options` is a string, then it specifies the encoding:
|
|
3050
3068
|
*
|
|
3051
3069
|
* ```js
|
|
@@ -3054,7 +3072,8 @@ declare module "node:fs" {
|
|
|
3054
3072
|
* readFile('/etc/passwd', 'utf8', callback);
|
|
3055
3073
|
* ```
|
|
3056
3074
|
*
|
|
3057
|
-
* When the path is a directory, the behavior of `fs.readFile()` and
|
|
3075
|
+
* When the path is a directory, the behavior of `fs.readFile()` and
|
|
3076
|
+
* `fs.readFileSync()` is platform-specific. On macOS, Linux, and Windows, an
|
|
3058
3077
|
* error will be returned. On FreeBSD, a representation of the directory's contents
|
|
3059
3078
|
* will be returned.
|
|
3060
3079
|
*
|
|
@@ -3092,60 +3111,56 @@ declare module "node:fs" {
|
|
|
3092
3111
|
*
|
|
3093
3112
|
* Aborting an ongoing request does not abort individual operating
|
|
3094
3113
|
* system requests but rather the internal buffering `fs.readFile` performs.
|
|
3114
|
+
*
|
|
3115
|
+
* An example using the `buffer` option with a pre-allocated buffer:
|
|
3116
|
+
*
|
|
3117
|
+
* ```js
|
|
3118
|
+
* import { Buffer } from 'node:buffer';
|
|
3119
|
+
* import { readFile } from 'node:fs';
|
|
3120
|
+
*
|
|
3121
|
+
* const buf = Buffer.alloc(16384);
|
|
3122
|
+
* readFile('/path/to/file', { buffer: buf }, (err, data) => {
|
|
3123
|
+
* if (err) throw err;
|
|
3124
|
+
* console.log(data); // A view over `buf` containing only the bytes read
|
|
3125
|
+
* });
|
|
3126
|
+
* ```
|
|
3127
|
+
*
|
|
3128
|
+
* An example using the `buffer` option with a function returning a buffer:
|
|
3129
|
+
*
|
|
3130
|
+
* ```js
|
|
3131
|
+
* import { Buffer } from 'node:buffer';
|
|
3132
|
+
* import { readFile } from 'node:fs';
|
|
3133
|
+
*
|
|
3134
|
+
* readFile('/path/to/file', {
|
|
3135
|
+
* buffer: (size) => Buffer.alloc(size),
|
|
3136
|
+
* }, (err, data) => {
|
|
3137
|
+
* if (err) throw err;
|
|
3138
|
+
* console.log(data);
|
|
3139
|
+
* });
|
|
3140
|
+
* ```
|
|
3095
3141
|
* @since v0.1.29
|
|
3096
3142
|
* @param path filename or file descriptor
|
|
3097
3143
|
*/
|
|
3144
|
+
function readFile<T extends NodeJS.ArrayBufferView>(
|
|
3145
|
+
path: PathOrFileDescriptor,
|
|
3146
|
+
options: ReadFileOptionsWithBuffer<T>,
|
|
3147
|
+
callback: (err: NodeJS.ErrnoException | null, data: BufferView<T>) => void,
|
|
3148
|
+
): void;
|
|
3098
3149
|
function readFile(
|
|
3099
3150
|
path: PathOrFileDescriptor,
|
|
3100
|
-
options:
|
|
3101
|
-
| ({
|
|
3102
|
-
encoding?: null | undefined;
|
|
3103
|
-
flag?: string | undefined;
|
|
3104
|
-
} & Abortable)
|
|
3105
|
-
| undefined
|
|
3106
|
-
| null,
|
|
3151
|
+
options: ReadFileOptionsWithBufferEncoding | null | undefined,
|
|
3107
3152
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
3108
3153
|
): void;
|
|
3109
|
-
/**
|
|
3110
|
-
* Asynchronously reads the entire contents of a file.
|
|
3111
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3112
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3113
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3114
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3115
|
-
*/
|
|
3116
3154
|
function readFile(
|
|
3117
3155
|
path: PathOrFileDescriptor,
|
|
3118
|
-
options:
|
|
3119
|
-
| ({
|
|
3120
|
-
encoding: BufferEncoding;
|
|
3121
|
-
flag?: string | undefined;
|
|
3122
|
-
} & Abortable)
|
|
3123
|
-
| BufferEncoding,
|
|
3156
|
+
options: ReadFileOptionsWithStringEncoding | BufferEncoding,
|
|
3124
3157
|
callback: (err: NodeJS.ErrnoException | null, data: string) => void,
|
|
3125
3158
|
): void;
|
|
3126
|
-
/**
|
|
3127
|
-
* Asynchronously reads the entire contents of a file.
|
|
3128
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3129
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3130
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3131
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3132
|
-
*/
|
|
3133
3159
|
function readFile(
|
|
3134
3160
|
path: PathOrFileDescriptor,
|
|
3135
|
-
options:
|
|
3136
|
-
| (ObjectEncodingOptions & {
|
|
3137
|
-
flag?: string | undefined;
|
|
3138
|
-
} & Abortable)
|
|
3139
|
-
| BufferEncoding
|
|
3140
|
-
| undefined
|
|
3141
|
-
| null,
|
|
3161
|
+
options: ReadFileOptions | BufferEncoding | null | undefined,
|
|
3142
3162
|
callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,
|
|
3143
3163
|
): void;
|
|
3144
|
-
/**
|
|
3145
|
-
* Asynchronously reads the entire contents of a file.
|
|
3146
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3147
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3148
|
-
*/
|
|
3149
3164
|
function readFile(
|
|
3150
3165
|
path: PathOrFileDescriptor,
|
|
3151
3166
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
@@ -3200,16 +3215,37 @@ declare module "node:fs" {
|
|
|
3200
3215
|
| null,
|
|
3201
3216
|
): Promise<string | NonSharedBuffer>;
|
|
3202
3217
|
}
|
|
3218
|
+
interface ReadFileSyncOptions {
|
|
3219
|
+
encoding?: BufferEncoding | null | undefined;
|
|
3220
|
+
flag?: OpenMode | undefined;
|
|
3221
|
+
}
|
|
3222
|
+
interface ReadFileSyncOptionsWithStringEncoding extends ReadFileSyncOptions {
|
|
3223
|
+
encoding: BufferEncoding;
|
|
3224
|
+
}
|
|
3225
|
+
interface ReadFileSyncOptionsWithBufferEncoding extends ReadFileSyncOptions {
|
|
3226
|
+
encoding?: null | undefined;
|
|
3227
|
+
}
|
|
3228
|
+
interface ReadFileSyncOptionsWithBuffer<T extends NodeJS.ArrayBufferView>
|
|
3229
|
+
extends ReadFileSyncOptionsWithBufferEncoding
|
|
3230
|
+
{
|
|
3231
|
+
buffer: T | ((size: number) => T);
|
|
3232
|
+
}
|
|
3203
3233
|
/**
|
|
3204
3234
|
* Returns the contents of the `path`.
|
|
3205
3235
|
*
|
|
3206
3236
|
* For detailed information, see the documentation of the asynchronous version of
|
|
3207
|
-
* this API:
|
|
3237
|
+
* this API: `fs.readFile()`.
|
|
3208
3238
|
*
|
|
3209
3239
|
* If the `encoding` option is specified then this function returns a
|
|
3210
3240
|
* string. Otherwise it returns a buffer.
|
|
3211
3241
|
*
|
|
3212
|
-
*
|
|
3242
|
+
* If `buffer` is provided and no encoding is specified, the returned {Buffer} is
|
|
3243
|
+
* a view over the supplied buffer containing only the bytes read. If the
|
|
3244
|
+
* supplied buffer is too small to contain the entire file, an error will be
|
|
3245
|
+
* thrown.
|
|
3246
|
+
*
|
|
3247
|
+
* Similar to `fs.readFile()`, when the path is a directory, the behavior of
|
|
3248
|
+
* `fs.readFileSync()` is platform-specific.
|
|
3213
3249
|
*
|
|
3214
3250
|
* ```js
|
|
3215
3251
|
* import { readFileSync } from 'node:fs';
|
|
@@ -3224,45 +3260,19 @@ declare module "node:fs" {
|
|
|
3224
3260
|
* @since v0.1.8
|
|
3225
3261
|
* @param path filename or file descriptor
|
|
3226
3262
|
*/
|
|
3263
|
+
function readFileSync<T extends NodeJS.ArrayBufferView>(
|
|
3264
|
+
path: PathOrFileDescriptor,
|
|
3265
|
+
options: ReadFileSyncOptionsWithBuffer<T>,
|
|
3266
|
+
): BufferView<T>;
|
|
3227
3267
|
function readFileSync(
|
|
3228
3268
|
path: PathOrFileDescriptor,
|
|
3229
|
-
options?:
|
|
3230
|
-
encoding?: null | undefined;
|
|
3231
|
-
flag?: string | undefined;
|
|
3232
|
-
} | null,
|
|
3269
|
+
options?: ReadFileSyncOptionsWithBufferEncoding | null,
|
|
3233
3270
|
): NonSharedBuffer;
|
|
3234
|
-
/**
|
|
3235
|
-
* Synchronously reads the entire contents of a file.
|
|
3236
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3237
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3238
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3239
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3240
|
-
*/
|
|
3241
3271
|
function readFileSync(
|
|
3242
3272
|
path: PathOrFileDescriptor,
|
|
3243
|
-
options:
|
|
3244
|
-
| {
|
|
3245
|
-
encoding: BufferEncoding;
|
|
3246
|
-
flag?: string | undefined;
|
|
3247
|
-
}
|
|
3248
|
-
| BufferEncoding,
|
|
3273
|
+
options: ReadFileSyncOptionsWithStringEncoding | BufferEncoding,
|
|
3249
3274
|
): string;
|
|
3250
|
-
|
|
3251
|
-
* Synchronously reads the entire contents of a file.
|
|
3252
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3253
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3254
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3255
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3256
|
-
*/
|
|
3257
|
-
function readFileSync(
|
|
3258
|
-
path: PathOrFileDescriptor,
|
|
3259
|
-
options?:
|
|
3260
|
-
| (ObjectEncodingOptions & {
|
|
3261
|
-
flag?: string | undefined;
|
|
3262
|
-
})
|
|
3263
|
-
| BufferEncoding
|
|
3264
|
-
| null,
|
|
3265
|
-
): string | NonSharedBuffer;
|
|
3275
|
+
function readFileSync(path: PathOrFileDescriptor, options: ReadFileSyncOptions): string | NonSharedBuffer;
|
|
3266
3276
|
type WriteFileOptions =
|
|
3267
3277
|
| (
|
|
3268
3278
|
& ObjectEncodingOptions
|
|
@@ -175,6 +175,7 @@ declare module "node:http" {
|
|
|
175
175
|
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
|
176
176
|
host?: string | null | undefined;
|
|
177
177
|
hostname?: string | null | undefined;
|
|
178
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
178
179
|
insecureHTTPParser?: boolean | undefined;
|
|
179
180
|
localAddress?: string | undefined;
|
|
180
181
|
localPort?: number | undefined;
|
|
@@ -254,6 +255,21 @@ declare module "node:http" {
|
|
|
254
255
|
* @since v20.1.0
|
|
255
256
|
*/
|
|
256
257
|
highWaterMark?: number | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Controls HTTP header value validation strictness
|
|
260
|
+
* for incoming requests. Accepted values are:
|
|
261
|
+
* * `'strict'`: Strictest validation; rejects any non-ASCII or control
|
|
262
|
+
* characters in header values.
|
|
263
|
+
* * `'relaxed'`: Allows a limited set of non-ASCII characters in header
|
|
264
|
+
* values, aligning with the
|
|
265
|
+
* [Fetch specification](https://fetch.spec.whatwg.org/).
|
|
266
|
+
* * `'insecure'`: Disables all header value validation (equivalent to
|
|
267
|
+
* `insecureHTTPParser: true`).
|
|
268
|
+
*
|
|
269
|
+
* Cannot be used together with `insecureHTTPParser`. **Default:** `'strict'`.
|
|
270
|
+
* @since v26.3.0
|
|
271
|
+
*/
|
|
272
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
257
273
|
/**
|
|
258
274
|
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
|
|
259
275
|
* Using the insecure parser should be avoided.
|
|
@@ -283,7 +299,7 @@ declare module "node:http" {
|
|
|
283
299
|
requireHostHeader?: boolean | undefined;
|
|
284
300
|
/**
|
|
285
301
|
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
286
|
-
* similarly on what is done in `socket.setKeepAlive(
|
|
302
|
+
* similarly on what is done in `socket.setKeepAlive()`.
|
|
287
303
|
* @default false
|
|
288
304
|
* @since v16.5.0
|
|
289
305
|
*/
|
|
@@ -433,7 +433,7 @@ declare module "node:http2" {
|
|
|
433
433
|
*
|
|
434
434
|
* When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
|
|
435
435
|
* will be emitted immediately after queuing the last chunk of payload data to be
|
|
436
|
-
* sent. The `http2stream.sendTrailers()` method can then be used to
|
|
436
|
+
* sent. The `http2stream.sendTrailers()` method can then be used to send trailing
|
|
437
437
|
* header fields to the peer.
|
|
438
438
|
*
|
|
439
439
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
@@ -548,7 +548,7 @@ declare module "node:http2" {
|
|
|
548
548
|
*
|
|
549
549
|
* When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
|
|
550
550
|
* will be emitted immediately after queuing the last chunk of payload data to be
|
|
551
|
-
* sent. The `http2stream.sendTrailers()` method can then be used to
|
|
551
|
+
* sent. The `http2stream.sendTrailers()` method can then be used to send trailing
|
|
552
552
|
* header fields to the peer.
|
|
553
553
|
*
|
|
554
554
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
@@ -840,9 +840,12 @@ declare module "node:http2" {
|
|
|
840
840
|
* HTTP/2 request to the connected server.
|
|
841
841
|
*
|
|
842
842
|
* When a `ClientHttp2Session` is first created, the socket may not yet be
|
|
843
|
-
* connected.
|
|
843
|
+
* connected. If `clienthttp2session.request()` is called during this time, the
|
|
844
844
|
* actual request will be deferred until the socket is ready to go.
|
|
845
|
-
*
|
|
845
|
+
*
|
|
846
|
+
* If the session becomes unavailable before the request can be created, the
|
|
847
|
+
* returned stream will emit `ERR_HTTP2_GOAWAY_SESSION` or
|
|
848
|
+
* `ERR_HTTP2_INVALID_SESSION` asynchronously.
|
|
846
849
|
*
|
|
847
850
|
* This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
848
851
|
*
|
|
@@ -1166,6 +1169,11 @@ declare module "node:http2" {
|
|
|
1166
1169
|
* @default 128
|
|
1167
1170
|
*/
|
|
1168
1171
|
maxHeaderListPairs?: number | undefined;
|
|
1172
|
+
/**
|
|
1173
|
+
* Sets the maximum number of uniq origin the sever
|
|
1174
|
+
* can send via ORIGIN frames. **Default:** `128`.
|
|
1175
|
+
*/
|
|
1176
|
+
maxOriginSetSize?: number | undefined;
|
|
1169
1177
|
/**
|
|
1170
1178
|
* Sets the maximum number of outstanding, unacknowledged pings.
|
|
1171
1179
|
* @default 10
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
/// <reference path="util.d.ts" />
|
|
109
109
|
/// <reference path="util/types.d.ts" />
|
|
110
110
|
/// <reference path="v8.d.ts" />
|
|
111
|
+
/// <reference path="vfs.d.ts" />
|
|
111
112
|
/// <reference path="vm.d.ts" />
|
|
112
113
|
/// <reference path="wasi.d.ts" />
|
|
113
114
|
/// <reference path="worker_threads.d.ts" />
|
|
@@ -43,7 +43,8 @@ declare module "node:inspector" {
|
|
|
43
43
|
*/
|
|
44
44
|
function open(port?: number, host?: string, wait?: boolean): Disposable;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Deactivates the inspector. If there are active connections, they are forcibly
|
|
47
|
+
* terminated. Blocks until the inspector server has fully stopped.
|
|
47
48
|
*/
|
|
48
49
|
function close(): void;
|
|
49
50
|
/**
|
|
@@ -25,6 +25,7 @@ declare module "node:net" {
|
|
|
25
25
|
keepAliveInitialDelay?: number | undefined;
|
|
26
26
|
blockList?: BlockList | undefined;
|
|
27
27
|
typeOfService?: number | undefined;
|
|
28
|
+
handle?: BoundSocket | undefined;
|
|
28
29
|
}
|
|
29
30
|
interface OnReadOpts {
|
|
30
31
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -57,6 +58,12 @@ declare module "node:net" {
|
|
|
57
58
|
}
|
|
58
59
|
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
|
59
60
|
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
|
|
61
|
+
interface SetKeepAliveOptions {
|
|
62
|
+
enable?: boolean | undefined;
|
|
63
|
+
initialDelay?: number | undefined;
|
|
64
|
+
interval?: number | undefined;
|
|
65
|
+
count?: number | undefined;
|
|
66
|
+
}
|
|
60
67
|
interface SocketEventMap extends Omit<stream.DuplexEventMap, "close"> {
|
|
61
68
|
"close": [hadError: boolean];
|
|
62
69
|
"connect": [];
|
|
@@ -199,25 +206,27 @@ declare module "node:net" {
|
|
|
199
206
|
*/
|
|
200
207
|
setNoDelay(noDelay?: boolean): this;
|
|
201
208
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* Set `initialDelay` (in milliseconds) to set the delay between the last
|
|
206
|
-
* data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default
|
|
207
|
-
* (or previous) setting.
|
|
208
|
-
*
|
|
209
|
-
* Enabling the keep-alive functionality will set the following socket options:
|
|
209
|
+
* Configure keep-alive using an options object. See `socket.setKeepAlive()`
|
|
210
|
+
* for a description of each property.
|
|
210
211
|
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
212
|
+
* ```js
|
|
213
|
+
* socket.setKeepAlive({ enable: true, initialDelay: 1000, interval: 1000, count: 10 });
|
|
214
|
+
* ```
|
|
215
|
+
* @since v26.4.0
|
|
216
|
+
* @returns The socket itself.
|
|
217
|
+
*/
|
|
218
|
+
setKeepAlive(options: SetKeepAliveOptions): this;
|
|
219
|
+
/**
|
|
220
|
+
* Configure keep-alive using positional arguments. See
|
|
221
|
+
* `socket.setKeepAlive()` for a description of each argument.
|
|
215
222
|
* @since v0.1.92
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
* @
|
|
223
|
+
* @param enable **Default:** `false`
|
|
224
|
+
* @param initialDelay **Default:** `0`
|
|
225
|
+
* @param interval **Default:** `1000`
|
|
226
|
+
* @param count **Default:** `10`
|
|
227
|
+
* @returns The socket itself.
|
|
219
228
|
*/
|
|
220
|
-
setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
|
229
|
+
setKeepAlive(enable?: boolean, initialDelay?: number, interval?: number, count?: number): this;
|
|
221
230
|
/**
|
|
222
231
|
* Returns the current Type of Service (TOS) field for IPv4 packets or Traffic
|
|
223
232
|
* Class for IPv6 packets for this socket.
|
|
@@ -442,9 +451,92 @@ declare module "node:net" {
|
|
|
442
451
|
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
443
452
|
// #endregion
|
|
444
453
|
}
|
|
454
|
+
interface BoundSocketOptions {
|
|
455
|
+
/**
|
|
456
|
+
* Local address to bind. Must be a numeric IP literal; no DNS
|
|
457
|
+
* resolution is performed. **Default:** `'0.0.0.0'`, or `'::'` when
|
|
458
|
+
* `ipv6Only` is `true`.
|
|
459
|
+
*/
|
|
460
|
+
host?: string | undefined;
|
|
461
|
+
/**
|
|
462
|
+
* Local port. `0` requests an OS-assigned ephemeral port.
|
|
463
|
+
* **Default:** `0`.
|
|
464
|
+
*/
|
|
465
|
+
port?: number | undefined;
|
|
466
|
+
/**
|
|
467
|
+
* Sets `IPV6_V6ONLY`, disabling dual-stack support so the
|
|
468
|
+
* socket binds IPv6 only. Only meaningful for IPv6 binds. **Default:**
|
|
469
|
+
* `false`.
|
|
470
|
+
*/
|
|
471
|
+
ipv6Only?: boolean | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* Sets `SO_REUSEPORT`, allowing multiple sockets to bind
|
|
474
|
+
* the same address and port for kernel-level load balancing. Support is
|
|
475
|
+
* platform-dependent. **Default:** `false`.
|
|
476
|
+
*/
|
|
477
|
+
reusePort?: boolean | undefined;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Allows for the synchronous creation of a pre-bound socket, that can be passed
|
|
481
|
+
* to `listen()` or `new net.Socket()` later on. For `listen()` this enables
|
|
482
|
+
* synchronous port reservation, while for `new net.Socket()`, it allows control
|
|
483
|
+
* over the local egress port/IP, via `bind(2)` semantics.
|
|
484
|
+
*
|
|
485
|
+
* Adoption transfers ownership of the socket; afterwards `address()` and `close()`
|
|
486
|
+
* throw `ERR_SOCKET_HANDLE_ADOPTED`. A handle that is never adopted must be
|
|
487
|
+
* closed to avoid leaking the socket.
|
|
488
|
+
*
|
|
489
|
+
* ```js
|
|
490
|
+
* import net from 'node:net';
|
|
491
|
+
*
|
|
492
|
+
* const bound = new net.BoundSocket();
|
|
493
|
+
* const { port } = bound.address();
|
|
494
|
+
* console.log(`Reserved port ${port} for server`);
|
|
495
|
+
*
|
|
496
|
+
* const server = net.createServer();
|
|
497
|
+
* server.listen(bound); // Adopt as a server, or pass to new net.Socket() instead.
|
|
498
|
+
* ```
|
|
499
|
+
* @since v26.4.0
|
|
500
|
+
*/
|
|
501
|
+
class BoundSocket {
|
|
502
|
+
/**
|
|
503
|
+
* @since v26.4.0
|
|
504
|
+
*/
|
|
505
|
+
constructor(options?: BoundSocketOptions);
|
|
506
|
+
/**
|
|
507
|
+
* Returns the bound local address. When bound with `port: 0`, `port` is the
|
|
508
|
+
* OS-assigned ephemeral port.
|
|
509
|
+
* @since v26.4.0
|
|
510
|
+
* @returns An object with `address`, `family`, and `port` properties,
|
|
511
|
+
* as `server.address()` returns.
|
|
512
|
+
*/
|
|
513
|
+
address(): AddressInfo;
|
|
514
|
+
/**
|
|
515
|
+
* Returns the file descriptor of the bound socket. Ownership remains with the
|
|
516
|
+
* `BoundSocket`, so the descriptor must not be closed by the caller. The
|
|
517
|
+
* descriptor is only available before the handle is adopted; afterwards it belongs
|
|
518
|
+
* to the adopting `net.Server` or `net.Socket` and `fd()` throws
|
|
519
|
+
* `ERR_SOCKET_HANDLE_ADOPTED`.
|
|
520
|
+
* @since v26.4.0
|
|
521
|
+
* @returns The underlying OS file descriptor, or `-1` on platforms
|
|
522
|
+
* that do not expose one for sockets (such as Windows).
|
|
523
|
+
*/
|
|
524
|
+
fd(): number;
|
|
525
|
+
/**
|
|
526
|
+
* Releases the bound socket. Only needed when the handle is never adopted.
|
|
527
|
+
* @since v26.4.0
|
|
528
|
+
*/
|
|
529
|
+
close(): void;
|
|
530
|
+
/**
|
|
531
|
+
* Closes the handle if it has not been adopted or closed; otherwise a no-op.
|
|
532
|
+
* @since v26.4.0
|
|
533
|
+
*/
|
|
534
|
+
[Symbol.dispose](): void;
|
|
535
|
+
}
|
|
445
536
|
interface ListenOptions extends Abortable {
|
|
446
537
|
backlog?: number | undefined;
|
|
447
538
|
exclusive?: boolean | undefined;
|
|
539
|
+
handle?: BoundSocket | undefined;
|
|
448
540
|
host?: string | undefined;
|
|
449
541
|
/**
|
|
450
542
|
* @default false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.1",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "463ff626c280fc7ad82097e8ff9ab6bd4a19fb2b4c56c8d56c2b8148cd872d0c",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -549,6 +549,58 @@ declare module "node:process" {
|
|
|
549
549
|
* @since v20.0.0
|
|
550
550
|
*/
|
|
551
551
|
has(scope: string, reference?: string): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Drops the specified permission from the current process. This operation is
|
|
554
|
+
* **irreversible** — once a permission is dropped, it cannot be restored through
|
|
555
|
+
* any Node.js API.
|
|
556
|
+
*
|
|
557
|
+
* If no reference is provided, the entire scope is dropped. For example,
|
|
558
|
+
* `process.permission.drop('fs.read')` will revoke ALL file system read
|
|
559
|
+
* permissions.
|
|
560
|
+
*
|
|
561
|
+
* When a reference is provided, only the permission for that specific resource
|
|
562
|
+
* is dropped. For example, `process.permission.drop('fs.read', '/etc/myapp')`
|
|
563
|
+
* will revoke read access to that directory while keeping other read
|
|
564
|
+
* permissions intact.
|
|
565
|
+
*
|
|
566
|
+
* **Important:** You can only drop the exact resource that was explicitly
|
|
567
|
+
* granted. The reference passed to `drop()` must match the original grant:
|
|
568
|
+
*
|
|
569
|
+
* * If a permission was granted using a wildcard (`*`), such as
|
|
570
|
+
* `--allow-fs-read=*`, individual paths cannot be dropped - only the entire
|
|
571
|
+
* scope can be dropped (by calling `drop()` without a reference).
|
|
572
|
+
* * If a directory was granted (e.g. `--allow-fs-read=/my/folder`), you cannot
|
|
573
|
+
* drop access to individual files inside it. You must drop the same directory
|
|
574
|
+
* that was granted. Any remaining grants continue to apply.
|
|
575
|
+
*
|
|
576
|
+
* The available scopes are the same as [`process.permission.has()`][]:
|
|
577
|
+
*
|
|
578
|
+
* `fs` - All File System (drops both read and write)
|
|
579
|
+
* * `fs.read` - File System read operations
|
|
580
|
+
* * `fs.write` - File System write operations
|
|
581
|
+
* * `child` - Child process spawning operations
|
|
582
|
+
* * `worker` - Worker thread spawning operation
|
|
583
|
+
* * `net` - Network operations
|
|
584
|
+
* * `inspector` - Inspector operations
|
|
585
|
+
* * `wasi` - WASI operations
|
|
586
|
+
* * `addon` - Native addon operations
|
|
587
|
+
*
|
|
588
|
+
* ```js
|
|
589
|
+
* const fs = require('node:fs');
|
|
590
|
+
*
|
|
591
|
+
* // Read configuration during startup
|
|
592
|
+
* const config = fs.readFileSync('/etc/myapp/config.json', 'utf8');
|
|
593
|
+
*
|
|
594
|
+
* // Drop read access to the config directory after initialization
|
|
595
|
+
* process.permission.drop('fs.read', '/etc/myapp');
|
|
596
|
+
*
|
|
597
|
+
* // This will now throw ERR_ACCESS_DENIED
|
|
598
|
+
* fs.readFileSync('/etc/myapp/config.json');
|
|
599
|
+
* ```
|
|
600
|
+
* @since v26.3.0
|
|
601
|
+
* @experimental
|
|
602
|
+
*/
|
|
603
|
+
drop(scope: string, reference?: string): void;
|
|
552
604
|
}
|
|
553
605
|
interface ProcessReport {
|
|
554
606
|
/**
|