@openclaw/line 2026.10.2 → 2026.10.5-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/dist/.setup/api-BxKwG8cd.mjs +3 -0
- package/dist/.setup/{api-CMU7bG-C.mjs → api-DPd9f0cI.mjs} +2 -2
- package/dist/.setup/{card-command-BrU6u6pm.mjs → card-command-BMLk4YKh.mjs} +15 -24
- package/dist/.setup/{channel-InKuXaRS.mjs → channel-DVuSrT_i.mjs} +161 -227
- package/dist/.setup/channel.runtime-IN_F95BO.mjs +4 -0
- package/dist/.setup/{monitor-Bb3HieCd.mjs → monitor-BY32s5Um.mjs} +68 -83
- package/dist/.setup/monitor.runtime-DKuc2SBe.mjs +2 -0
- package/dist/.setup/outbound.runtime-DLyndDng.mjs +3 -0
- package/dist/.setup/probe.runtime-D2MUF_B_.mjs +2 -0
- package/dist/.setup/{send-DAwROcyQ.mjs → send-g4gFsc9W.mjs} +51 -71
- package/dist/.setup/{send-retry-B9Nor0-J.mjs → send-retry-Dzbkz5wG.mjs} +186 -379
- package/dist/.setup/{setup-surface-1jkHGWg7.mjs → setup-surface-CYd8oqzt.mjs} +1 -1
- package/dist/.setup/{template-messages-DdF9zv_j.mjs → template-messages-CwPsGQjw.mjs} +67 -118
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/index.js +1 -3
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/node_modules/@line/bot-sdk/dist/channel-access-token/api/channelAccessTokenClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/channel-access-token/api/channelAccessTokenClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/channel-access-token/api/channelAccessTokenClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/exceptions.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/exceptions.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/http-fetch.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/http-fetch.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/index.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/insight/api/insightClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/insight/api/insightClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/liff/api/liffClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/liff/api/liffClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.factory.generated.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.generated.d.ts +38 -0
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.generated.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.generated.js +46 -0
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.generated.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/line-bot-client.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/manage-audience/api/manageAudienceBlobClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/manage-audience/api/manageAudienceBlobClient.js +15 -5
- package/node_modules/@line/bot-sdk/dist/cjs/manage-audience/api/manageAudienceBlobClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/manage-audience/api/manageAudienceClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/manage-audience/api/manageAudienceClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiBlobClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiBlobClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiClient.d.ts +39 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiClient.js +59 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/api/messagingApiClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/models.d.ts +5 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/models.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/models.js +5 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/models.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpMessagesRequest.d.ts +5 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpMessagesRequest.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedButton.d.ts +26 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedButton.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedButton.js +14 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedButton.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedEmphasizedItem.d.ts +27 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedEmphasizedItem.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedEmphasizedItem.js +14 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedEmphasizedItem.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedItem.d.ts +26 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedItem.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedItem.js +14 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedItem.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageBody.d.ts +32 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageBody.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageBody.js +14 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageBody.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageRequest.d.ts +32 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageRequest.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageRequest.js +14 -0
- package/node_modules/@line/bot-sdk/dist/cjs/messaging-api/model/pnpTemplatedMessageRequest.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/cjs/middleware.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/module/api/lineModuleClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/module/api/lineModuleClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/module-attach/api/lineModuleAttachClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/module-attach/api/lineModuleAttachClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/shop/api/shopClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/shop/api/shopClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/utils.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/validate-signature.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/version.d.ts +1 -1
- package/node_modules/@line/bot-sdk/dist/cjs/version.js +1 -1
- package/node_modules/@line/bot-sdk/dist/exceptions.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/exceptions.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/http-fetch.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/insight/api/insightClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/liff/api/liffClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/line-bot-client.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/line-bot-client.generated.d.ts +38 -0
- package/node_modules/@line/bot-sdk/dist/line-bot-client.generated.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/line-bot-client.generated.js +46 -0
- package/node_modules/@line/bot-sdk/dist/line-bot-client.generated.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/manage-audience/api/manageAudienceBlobClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/manage-audience/api/manageAudienceBlobClient.js +15 -5
- package/node_modules/@line/bot-sdk/dist/manage-audience/api/manageAudienceBlobClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/manage-audience/api/manageAudienceClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiBlobClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiClient.d.ts +39 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiClient.js +61 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiClient.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/models.d.ts +5 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/models.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/models.js +5 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/models.js.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpMessagesRequest.d.ts +5 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpMessagesRequest.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedButton.d.ts +26 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedButton.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedButton.js +13 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedButton.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedEmphasizedItem.d.ts +27 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedEmphasizedItem.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedEmphasizedItem.js +13 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedEmphasizedItem.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedItem.d.ts +26 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedItem.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedItem.js +13 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedItem.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageBody.d.ts +32 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageBody.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageBody.js +13 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageBody.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageRequest.d.ts +32 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageRequest.d.ts.map +1 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageRequest.js +13 -0
- package/node_modules/@line/bot-sdk/dist/messaging-api/model/pnpTemplatedMessageRequest.js.map +1 -0
- package/node_modules/@line/bot-sdk/dist/module/api/lineModuleClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/module-attach/api/lineModuleAttachClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/shop/api/shopClient.d.ts.map +1 -1
- package/node_modules/@line/bot-sdk/dist/version.d.ts +1 -1
- package/node_modules/@line/bot-sdk/dist/version.js +1 -1
- package/node_modules/@line/bot-sdk/lib/line-bot-client.generated.ts +68 -0
- package/node_modules/@line/bot-sdk/lib/manage-audience/api/manageAudienceBlobClient.ts +15 -5
- package/node_modules/@line/bot-sdk/lib/messaging-api/.openapi-generator/FILES +5 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/api/messagingApiClient.ts +89 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/models.ts +5 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpMessagesRequest.ts +5 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpTemplatedButton.ts +26 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpTemplatedEmphasizedItem.ts +27 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpTemplatedItem.ts +26 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpTemplatedMessageBody.ts +33 -0
- package/node_modules/@line/bot-sdk/lib/messaging-api/model/pnpTemplatedMessageRequest.ts +33 -0
- package/node_modules/@line/bot-sdk/lib/version.ts +1 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/README.md +2 -2
- package/node_modules/@line/bot-sdk/node_modules/@types/node/async_hooks.d.ts +18 -22
- package/node_modules/@line/bot-sdk/node_modules/@types/node/buffer.buffer.d.ts +10 -5
- package/node_modules/@line/bot-sdk/node_modules/@types/node/buffer.d.ts +7 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/child_process.d.ts +5 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/crypto.d.ts +114 -47
- package/node_modules/@line/bot-sdk/node_modules/@types/node/dgram.d.ts +119 -4
- package/node_modules/@line/bot-sdk/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@line/bot-sdk/node_modules/@types/node/dns.d.ts +6 -6
- package/node_modules/@line/bot-sdk/node_modules/@types/node/events.d.ts +13 -22
- package/node_modules/@line/bot-sdk/node_modules/@types/node/fs/promises.d.ts +79 -66
- package/node_modules/@line/bot-sdk/node_modules/@types/node/fs.d.ts +153 -90
- package/node_modules/@line/bot-sdk/node_modules/@types/node/http.d.ts +94 -2
- package/node_modules/@line/bot-sdk/node_modules/@types/node/http2.d.ts +65 -18
- package/node_modules/@line/bot-sdk/node_modules/@types/node/inspector.d.ts +47 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/inspector.generated.d.ts +167 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/module.d.ts +1 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/net.d.ts +139 -15
- package/node_modules/@line/bot-sdk/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@line/bot-sdk/node_modules/@types/node/package.json +3 -18
- package/node_modules/@line/bot-sdk/node_modules/@types/node/perf_hooks.d.ts +31 -19
- package/node_modules/@line/bot-sdk/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@line/bot-sdk/node_modules/@types/node/sqlite.d.ts +153 -11
- package/node_modules/@line/bot-sdk/node_modules/@types/node/stream/consumers.d.ts +7 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/stream/web.d.ts +19 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/stream.d.ts +2 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/test.d.ts +320 -13
- package/node_modules/@line/bot-sdk/node_modules/@types/node/tls.d.ts +50 -15
- package/node_modules/@line/bot-sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
- package/node_modules/@line/bot-sdk/node_modules/@types/node/tty.d.ts +4 -3
- package/node_modules/@line/bot-sdk/node_modules/@types/node/url.d.ts +27 -3
- package/node_modules/@line/bot-sdk/node_modules/@types/node/util.d.ts +42 -2
- package/node_modules/@line/bot-sdk/node_modules/@types/node/v8.d.ts +51 -23
- package/node_modules/@line/bot-sdk/node_modules/@types/node/vm.d.ts +52 -87
- package/node_modules/@line/bot-sdk/node_modules/@types/node/zlib.d.ts +23 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/client.d.ts +15 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/connector.d.ts +2 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/dispatcher.d.ts +8 -5
- package/node_modules/@line/bot-sdk/node_modules/undici-types/errors.d.ts +17 -1
- package/node_modules/@line/bot-sdk/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@line/bot-sdk/node_modules/undici-types/interceptors.d.ts +7 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/package.json +1 -1
- package/node_modules/@line/bot-sdk/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/webidl.d.ts +6 -0
- package/node_modules/@line/bot-sdk/node_modules/undici-types/websocket.d.ts +2 -0
- package/node_modules/@line/bot-sdk/package.json +10 -9
- package/package.json +5 -5
- package/dist/.setup/api-BBSLQek1.mjs +0 -3
- package/dist/.setup/channel.runtime-BEhASjr_.mjs +0 -4
- package/dist/.setup/monitor.runtime-C6Kgs5BI.mjs +0 -2
- package/dist/.setup/outbound.runtime-BwO_m4n5.mjs +0 -3
- package/dist/.setup/probe.runtime-C6LYzOHu.mjs +0 -2
|
@@ -615,30 +615,24 @@ declare module "crypto" {
|
|
|
615
615
|
*/
|
|
616
616
|
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
617
617
|
/**
|
|
618
|
-
* For symmetric keys, the following encoding options can be used:
|
|
619
|
-
*
|
|
620
|
-
* For public keys, the following encoding options can be used:
|
|
621
|
-
*
|
|
622
|
-
* For private keys, the following encoding options can be used:
|
|
623
|
-
*
|
|
624
618
|
* The result type depends on the selected encoding format, when PEM the
|
|
625
619
|
* result is a string, when DER it will be a buffer containing the data
|
|
626
|
-
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
|
|
627
|
-
*
|
|
628
|
-
* When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
|
|
629
|
-
* ignored.
|
|
620
|
+
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. Raw formats return a
|
|
621
|
+
* `Buffer` containing the raw key material.
|
|
630
622
|
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
* encryption mechanism, PEM-level encryption is not
|
|
636
|
-
* a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption
|
|
637
|
-
* PKCS#1 and SEC1 encryption.
|
|
623
|
+
* Private keys can be encrypted by specifying a `cipher` and `passphrase`.
|
|
624
|
+
* The PKCS#8 `type` supports encryption with both PEM and DER `format` for any
|
|
625
|
+
* key algorithm. PKCS#1 and SEC1 can only be encrypted when the PEM `format` is
|
|
626
|
+
* used. For maximum compatibility, use PKCS#8 for encrypted private keys. Since
|
|
627
|
+
* PKCS#8 defines its own encryption mechanism, PEM-level encryption is not
|
|
628
|
+
* supported when encrypting a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption
|
|
629
|
+
* and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for PKCS#1 and SEC1 encryption.
|
|
638
630
|
* @since v11.6.0
|
|
639
631
|
*/
|
|
640
632
|
export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
|
|
641
|
-
export(
|
|
633
|
+
export(
|
|
634
|
+
options?: KeyExportOptions<"der"> | { format: "raw-public" | "raw-private" | "raw-seed" },
|
|
635
|
+
): NonSharedBuffer;
|
|
642
636
|
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
643
637
|
/**
|
|
644
638
|
* Returns `true` or `false` depending on whether the keys have exactly the same
|
|
@@ -1203,17 +1197,29 @@ declare module "crypto" {
|
|
|
1203
1197
|
}
|
|
1204
1198
|
interface PrivateKeyInput {
|
|
1205
1199
|
key: string | Buffer;
|
|
1206
|
-
format?:
|
|
1200
|
+
format?: "pem" | "der" | undefined;
|
|
1207
1201
|
type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
|
|
1208
1202
|
passphrase?: string | Buffer | undefined;
|
|
1209
1203
|
encoding?: string | undefined;
|
|
1210
1204
|
}
|
|
1205
|
+
interface RawPrivateKeyInput {
|
|
1206
|
+
key: Buffer;
|
|
1207
|
+
format: "raw-private" | "raw-seed";
|
|
1208
|
+
asymmetricKeyType: KeyType;
|
|
1209
|
+
namedCurve?: string | undefined;
|
|
1210
|
+
}
|
|
1211
1211
|
interface PublicKeyInput {
|
|
1212
1212
|
key: string | Buffer;
|
|
1213
|
-
format?:
|
|
1213
|
+
format?: "pem" | "der" | undefined;
|
|
1214
1214
|
type?: "pkcs1" | "spki" | undefined;
|
|
1215
1215
|
encoding?: string | undefined;
|
|
1216
1216
|
}
|
|
1217
|
+
interface RawPublicKeyInput {
|
|
1218
|
+
key: Buffer;
|
|
1219
|
+
format: "raw-public";
|
|
1220
|
+
asymmetricKeyType: KeyType;
|
|
1221
|
+
namedCurve?: string | undefined;
|
|
1222
|
+
}
|
|
1217
1223
|
/**
|
|
1218
1224
|
* Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
|
|
1219
1225
|
*
|
|
@@ -1275,7 +1281,14 @@ declare module "crypto" {
|
|
|
1275
1281
|
* of the passphrase is limited to 1024 bytes.
|
|
1276
1282
|
* @since v11.6.0
|
|
1277
1283
|
*/
|
|
1278
|
-
function createPrivateKey(
|
|
1284
|
+
function createPrivateKey(
|
|
1285
|
+
key:
|
|
1286
|
+
| PrivateKeyInput
|
|
1287
|
+
| RawPrivateKeyInput
|
|
1288
|
+
| JsonWebKeyInput
|
|
1289
|
+
| string
|
|
1290
|
+
| NodeJS.ArrayBufferView,
|
|
1291
|
+
): KeyObject;
|
|
1279
1292
|
/**
|
|
1280
1293
|
* Creates and returns a new key object containing a public key. If `key` is a
|
|
1281
1294
|
* string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key;
|
|
@@ -1290,7 +1303,15 @@ declare module "crypto" {
|
|
|
1290
1303
|
* and it will be impossible to extract the private key from the returned object.
|
|
1291
1304
|
* @since v11.6.0
|
|
1292
1305
|
*/
|
|
1293
|
-
function createPublicKey(
|
|
1306
|
+
function createPublicKey(
|
|
1307
|
+
key:
|
|
1308
|
+
| PublicKeyInput
|
|
1309
|
+
| RawPublicKeyInput
|
|
1310
|
+
| JsonWebKeyInput
|
|
1311
|
+
| string
|
|
1312
|
+
| NodeJS.ArrayBufferView
|
|
1313
|
+
| KeyObject,
|
|
1314
|
+
): KeyObject;
|
|
1294
1315
|
/**
|
|
1295
1316
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1296
1317
|
* encryption or `Hmac`.
|
|
@@ -1324,15 +1345,17 @@ declare module "crypto" {
|
|
|
1324
1345
|
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
1325
1346
|
}
|
|
1326
1347
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1348
|
+
interface SignRawPrivateKeyInput extends RawPrivateKeyInput, SigningOptions {}
|
|
1349
|
+
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1327
1350
|
interface SignKeyObjectInput extends SigningOptions {
|
|
1328
1351
|
key: KeyObject;
|
|
1329
1352
|
}
|
|
1330
|
-
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1331
1353
|
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
|
|
1354
|
+
interface VerifyRawPublicKeyInput extends RawPublicKeyInput, SigningOptions {}
|
|
1355
|
+
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1332
1356
|
interface VerifyKeyObjectInput extends SigningOptions {
|
|
1333
1357
|
key: KeyObject;
|
|
1334
1358
|
}
|
|
1335
|
-
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1336
1359
|
type KeyLike = string | Buffer | KeyObject;
|
|
1337
1360
|
/**
|
|
1338
1361
|
* The `Sign` class is a utility for generating signatures. It can be used in one
|
|
@@ -1423,9 +1446,21 @@ declare module "crypto" {
|
|
|
1423
1446
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1424
1447
|
* @since v0.1.92
|
|
1425
1448
|
*/
|
|
1426
|
-
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1427
1449
|
sign(
|
|
1428
|
-
privateKey:
|
|
1450
|
+
privateKey:
|
|
1451
|
+
| KeyLike
|
|
1452
|
+
| SignKeyObjectInput
|
|
1453
|
+
| SignPrivateKeyInput
|
|
1454
|
+
| SignRawPrivateKeyInput
|
|
1455
|
+
| SignJsonWebKeyInput,
|
|
1456
|
+
): NonSharedBuffer;
|
|
1457
|
+
sign(
|
|
1458
|
+
privateKey:
|
|
1459
|
+
| KeyLike
|
|
1460
|
+
| SignKeyObjectInput
|
|
1461
|
+
| SignPrivateKeyInput
|
|
1462
|
+
| SignRawPrivateKeyInput
|
|
1463
|
+
| SignJsonWebKeyInput,
|
|
1429
1464
|
outputFormat: BinaryToTextEncoding,
|
|
1430
1465
|
): string;
|
|
1431
1466
|
}
|
|
@@ -1472,9 +1507,9 @@ declare module "crypto" {
|
|
|
1472
1507
|
update(data: BinaryLike): Verify;
|
|
1473
1508
|
update(data: string, inputEncoding: Encoding): Verify;
|
|
1474
1509
|
/**
|
|
1475
|
-
* Verifies the provided data using the given `
|
|
1510
|
+
* Verifies the provided data using the given `key` and `signature`.
|
|
1476
1511
|
*
|
|
1477
|
-
* If `
|
|
1512
|
+
* If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
|
|
1478
1513
|
* object, the following additional properties can be passed:
|
|
1479
1514
|
*
|
|
1480
1515
|
* The `signature` argument is the previously calculated signature for the data, in
|
|
@@ -1491,13 +1526,23 @@ declare module "crypto" {
|
|
|
1491
1526
|
* @since v0.1.92
|
|
1492
1527
|
*/
|
|
1493
1528
|
verify(
|
|
1494
|
-
|
|
1529
|
+
key:
|
|
1530
|
+
| KeyLike
|
|
1531
|
+
| VerifyKeyObjectInput
|
|
1532
|
+
| VerifyPublicKeyInput
|
|
1533
|
+
| VerifyRawPublicKeyInput
|
|
1534
|
+
| VerifyJsonWebKeyInput,
|
|
1495
1535
|
signature: NodeJS.ArrayBufferView,
|
|
1496
1536
|
): boolean;
|
|
1497
1537
|
verify(
|
|
1498
|
-
object:
|
|
1538
|
+
object:
|
|
1539
|
+
| KeyLike
|
|
1540
|
+
| VerifyKeyObjectInput
|
|
1541
|
+
| VerifyPublicKeyInput
|
|
1542
|
+
| VerifyRawPublicKeyInput
|
|
1543
|
+
| VerifyJsonWebKeyInput,
|
|
1499
1544
|
signature: string,
|
|
1500
|
-
|
|
1545
|
+
signatureEncoding?: BinaryToTextEncoding,
|
|
1501
1546
|
): boolean;
|
|
1502
1547
|
}
|
|
1503
1548
|
/**
|
|
@@ -1577,8 +1622,10 @@ declare module "crypto" {
|
|
|
1577
1622
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1578
1623
|
*
|
|
1579
1624
|
* This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
|
|
1580
|
-
* once a private key has been generated or set, calling this function only
|
|
1581
|
-
* the public key
|
|
1625
|
+
* once a private key has been generated or set, calling this function only
|
|
1626
|
+
* recomputes the public key from the existing private key. Since the public key is
|
|
1627
|
+
* determined by the private key, the result will be the same unless the private key
|
|
1628
|
+
* has been changed via `diffieHellman.setPrivateKey()`.
|
|
1582
1629
|
* @since v0.5.0
|
|
1583
1630
|
* @param encoding The `encoding` of the return value.
|
|
1584
1631
|
*/
|
|
@@ -2496,7 +2543,7 @@ declare module "crypto" {
|
|
|
2496
2543
|
| "slh-dsa-shake-256s"
|
|
2497
2544
|
| "x25519"
|
|
2498
2545
|
| "x448";
|
|
2499
|
-
type KeyFormat = "pem" | "der" | "jwk";
|
|
2546
|
+
type KeyFormat = "pem" | "der" | "jwk" | "raw-public" | "raw-private" | "raw-seed";
|
|
2500
2547
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2501
2548
|
format: T;
|
|
2502
2549
|
cipher?: string | undefined;
|
|
@@ -3859,11 +3906,11 @@ declare module "crypto" {
|
|
|
3859
3906
|
* @since v24.7.0
|
|
3860
3907
|
*/
|
|
3861
3908
|
function decapsulate(
|
|
3862
|
-
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3909
|
+
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
3863
3910
|
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3864
3911
|
): NonSharedBuffer;
|
|
3865
3912
|
function decapsulate(
|
|
3866
|
-
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3913
|
+
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
3867
3914
|
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3868
3915
|
callback: (err: Error, sharedKey: NonSharedBuffer) => void,
|
|
3869
3916
|
): void;
|
|
@@ -3875,9 +3922,11 @@ declare module "crypto" {
|
|
|
3875
3922
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3876
3923
|
* @since v13.9.0, v12.17.0
|
|
3877
3924
|
*/
|
|
3878
|
-
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
3879
3925
|
function diffieHellman(
|
|
3880
|
-
options: { privateKey:
|
|
3926
|
+
options: { privateKey: KeyLike | PrivateKeyInput; publicKey: KeyLike | PublicKeyInput },
|
|
3927
|
+
): NonSharedBuffer;
|
|
3928
|
+
function diffieHellman(
|
|
3929
|
+
options: { privateKey: KeyLike | PrivateKeyInput; publicKey: KeyLike | PublicKeyInput },
|
|
3881
3930
|
callback: (err: Error | null, secret: NonSharedBuffer) => void,
|
|
3882
3931
|
): void;
|
|
3883
3932
|
/**
|
|
@@ -3900,10 +3949,10 @@ declare module "crypto" {
|
|
|
3900
3949
|
* @since v24.7.0
|
|
3901
3950
|
*/
|
|
3902
3951
|
function encapsulate(
|
|
3903
|
-
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3952
|
+
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
3904
3953
|
): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
|
|
3905
3954
|
function encapsulate(
|
|
3906
|
-
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3955
|
+
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
3907
3956
|
callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
|
|
3908
3957
|
): void;
|
|
3909
3958
|
interface OneShotDigestOptions {
|
|
@@ -4127,6 +4176,7 @@ declare module "crypto" {
|
|
|
4127
4176
|
*/
|
|
4128
4177
|
disableEntropyCache?: boolean | undefined;
|
|
4129
4178
|
}
|
|
4179
|
+
interface RandomUUIDV7Options extends RandomUUIDOptions {}
|
|
4130
4180
|
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
4131
4181
|
/**
|
|
4132
4182
|
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
|
|
@@ -4134,6 +4184,14 @@ declare module "crypto" {
|
|
|
4134
4184
|
* @since v15.6.0, v14.17.0
|
|
4135
4185
|
*/
|
|
4136
4186
|
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
4187
|
+
/**
|
|
4188
|
+
* Generates a random [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.txt) version 7 UUID. The UUID contains a millisecond
|
|
4189
|
+
* precision Unix timestamp in the most significant 48 bits, followed by
|
|
4190
|
+
* cryptographically secure random bits for the remaining fields, making it
|
|
4191
|
+
* suitable for use as a database key with time-based sorting.
|
|
4192
|
+
* @since v24.16.0
|
|
4193
|
+
*/
|
|
4194
|
+
function randomUUIDv7(options?: RandomUUIDV7Options): UUID;
|
|
4137
4195
|
interface X509CheckOptions {
|
|
4138
4196
|
/**
|
|
4139
4197
|
* @default 'always'
|
|
@@ -4639,7 +4697,6 @@ declare module "crypto" {
|
|
|
4639
4697
|
* ```
|
|
4640
4698
|
* @since v24.7.0
|
|
4641
4699
|
* @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
|
|
4642
|
-
* @experimental
|
|
4643
4700
|
*/
|
|
4644
4701
|
function argon2(
|
|
4645
4702
|
algorithm: Argon2Algorithm,
|
|
@@ -4679,7 +4736,6 @@ declare module "crypto" {
|
|
|
4679
4736
|
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4680
4737
|
* ```
|
|
4681
4738
|
* @since v24.7.0
|
|
4682
|
-
* @experimental
|
|
4683
4739
|
*/
|
|
4684
4740
|
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
|
|
4685
4741
|
/**
|
|
@@ -4758,7 +4814,7 @@ declare module "crypto" {
|
|
|
4758
4814
|
interface CShakeParams extends Algorithm {
|
|
4759
4815
|
customization?: BufferSource;
|
|
4760
4816
|
functionName?: BufferSource;
|
|
4761
|
-
|
|
4817
|
+
outputLength: number;
|
|
4762
4818
|
}
|
|
4763
4819
|
interface ContextParams extends Algorithm {
|
|
4764
4820
|
context?: BufferSource;
|
|
@@ -4795,6 +4851,10 @@ declare module "crypto" {
|
|
|
4795
4851
|
hash: HashAlgorithmIdentifier;
|
|
4796
4852
|
length?: number;
|
|
4797
4853
|
}
|
|
4854
|
+
interface KangarooTwelveParams extends Algorithm {
|
|
4855
|
+
customization?: BufferSource;
|
|
4856
|
+
outputLength: number;
|
|
4857
|
+
}
|
|
4798
4858
|
interface JsonWebKey {
|
|
4799
4859
|
alg?: string;
|
|
4800
4860
|
crv?: string;
|
|
@@ -4829,7 +4889,7 @@ declare module "crypto" {
|
|
|
4829
4889
|
}
|
|
4830
4890
|
interface KmacParams extends Algorithm {
|
|
4831
4891
|
customization?: BufferSource;
|
|
4832
|
-
|
|
4892
|
+
outputLength: number;
|
|
4833
4893
|
}
|
|
4834
4894
|
interface Pbkdf2Params extends Algorithm {
|
|
4835
4895
|
hash: HashAlgorithmIdentifier;
|
|
@@ -4864,6 +4924,10 @@ declare module "crypto" {
|
|
|
4864
4924
|
interface RsaPssParams extends Algorithm {
|
|
4865
4925
|
saltLength: number;
|
|
4866
4926
|
}
|
|
4927
|
+
interface TurboShakeParams extends Algorithm {
|
|
4928
|
+
domainSeparation?: number;
|
|
4929
|
+
outputLength: number;
|
|
4930
|
+
}
|
|
4867
4931
|
/**
|
|
4868
4932
|
* Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
|
|
4869
4933
|
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
|
@@ -4997,7 +5061,7 @@ declare module "crypto" {
|
|
|
4997
5061
|
ciphertext: BufferSource,
|
|
4998
5062
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4999
5063
|
extractable: boolean,
|
|
5000
|
-
|
|
5064
|
+
keyUsages: KeyUsage[],
|
|
5001
5065
|
): Promise<CryptoKey>;
|
|
5002
5066
|
/**
|
|
5003
5067
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
@@ -5095,7 +5159,10 @@ declare module "crypto" {
|
|
|
5095
5159
|
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
5096
5160
|
* @since v15.0.0
|
|
5097
5161
|
*/
|
|
5098
|
-
digest(
|
|
5162
|
+
digest(
|
|
5163
|
+
algorithm: AlgorithmIdentifier | CShakeParams | TurboShakeParams | KangarooTwelveParams,
|
|
5164
|
+
data: BufferSource,
|
|
5165
|
+
): Promise<ArrayBuffer>;
|
|
5099
5166
|
/**
|
|
5100
5167
|
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5101
5168
|
* This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
|
|
@@ -5130,7 +5197,7 @@ declare module "crypto" {
|
|
|
5130
5197
|
encapsulationKey: CryptoKey,
|
|
5131
5198
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
5132
5199
|
extractable: boolean,
|
|
5133
|
-
|
|
5200
|
+
keyUsages: KeyUsage[],
|
|
5134
5201
|
): Promise<EncapsulatedKey>;
|
|
5135
5202
|
/**
|
|
5136
5203
|
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
@@ -42,6 +42,10 @@ declare module "dgram" {
|
|
|
42
42
|
exclusive?: boolean | undefined;
|
|
43
43
|
fd?: number | undefined;
|
|
44
44
|
}
|
|
45
|
+
interface BindSyncOptions {
|
|
46
|
+
port?: number | undefined;
|
|
47
|
+
address?: string | undefined;
|
|
48
|
+
}
|
|
45
49
|
type SocketType = "udp4" | "udp6";
|
|
46
50
|
interface SocketOptions extends Abortable {
|
|
47
51
|
type: SocketType;
|
|
@@ -137,10 +141,12 @@ declare module "dgram" {
|
|
|
137
141
|
* messages on a named `port` and optional `address`. If `port` is not
|
|
138
142
|
* specified or is `0`, the operating system will attempt to bind to a
|
|
139
143
|
* random port. If `address` is not specified, the operating system will
|
|
140
|
-
* attempt to listen on all addresses. Once binding is complete, a
|
|
144
|
+
* attempt to listen on all addresses. Once binding is complete, a
|
|
145
|
+
* `'listening'` event is emitted and the optional `callback` function is
|
|
141
146
|
* called.
|
|
142
147
|
*
|
|
143
|
-
* Specifying both a `'listening'` event listener and passing a
|
|
148
|
+
* Specifying both a `'listening'` event listener and passing a
|
|
149
|
+
* `callback` to the `socket.bind()` method is not harmful but not very
|
|
144
150
|
* useful.
|
|
145
151
|
*
|
|
146
152
|
* A bound datagram socket keeps the Node.js process running to receive
|
|
@@ -177,9 +183,82 @@ declare module "dgram" {
|
|
|
177
183
|
* @param callback with no parameters. Called when binding is complete.
|
|
178
184
|
*/
|
|
179
185
|
bind(port?: number, address?: string, callback?: () => void): this;
|
|
180
|
-
bind(port
|
|
181
|
-
bind(callback
|
|
186
|
+
bind(port: number, callback: () => void): this;
|
|
187
|
+
bind(callback: () => void): this;
|
|
188
|
+
/**
|
|
189
|
+
* For UDP sockets, causes the `dgram.Socket` to listen for datagram
|
|
190
|
+
* messages on a named `port` and optional `address` that are passed as
|
|
191
|
+
* properties of an `options` object passed as the first argument. If
|
|
192
|
+
* `port` is not specified or is `0`, the operating system will attempt
|
|
193
|
+
* to bind to a random port. If `address` is not specified, the operating
|
|
194
|
+
* system will attempt to listen on all addresses. Once binding is
|
|
195
|
+
* complete, a `'listening'` event is emitted and the optional `callback`
|
|
196
|
+
* function is called.
|
|
197
|
+
*
|
|
198
|
+
* The `options` object may contain a `fd` property. When a `fd` greater
|
|
199
|
+
* than `0` is set, it will wrap around an existing socket with the given
|
|
200
|
+
* file descriptor. In this case, the properties of `port` and `address`
|
|
201
|
+
* will be ignored.
|
|
202
|
+
*
|
|
203
|
+
* Specifying both a `'listening'` event listener and passing a
|
|
204
|
+
* `callback` to the `socket.bind()` method is not harmful but not very
|
|
205
|
+
* useful.
|
|
206
|
+
*
|
|
207
|
+
* The `options` object may contain an additional `exclusive` property that is
|
|
208
|
+
* used when using `dgram.Socket` objects with the [`cluster`](https://nodejs.org/docs/latest-v24.x/api/cluster.html) module. When
|
|
209
|
+
* `exclusive` is set to `false` (the default), cluster workers will use the same
|
|
210
|
+
* underlying socket handle allowing connection handling duties to be shared.
|
|
211
|
+
* When `exclusive` is `true`, however, the handle is not shared and attempted
|
|
212
|
+
* port sharing results in an error. Creating a `dgram.Socket` with the `reusePort`
|
|
213
|
+
* option set to `true` causes `exclusive` to always be `true` when `socket.bind()`
|
|
214
|
+
* is called.
|
|
215
|
+
*
|
|
216
|
+
* A bound datagram socket keeps the Node.js process running to receive
|
|
217
|
+
* datagram messages.
|
|
218
|
+
*
|
|
219
|
+
* If binding fails, an `'error'` event is generated. In rare case (e.g.
|
|
220
|
+
* attempting to bind with a closed socket), an `Error` may be thrown.
|
|
221
|
+
*
|
|
222
|
+
* An example socket listening on an exclusive port is shown below.
|
|
223
|
+
*
|
|
224
|
+
* ```js
|
|
225
|
+
* socket.bind({
|
|
226
|
+
* address: 'localhost',
|
|
227
|
+
* port: 8000,
|
|
228
|
+
* exclusive: true,
|
|
229
|
+
* });
|
|
230
|
+
* ```
|
|
231
|
+
* @since v0.11.14
|
|
232
|
+
* @param options Required. Supports the following properties:
|
|
233
|
+
*/
|
|
182
234
|
bind(options: BindOptions, callback?: () => void): this;
|
|
235
|
+
/**
|
|
236
|
+
* The synchronous counterpart of `socket.bind()`. `bind(2)` is a local,
|
|
237
|
+
* non-blocking system call, so the bind is performed inline and the resolved
|
|
238
|
+
* address is returned immediately, including the operating-system-assigned
|
|
239
|
+
* ephemeral port when `port` is `0`:
|
|
240
|
+
*
|
|
241
|
+
* ```js
|
|
242
|
+
* const dgram = require('node:dgram');
|
|
243
|
+
*
|
|
244
|
+
* const socket = dgram.createSocket('udp4');
|
|
245
|
+
* const address = socket.bindSync({ address: '0.0.0.0', port: 0 });
|
|
246
|
+
* console.log(address); // e.g. { address: '0.0.0.0', family: 'IPv4', port: 53124 }
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* A bind failure such as `EADDRINUSE` is thrown synchronously rather than emitted
|
|
250
|
+
* as an `'error'` event. After `bindSync()` returns, `socket.address()` is
|
|
251
|
+
* valid synchronously and the `'listening'` event is emitted on the next tick.
|
|
252
|
+
*
|
|
253
|
+
* `address` must be a numeric IP literal; `bindSync()` never performs DNS
|
|
254
|
+
* resolution (asynchronous name resolution being the only genuinely blocking part
|
|
255
|
+
* of binding). Incoming datagrams continue to be delivered asynchronously via the
|
|
256
|
+
* `'message'` event. `bindSync()` always binds the socket's own handle and
|
|
257
|
+
* does not participate in [`cluster`](https://nodejs.org/docs/latest-v24.x/api/cluster.html) handle sharing.
|
|
258
|
+
* @since v24.19.0
|
|
259
|
+
* @returns The bound address as returned by `socket.address()`.
|
|
260
|
+
*/
|
|
261
|
+
bindSync(options?: BindSyncOptions): AddressInfo;
|
|
183
262
|
/**
|
|
184
263
|
* Close the underlying socket and stop listening for data on it. If a callback is
|
|
185
264
|
* provided, it is added as a listener for the `'close'` event.
|
|
@@ -202,6 +281,42 @@ declare module "dgram" {
|
|
|
202
281
|
*/
|
|
203
282
|
connect(port: number, address?: string, callback?: () => void): void;
|
|
204
283
|
connect(port: number, callback: () => void): void;
|
|
284
|
+
/**
|
|
285
|
+
* The synchronous counterpart of `socket.connect()`. For a UDP socket
|
|
286
|
+
* `connect(2)` only records the default peer address and is a local, non-blocking
|
|
287
|
+
* system call, so the association is performed inline. Any error raised by the
|
|
288
|
+
* call itself (for example `EAFNOSUPPORT` for a mismatched address family) is
|
|
289
|
+
* thrown synchronously rather than reported via the `'error'` event. Because
|
|
290
|
+
* `connect(2)` does not probe reachability, errors such as `ECONNREFUSED` are
|
|
291
|
+
* still surfaced asynchronously on a later send or receive, exactly as for
|
|
292
|
+
* `socket.connect()`:
|
|
293
|
+
*
|
|
294
|
+
* ```js
|
|
295
|
+
* const dgram = require('node:dgram');
|
|
296
|
+
*
|
|
297
|
+
* const socket = dgram.createSocket('udp4');
|
|
298
|
+
* socket.connectSync(41234, '127.0.0.1');
|
|
299
|
+
* console.log(socket.remoteAddress()); // { address: '127.0.0.1', family: 'IPv4', port: 41234 }
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* If the socket is still unbound it is bound synchronously first. After
|
|
303
|
+
* `connectSync()` returns, `socket.remoteAddress()` is valid synchronously
|
|
304
|
+
* and the `'connect'` event is emitted on the next tick. Trying to call
|
|
305
|
+
* `connectSync()` on an already connected socket throws an
|
|
306
|
+
* `ERR_SOCKET_DGRAM_IS_CONNECTED` exception, and calling it while an
|
|
307
|
+
* asynchronous `socket.bind()` is still in progress throws an
|
|
308
|
+
* `ERR_SOCKET_ALREADY_BOUND` exception.
|
|
309
|
+
*
|
|
310
|
+
* `address` must be a numeric IP literal; `connectSync()` never performs DNS
|
|
311
|
+
* resolution (asynchronous name resolution being the only genuinely blocking part
|
|
312
|
+
* of connecting).
|
|
313
|
+
* @since v24.19.0
|
|
314
|
+
* @param address A numeric IP address to connect to. Unlike
|
|
315
|
+
* `socket.connect()`, no DNS resolution is performed, so a host name is not
|
|
316
|
+
* accepted. If omitted, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for
|
|
317
|
+
* `udp6` sockets) is used.
|
|
318
|
+
*/
|
|
319
|
+
connectSync(port: number, address?: string): void;
|
|
205
320
|
/**
|
|
206
321
|
* A synchronous function that disassociates a connected `dgram.Socket` from
|
|
207
322
|
* its remote address. Trying to call `disconnect()` on an unbound or already
|
|
@@ -189,7 +189,7 @@ declare module "dns/promises" {
|
|
|
189
189
|
* refresh: 900,
|
|
190
190
|
* retry: 900,
|
|
191
191
|
* expire: 1800,
|
|
192
|
-
* minttl: 60 } ]
|
|
192
|
+
* minttl: 60 } ];
|
|
193
193
|
* ```
|
|
194
194
|
* @since v10.6.0
|
|
195
195
|
*/
|
|
@@ -232,7 +232,7 @@ declare module "dns/promises" {
|
|
|
232
232
|
* regexp: '',
|
|
233
233
|
* replacement: '_sip._udp.example.com',
|
|
234
234
|
* order: 30,
|
|
235
|
-
* preference: 100
|
|
235
|
+
* preference: 100,
|
|
236
236
|
* }
|
|
237
237
|
* ```
|
|
238
238
|
* @since v10.6.0
|
|
@@ -271,7 +271,7 @@ declare module "dns/promises" {
|
|
|
271
271
|
* refresh: 10000,
|
|
272
272
|
* retry: 2400,
|
|
273
273
|
* expire: 604800,
|
|
274
|
-
* minttl: 3600
|
|
274
|
+
* minttl: 3600,
|
|
275
275
|
* }
|
|
276
276
|
* ```
|
|
277
277
|
* @since v10.6.0
|
|
@@ -291,7 +291,7 @@ declare module "dns/promises" {
|
|
|
291
291
|
* priority: 10,
|
|
292
292
|
* weight: 5,
|
|
293
293
|
* port: 21223,
|
|
294
|
-
* name: 'service.example.com'
|
|
294
|
+
* name: 'service.example.com',
|
|
295
295
|
* }
|
|
296
296
|
* ```
|
|
297
297
|
* @since v10.6.0
|
|
@@ -312,7 +312,7 @@ declare module "dns/promises" {
|
|
|
312
312
|
* certUsage: 3,
|
|
313
313
|
* selector: 1,
|
|
314
314
|
* match: 1,
|
|
315
|
-
* data: [ArrayBuffer]
|
|
315
|
+
* data: [ArrayBuffer],
|
|
316
316
|
* }
|
|
317
317
|
* ```
|
|
318
318
|
* @since v23.9.0, v22.15.0
|
|
@@ -81,7 +81,7 @@ declare module "dns" {
|
|
|
81
81
|
*/
|
|
82
82
|
all?: boolean | undefined;
|
|
83
83
|
/**
|
|
84
|
-
* When `verbatim`, the resolved addresses are
|
|
84
|
+
* When `verbatim`, the resolved addresses are returned unsorted. When `ipv4first`, the resolved addresses are sorted
|
|
85
85
|
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
|
|
86
86
|
* addresses before IPv4 addresses. Default value is configurable using
|
|
87
87
|
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder).
|
|
@@ -539,7 +539,7 @@ declare module "dns" {
|
|
|
539
539
|
* regexp: '',
|
|
540
540
|
* replacement: '_sip._udp.example.com',
|
|
541
541
|
* order: 30,
|
|
542
|
-
* preference: 100
|
|
542
|
+
* preference: 100,
|
|
543
543
|
* }
|
|
544
544
|
* ```
|
|
545
545
|
* @since v0.9.12
|
|
@@ -596,7 +596,7 @@ declare module "dns" {
|
|
|
596
596
|
* refresh: 10000,
|
|
597
597
|
* retry: 2400,
|
|
598
598
|
* expire: 604800,
|
|
599
|
-
* minttl: 3600
|
|
599
|
+
* minttl: 3600,
|
|
600
600
|
* }
|
|
601
601
|
* ```
|
|
602
602
|
* @since v0.11.10
|
|
@@ -622,7 +622,7 @@ declare module "dns" {
|
|
|
622
622
|
* priority: 10,
|
|
623
623
|
* weight: 5,
|
|
624
624
|
* port: 21223,
|
|
625
|
-
* name: 'service.example.com'
|
|
625
|
+
* name: 'service.example.com',
|
|
626
626
|
* }
|
|
627
627
|
* ```
|
|
628
628
|
* @since v0.1.27
|
|
@@ -649,7 +649,7 @@ declare module "dns" {
|
|
|
649
649
|
* certUsage: 3,
|
|
650
650
|
* selector: 1,
|
|
651
651
|
* match: 1,
|
|
652
|
-
* data: [ArrayBuffer]
|
|
652
|
+
* data: [ArrayBuffer],
|
|
653
653
|
* }
|
|
654
654
|
* ```
|
|
655
655
|
* @since v23.9.0, v22.15.0
|
|
@@ -699,7 +699,7 @@ declare module "dns" {
|
|
|
699
699
|
* refresh: 900,
|
|
700
700
|
* retry: 900,
|
|
701
701
|
* expire: 1800,
|
|
702
|
-
* minttl: 60 } ]
|
|
702
|
+
* minttl: 60 } ];
|
|
703
703
|
* ```
|
|
704
704
|
*
|
|
705
705
|
* DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see
|
|
@@ -278,23 +278,17 @@ declare module "events" {
|
|
|
278
278
|
options?: StaticEventEmitterIteratorOptions,
|
|
279
279
|
): NodeJS.AsyncIterator<any[]>;
|
|
280
280
|
/**
|
|
281
|
-
*
|
|
281
|
+
* Returns the number of registered listeners for the event named `eventName`.
|
|
282
282
|
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
283
|
+
* For `EventEmitter`s this behaves exactly the same as calling `.listenerCount`
|
|
284
|
+
* on the emitter.
|
|
285
285
|
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* myEmitter.on('event', () => {});
|
|
289
|
-
* console.log(listenerCount(myEmitter, 'event'));
|
|
290
|
-
* // Prints: 2
|
|
291
|
-
* ```
|
|
286
|
+
* For `EventTarget`s this is the only way to obtain the listener count. This can
|
|
287
|
+
* be useful for debugging and diagnostic purposes.
|
|
292
288
|
* @since v0.9.12
|
|
293
|
-
* @deprecated Since v3.2.0 - Use `listenerCount` instead.
|
|
294
|
-
* @param emitter The emitter to query
|
|
295
|
-
* @param eventName The event name
|
|
296
289
|
*/
|
|
297
|
-
static listenerCount(emitter:
|
|
290
|
+
static listenerCount(emitter: EventEmitter, eventName: string | symbol): number;
|
|
291
|
+
static listenerCount(emitter: EventTarget, eventName: string): number;
|
|
298
292
|
/**
|
|
299
293
|
* Returns a copy of the array of listeners for the event named `eventName`.
|
|
300
294
|
*
|
|
@@ -386,15 +380,12 @@ declare module "events" {
|
|
|
386
380
|
* import { addAbortListener } from 'node:events';
|
|
387
381
|
*
|
|
388
382
|
* function example(signal) {
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* } finally {
|
|
396
|
-
* disposable?.[Symbol.dispose]();
|
|
397
|
-
* }
|
|
383
|
+
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
|
|
384
|
+
* // addAbortListener() returns a disposable, so the `using` keyword ensures
|
|
385
|
+
* // the abort listener is automatically removed when this scope exits.
|
|
386
|
+
* using _ = addAbortListener(signal, (e) => {
|
|
387
|
+
* // Do something when signal is aborted.
|
|
388
|
+
* });
|
|
398
389
|
* }
|
|
399
390
|
* ```
|
|
400
391
|
* @since v20.5.0
|