projen 0.58.13 → 0.58.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +4 -4
- package/README.md +2 -2
- package/docs/api/API.md +1 -1
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/circleci/model.d.ts +1 -1
- package/lib/circleci/model.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose.js +2 -2
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +1 -1
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest-sample.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/renovatebot.js +1 -1
- package/lib/run-task.js +1 -0
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +3 -3
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/README.md +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/assert.d.ts +7 -8
- package/node_modules/xmlbuilder2/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/xmlbuilder2/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/xmlbuilder2/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/xmlbuilder2/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/crypto.d.ts +109 -37
- package/node_modules/xmlbuilder2/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/xmlbuilder2/node_modules/@types/node/fs/promises.d.ts +14 -15
- package/node_modules/xmlbuilder2/node_modules/@types/node/fs.d.ts +21 -39
- package/node_modules/xmlbuilder2/node_modules/@types/node/http.d.ts +69 -23
- package/node_modules/xmlbuilder2/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/xmlbuilder2/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/xmlbuilder2/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/xmlbuilder2/node_modules/@types/node/package.json +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/perf_hooks.d.ts +10 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/process.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/stream.d.ts +39 -15
- package/node_modules/xmlbuilder2/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/xmlbuilder2/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/tls.d.ts +17 -9
- package/node_modules/xmlbuilder2/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/url.d.ts +20 -18
- package/node_modules/xmlbuilder2/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/xmlbuilder2/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/xmlbuilder2/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/xmlbuilder2/node_modules/@types/node/zlib.d.ts +1 -1
- package/package.json +3 -3
|
@@ -13,47 +13,73 @@
|
|
|
13
13
|
* // Prints:
|
|
14
14
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'crypto' {
|
|
19
19
|
import * as stream from 'node:stream';
|
|
20
20
|
import { PeerCertificate } from 'node:tls';
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* SPKAC is a Certificate Signing Request mechanism originally implemented by
|
|
23
|
+
* Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
|
|
24
|
+
*
|
|
25
|
+
* `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
|
|
26
|
+
* should not use this element anymore.
|
|
27
|
+
*
|
|
28
|
+
* The `crypto` module provides the `Certificate` class for working with SPKAC
|
|
29
|
+
* data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
|
|
30
|
+
* implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
|
|
31
|
+
* @since v0.11.8
|
|
32
|
+
*/
|
|
33
|
+
class Certificate {
|
|
22
34
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
35
|
+
* ```js
|
|
36
|
+
* const { Certificate } = await import('crypto');
|
|
37
|
+
* const spkac = getSpkacSomehow();
|
|
38
|
+
* const challenge = Certificate.exportChallenge(spkac);
|
|
39
|
+
* console.log(challenge.toString('utf8'));
|
|
40
|
+
* // Prints: the challenge as a UTF8 string
|
|
41
|
+
* ```
|
|
42
|
+
* @since v9.0.0
|
|
43
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
44
|
+
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
27
45
|
*/
|
|
28
|
-
exportChallenge(spkac: BinaryLike): Buffer;
|
|
46
|
+
static exportChallenge(spkac: BinaryLike): Buffer;
|
|
29
47
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
48
|
+
* ```js
|
|
49
|
+
* const { Certificate } = await import('crypto');
|
|
50
|
+
* const spkac = getSpkacSomehow();
|
|
51
|
+
* const publicKey = Certificate.exportPublicKey(spkac);
|
|
52
|
+
* console.log(publicKey);
|
|
53
|
+
* // Prints: the public key as <Buffer ...>
|
|
54
|
+
* ```
|
|
55
|
+
* @since v9.0.0
|
|
56
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
57
|
+
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
35
58
|
*/
|
|
36
|
-
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
59
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
37
60
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
61
|
+
* ```js
|
|
62
|
+
* import { Buffer } from 'buffer';
|
|
63
|
+
* const { Certificate } = await import('crypto');
|
|
64
|
+
*
|
|
65
|
+
* const spkac = getSpkacSomehow();
|
|
66
|
+
* console.log(Certificate.verifySpkac(Buffer.from(spkac)));
|
|
67
|
+
* // Prints: true or false
|
|
68
|
+
* ```
|
|
69
|
+
* @since v9.0.0
|
|
70
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
71
|
+
* @return `true` if the given `spkac` data structure is valid, `false` otherwise.
|
|
42
72
|
*/
|
|
43
|
-
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
44
|
-
}
|
|
45
|
-
const Certificate: Certificate & {
|
|
46
|
-
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
47
|
-
new (): Certificate;
|
|
48
|
-
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
49
|
-
(): Certificate;
|
|
73
|
+
static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
50
74
|
/**
|
|
75
|
+
* @deprecated
|
|
51
76
|
* @param spkac
|
|
52
77
|
* @returns The challenge component of the `spkac` data structure,
|
|
53
78
|
* which includes a public key and a challenge.
|
|
54
79
|
*/
|
|
55
80
|
exportChallenge(spkac: BinaryLike): Buffer;
|
|
56
81
|
/**
|
|
82
|
+
* @deprecated
|
|
57
83
|
* @param spkac
|
|
58
84
|
* @param encoding The encoding of the spkac string.
|
|
59
85
|
* @returns The public key component of the `spkac` data structure,
|
|
@@ -61,12 +87,13 @@ declare module 'crypto' {
|
|
|
61
87
|
*/
|
|
62
88
|
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
63
89
|
/**
|
|
90
|
+
* @deprecated
|
|
64
91
|
* @param spkac
|
|
65
92
|
* @returns `true` if the given `spkac` data structure is valid,
|
|
66
93
|
* `false` otherwise.
|
|
67
94
|
*/
|
|
68
95
|
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
69
|
-
}
|
|
96
|
+
}
|
|
70
97
|
namespace constants {
|
|
71
98
|
// https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
|
|
72
99
|
const OPENSSL_VERSION_NUMBER: number;
|
|
@@ -172,7 +199,7 @@ declare module 'crypto' {
|
|
|
172
199
|
*
|
|
173
200
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
174
201
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
175
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
202
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
176
203
|
* display the available digest algorithms.
|
|
177
204
|
*
|
|
178
205
|
* Example: generating the sha256 sum of a file
|
|
@@ -212,7 +239,7 @@ declare module 'crypto' {
|
|
|
212
239
|
*
|
|
213
240
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
214
241
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
215
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
242
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
216
243
|
* display the available digest algorithms.
|
|
217
244
|
*
|
|
218
245
|
* The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
|
|
@@ -662,12 +689,13 @@ declare module 'crypto' {
|
|
|
662
689
|
* Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
|
|
663
690
|
*
|
|
664
691
|
* The `options` argument controls stream behavior and is optional except when a
|
|
665
|
-
* cipher in CCM or OCB mode
|
|
692
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
|
666
693
|
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
|
|
667
694
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
695
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
668
696
|
*
|
|
669
697
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
670
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
698
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
671
699
|
* display the available cipher algorithms.
|
|
672
700
|
*
|
|
673
701
|
* The `password` is used to derive the cipher key and initialization vector (IV).
|
|
@@ -700,12 +728,13 @@ declare module 'crypto' {
|
|
|
700
728
|
* initialization vector (`iv`).
|
|
701
729
|
*
|
|
702
730
|
* The `options` argument controls stream behavior and is optional except when a
|
|
703
|
-
* cipher in CCM or OCB mode
|
|
731
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
|
704
732
|
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
|
|
705
733
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
734
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
706
735
|
*
|
|
707
736
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
708
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
737
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
709
738
|
* display the available cipher algorithms.
|
|
710
739
|
*
|
|
711
740
|
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
@@ -925,8 +954,9 @@ declare module 'crypto' {
|
|
|
925
954
|
* Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
|
|
926
955
|
*
|
|
927
956
|
* The `options` argument controls stream behavior and is optional except when a
|
|
928
|
-
* cipher in CCM or OCB mode
|
|
957
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
|
929
958
|
* authentication tag in bytes, see `CCM mode`.
|
|
959
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
930
960
|
*
|
|
931
961
|
* The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
|
|
932
962
|
* function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
|
|
@@ -951,12 +981,13 @@ declare module 'crypto' {
|
|
|
951
981
|
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
|
|
952
982
|
*
|
|
953
983
|
* The `options` argument controls stream behavior and is optional except when a
|
|
954
|
-
* cipher in CCM or OCB mode
|
|
984
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
|
955
985
|
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags
|
|
956
986
|
* to those with the specified length.
|
|
987
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
957
988
|
*
|
|
958
989
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
959
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
990
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
960
991
|
* display the available cipher algorithms.
|
|
961
992
|
*
|
|
962
993
|
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
@@ -2272,7 +2303,8 @@ declare module 'crypto' {
|
|
|
2272
2303
|
* comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
|
|
2273
2304
|
*
|
|
2274
2305
|
* `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
|
|
2275
|
-
* must have the same byte length.
|
|
2306
|
+
* must have the same byte length. An error is thrown if `a` and `b` have
|
|
2307
|
+
* different byte lengths.
|
|
2276
2308
|
*
|
|
2277
2309
|
* If at least one of `a` and `b` is a `TypedArray` with more than one byte per
|
|
2278
2310
|
* entry, such as `Uint16Array`, the result will be computed using the platform
|
|
@@ -3094,12 +3126,16 @@ declare module 'crypto' {
|
|
|
3094
3126
|
*/
|
|
3095
3127
|
class X509Certificate {
|
|
3096
3128
|
/**
|
|
3097
|
-
* Will be \`true\` if this is a Certificate Authority (
|
|
3129
|
+
* Will be \`true\` if this is a Certificate Authority (CA) certificate.
|
|
3098
3130
|
* @since v15.6.0
|
|
3099
3131
|
*/
|
|
3100
3132
|
readonly ca: boolean;
|
|
3101
3133
|
/**
|
|
3102
3134
|
* The SHA-1 fingerprint of this certificate.
|
|
3135
|
+
*
|
|
3136
|
+
* Because SHA-1 is cryptographically broken and because the security of SHA-1 is
|
|
3137
|
+
* significantly worse than that of algorithms that are commonly used to sign
|
|
3138
|
+
* certificates, consider using `x509.fingerprint256` instead.
|
|
3103
3139
|
* @since v15.6.0
|
|
3104
3140
|
*/
|
|
3105
3141
|
readonly fingerprint: string;
|
|
@@ -3158,6 +3194,10 @@ declare module 'crypto' {
|
|
|
3158
3194
|
readonly raw: Buffer;
|
|
3159
3195
|
/**
|
|
3160
3196
|
* The serial number of this certificate.
|
|
3197
|
+
*
|
|
3198
|
+
* Serial numbers are assigned by certificate authorities and do not uniquely
|
|
3199
|
+
* identify certificates. Consider using `x509.fingerprint256` as a unique
|
|
3200
|
+
* identifier instead.
|
|
3161
3201
|
* @since v15.6.0
|
|
3162
3202
|
*/
|
|
3163
3203
|
readonly serialNumber: string;
|
|
@@ -3174,18 +3214,50 @@ declare module 'crypto' {
|
|
|
3174
3214
|
constructor(buffer: BinaryLike);
|
|
3175
3215
|
/**
|
|
3176
3216
|
* Checks whether the certificate matches the given email address.
|
|
3217
|
+
*
|
|
3218
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3219
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3220
|
+
* not exist or does not contain any email addresses.
|
|
3221
|
+
*
|
|
3222
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3223
|
+
* name extension either does not exist or does not contain a matching email
|
|
3224
|
+
* address, the certificate subject is considered.
|
|
3225
|
+
*
|
|
3226
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3227
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3177
3228
|
* @since v15.6.0
|
|
3178
3229
|
* @return Returns `email` if the certificate matches, `undefined` if it does not.
|
|
3179
3230
|
*/
|
|
3180
3231
|
checkEmail(email: string, options?: Pick<X509CheckOptions, 'subject'>): string | undefined;
|
|
3181
3232
|
/**
|
|
3182
3233
|
* Checks whether the certificate matches the given host name.
|
|
3234
|
+
*
|
|
3235
|
+
* If the certificate matches the given host name, the matching subject name is
|
|
3236
|
+
* returned. The returned name might be an exact match (e.g., `foo.example.com`)
|
|
3237
|
+
* or it might contain wildcards (e.g., `*.example.com`). Because host name
|
|
3238
|
+
* comparisons are case-insensitive, the returned subject name might also differ
|
|
3239
|
+
* from the given `name` in capitalization.
|
|
3240
|
+
*
|
|
3241
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3242
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3243
|
+
* not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS").
|
|
3244
|
+
*
|
|
3245
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3246
|
+
* name extension either does not exist or does not contain a matching DNS name,
|
|
3247
|
+
* the certificate subject is considered.
|
|
3248
|
+
*
|
|
3249
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3250
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3183
3251
|
* @since v15.6.0
|
|
3184
|
-
* @return Returns
|
|
3252
|
+
* @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
|
|
3185
3253
|
*/
|
|
3186
3254
|
checkHost(name: string, options?: X509CheckOptions): string | undefined;
|
|
3187
3255
|
/**
|
|
3188
3256
|
* Checks whether the certificate matches the given IP address (IPv4 or IPv6).
|
|
3257
|
+
*
|
|
3258
|
+
* Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
|
|
3259
|
+
* must match the given `ip` address exactly. Other subject alternative names as
|
|
3260
|
+
* well as the subject field of the certificate are ignored.
|
|
3189
3261
|
* @since v15.6.0
|
|
3190
3262
|
* @return Returns `ip` if the certificate matches, `undefined` if it does not.
|
|
3191
3263
|
*/
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* server.bind(41234);
|
|
24
24
|
* // Prints: server listening 0.0.0.0:41234
|
|
25
25
|
* ```
|
|
26
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js)
|
|
27
27
|
*/
|
|
28
28
|
declare module 'dgram' {
|
|
29
29
|
import { AddressInfo } from 'node:net';
|
|
@@ -451,7 +451,7 @@ declare module 'dgram' {
|
|
|
451
451
|
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
|
452
452
|
* Changing TTL values is typically done for network probes or when multicasting.
|
|
453
453
|
*
|
|
454
|
-
* The `ttl` argument may be between
|
|
454
|
+
* The `ttl` argument may be between 1 and 255\. The default on most systems
|
|
455
455
|
* is 64.
|
|
456
456
|
*
|
|
457
457
|
* This method throws `EBADF` if called on an unbound socket.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* should generally include the module name to avoid collisions with data from
|
|
21
21
|
* other modules.
|
|
22
22
|
* @experimental
|
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js)
|
|
24
24
|
*/
|
|
25
25
|
declare module 'diagnostics_channel' {
|
|
26
26
|
/**
|
|
@@ -143,6 +143,7 @@ declare module 'diagnostics_channel' {
|
|
|
143
143
|
* ```
|
|
144
144
|
* @since v15.1.0, v14.17.0
|
|
145
145
|
* @param onMessage The previous subscribed handler to remove
|
|
146
|
+
* @return `true` if the handler was found, `false` otherwise.
|
|
146
147
|
*/
|
|
147
148
|
unsubscribe(onMessage: ChannelListener): void;
|
|
148
149
|
}
|
|
@@ -119,7 +119,7 @@ declare module 'dns/promises' {
|
|
|
119
119
|
*
|
|
120
120
|
* <omitted>
|
|
121
121
|
*
|
|
122
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the DNS error codes
|
|
122
|
+
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
|
|
123
123
|
* @since v10.6.0
|
|
124
124
|
* @param hostname Host name to resolve.
|
|
125
125
|
* @param [rrtype='A'] Resource record type.
|
|
@@ -300,7 +300,7 @@ declare module 'dns/promises' {
|
|
|
300
300
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
|
301
301
|
* array of host names.
|
|
302
302
|
*
|
|
303
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the DNS error codes
|
|
303
|
+
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
|
|
304
304
|
* @since v10.6.0
|
|
305
305
|
*/
|
|
306
306
|
function reverse(ip: string): Promise<string[]>;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
44
|
* See the `Implementation considerations section` for more information.
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js)
|
|
46
46
|
*/
|
|
47
47
|
declare module 'dns' {
|
|
48
48
|
import * as dnsPromises from 'node:dns/promises';
|
|
@@ -244,7 +244,7 @@ declare module 'dns' {
|
|
|
244
244
|
*
|
|
245
245
|
* <omitted>
|
|
246
246
|
*
|
|
247
|
-
* On error, `err` is an `Error` object, where `err.code` is one of
|
|
247
|
+
* On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
|
|
248
248
|
* @since v0.1.27
|
|
249
249
|
* @param hostname Host name to resolve.
|
|
250
250
|
* @param [rrtype='A'] Resource record type.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* **This module is pending deprecation.** Once a replacement API has been
|
|
3
|
-
* finalized, this module will be fully deprecated. Most developers should
|
|
3
|
+
* finalized, this module will be fully deprecated. Most developers should
|
|
4
|
+
* **not** have cause to use this module. Users who absolutely must have
|
|
4
5
|
* the functionality that domains provide may rely on it for the time being
|
|
5
6
|
* but should expect to have to migrate to a different solution
|
|
6
7
|
* in the future.
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
|
12
13
|
* exit immediately with an error code.
|
|
13
14
|
* @deprecated Since v1.4.2 - Deprecated
|
|
14
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js)
|
|
15
16
|
*/
|
|
16
17
|
declare module 'domain' {
|
|
17
18
|
import EventEmitter = require('node:events');
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* });
|
|
33
33
|
* myEmitter.emit('event');
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'events' {
|
|
38
38
|
interface EventEmitterOptions {
|
|
@@ -50,7 +50,7 @@ declare module 'events' {
|
|
|
50
50
|
listener: (...args: any[]) => void,
|
|
51
51
|
opts?: {
|
|
52
52
|
once: boolean;
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
): any;
|
|
55
55
|
}
|
|
56
56
|
interface StaticEventEmitterOptions {
|
|
@@ -154,11 +154,7 @@ declare module 'events' {
|
|
|
154
154
|
* ```
|
|
155
155
|
* @since v11.13.0, v10.16.0
|
|
156
156
|
*/
|
|
157
|
-
static once(
|
|
158
|
-
emitter: NodeEventTarget,
|
|
159
|
-
eventName: string | symbol,
|
|
160
|
-
options?: StaticEventEmitterOptions,
|
|
161
|
-
): Promise<any[]>;
|
|
157
|
+
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
162
158
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
163
159
|
/**
|
|
164
160
|
* ```js
|
|
@@ -218,11 +214,7 @@ declare module 'events' {
|
|
|
218
214
|
* @param eventName The name of the event being listened for
|
|
219
215
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
220
216
|
*/
|
|
221
|
-
static on(
|
|
222
|
-
emitter: NodeJS.EventEmitter,
|
|
223
|
-
eventName: string,
|
|
224
|
-
options?: StaticEventEmitterOptions,
|
|
225
|
-
): AsyncIterableIterator<any>;
|
|
217
|
+
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
|
226
218
|
/**
|
|
227
219
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
228
220
|
*
|
|
@@ -269,23 +261,21 @@ declare module 'events' {
|
|
|
269
261
|
*/
|
|
270
262
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
|
271
263
|
/**
|
|
272
|
-
* By default `EventEmitter`s will print a warning if more than `10` listeners are
|
|
273
|
-
* added for a particular event. This is a useful default that helps finding
|
|
274
|
-
* memory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be
|
|
275
|
-
* modified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.
|
|
276
|
-
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
|
277
|
-
*
|
|
278
264
|
* ```js
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
265
|
+
* const {
|
|
266
|
+
* setMaxListeners,
|
|
267
|
+
* EventEmitter
|
|
268
|
+
* } = require('events');
|
|
269
|
+
*
|
|
270
|
+
* const target = new EventTarget();
|
|
271
|
+
* const emitter = new EventEmitter();
|
|
272
|
+
*
|
|
273
|
+
* setMaxListeners(5, target, emitter);
|
|
287
274
|
* ```
|
|
288
|
-
* @since v15.
|
|
275
|
+
* @since v15.4.0
|
|
276
|
+
* @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
|
|
277
|
+
* @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
|
278
|
+
* objects.
|
|
289
279
|
*/
|
|
290
280
|
static setMaxListeners(n?: number, ...eventTargets: Array<DOMEventTarget | NodeJS.EventEmitter>): void;
|
|
291
281
|
/**
|
|
@@ -164,9 +164,9 @@ declare module 'fs/promises' {
|
|
|
164
164
|
/**
|
|
165
165
|
* `options` may also include a `start` option to allow writing data at some
|
|
166
166
|
* position past the beginning of the file, allowed values are in the
|
|
167
|
-
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
168
|
-
* it may require the `flags` `open` option to be set to `r+` rather than
|
|
169
|
-
* default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
|
167
|
+
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
168
|
+
* replacing it may require the `flags` `open` option to be set to `r+` rather than
|
|
169
|
+
* the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
|
170
170
|
*
|
|
171
171
|
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
|
172
172
|
* then the file descriptor won't be closed, even if there's an error.
|
|
@@ -333,9 +333,8 @@ declare module 'fs/promises' {
|
|
|
333
333
|
/**
|
|
334
334
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
335
335
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
336
|
-
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object
|
|
337
|
-
*
|
|
338
|
-
* property. The promise is resolved with no arguments upon success.
|
|
336
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
337
|
+
* The promise is resolved with no arguments upon success.
|
|
339
338
|
*
|
|
340
339
|
* If `options` is a string, then it specifies the `encoding`.
|
|
341
340
|
*
|
|
@@ -353,20 +352,18 @@ declare module 'fs/promises' {
|
|
|
353
352
|
/**
|
|
354
353
|
* Write `buffer` to the file.
|
|
355
354
|
*
|
|
356
|
-
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
357
|
-
*
|
|
358
355
|
* The promise is resolved with an object containing two properties:
|
|
359
356
|
*
|
|
360
357
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
361
358
|
* without waiting for the promise to be resolved (or rejected). For this
|
|
362
|
-
* scenario, use `
|
|
359
|
+
* scenario, use `filehandle.createWriteStream()`.
|
|
363
360
|
*
|
|
364
361
|
* On Linux, positional writes do not work when the file is opened in append mode.
|
|
365
362
|
* The kernel ignores the position argument and always appends the data to
|
|
366
363
|
* the end of the file.
|
|
367
364
|
* @since v10.0.0
|
|
368
365
|
* @param [offset=0] The start position from within `buffer` where the data to write begins.
|
|
369
|
-
* @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
|
|
366
|
+
* @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
|
|
370
367
|
* @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
|
|
371
368
|
* See the POSIX pwrite(2) documentation for more detail.
|
|
372
369
|
*/
|
|
@@ -432,9 +429,9 @@ declare module 'fs/promises' {
|
|
|
432
429
|
/**
|
|
433
430
|
* Tests a user's permissions for the file or directory specified by `path`.
|
|
434
431
|
* The `mode` argument is an optional integer that specifies the accessibility
|
|
435
|
-
* checks to be performed.
|
|
436
|
-
*
|
|
437
|
-
*
|
|
432
|
+
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
|
|
433
|
+
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
|
434
|
+
* possible values of `mode`.
|
|
438
435
|
*
|
|
439
436
|
* If the accessibility check is successful, the promise is resolved with no
|
|
440
437
|
* value. If any of the accessibility checks fail, the promise is rejected
|
|
@@ -854,7 +851,9 @@ declare module 'fs/promises' {
|
|
|
854
851
|
*/
|
|
855
852
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
|
856
853
|
/**
|
|
857
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a
|
|
854
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
855
|
+
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
856
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
858
857
|
*
|
|
859
858
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
860
859
|
*
|
|
@@ -869,7 +868,7 @@ declare module 'fs/promises' {
|
|
|
869
868
|
*
|
|
870
869
|
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
|
871
870
|
* method that performs multiple `write` calls internally to write the buffer
|
|
872
|
-
* passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
|
|
871
|
+
* passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
|
|
873
872
|
*
|
|
874
873
|
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
|
875
874
|
* Cancelation is "best effort", and some amount of data is likely still
|