cloudstructs 0.1.41 → 0.2.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.
Files changed (179) hide show
  1. package/.gitattributes +19 -19
  2. package/.jsii +2754 -1559
  3. package/API.md +77 -77
  4. package/README.md +2 -3
  5. package/lib/codecommit-mirror/index.d.ts +6 -6
  6. package/lib/codecommit-mirror/index.js +13 -12
  7. package/lib/ecs-service-roller/index.d.ts +5 -5
  8. package/lib/ecs-service-roller/index.js +10 -9
  9. package/lib/email-receiver/receiver.d.ts +5 -5
  10. package/lib/email-receiver/receiver.js +15 -14
  11. package/lib/saml-identity-provider/index.d.ts +18 -18
  12. package/lib/saml-identity-provider/index.js +16 -15
  13. package/lib/slack-events/index.d.ts +5 -4
  14. package/lib/slack-events/index.js +13 -14
  15. package/lib/slack-textract/index.d.ts +6 -5
  16. package/lib/slack-textract/index.js +12 -11
  17. package/lib/state-machine-cr-provider/index.d.ts +2 -1
  18. package/lib/state-machine-cr-provider/index.js +14 -13
  19. package/lib/static-website/index.d.ts +6 -6
  20. package/lib/static-website/index.js +16 -15
  21. package/lib/url-shortener/index.d.ts +8 -7
  22. package/lib/url-shortener/index.js +19 -18
  23. package/node_modules/@slack/logger/node_modules/@types/node/README.md +2 -2
  24. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1 -1
  25. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +19 -16
  26. package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +5 -0
  27. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +51 -3
  28. package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +8 -8
  29. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  30. package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +11 -0
  31. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +11 -0
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +90 -3
  33. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +92 -39
  34. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +17 -6
  35. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +2 -3
  36. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +7 -0
  37. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +2 -2
  38. package/node_modules/@slack/logger/node_modules/@types/node/package.json +8 -13
  39. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +5 -1
  40. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +1 -0
  41. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +385 -0
  42. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +26 -6
  43. package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +1 -3
  44. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +24 -1
  45. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +31 -0
  46. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
  47. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1 -1
  48. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +19 -16
  49. package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +5 -0
  50. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +51 -3
  51. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +8 -8
  52. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  53. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +11 -0
  54. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +11 -0
  55. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +90 -3
  56. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +92 -39
  57. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +17 -6
  58. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +2 -3
  59. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +7 -0
  60. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +2 -2
  61. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +8 -13
  62. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +5 -1
  63. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +1 -0
  64. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +385 -0
  65. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +26 -6
  66. package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +1 -3
  67. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +24 -1
  68. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +31 -0
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1 -1
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +19 -16
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +5 -0
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +51 -3
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +8 -8
  75. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  76. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +11 -0
  77. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +11 -0
  78. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +90 -3
  79. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +92 -39
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +17 -6
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +2 -3
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +7 -0
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +2 -2
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +8 -13
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +5 -1
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +1 -0
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +385 -0
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +26 -6
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +1 -3
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +24 -1
  91. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +31 -0
  92. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +2 -2
  93. package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1 -1
  94. package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +19 -16
  95. package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +5 -0
  96. package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +51 -3
  97. package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +8 -8
  98. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  99. package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +11 -0
  100. package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +11 -0
  101. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +90 -3
  102. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +92 -39
  103. package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +17 -6
  104. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +2 -3
  105. package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +7 -0
  106. package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +2 -2
  107. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +8 -13
  108. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +5 -1
  109. package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +1 -0
  110. package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +385 -0
  111. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +26 -6
  112. package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +1 -3
  113. package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +24 -1
  114. package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +31 -0
  115. package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
  116. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1 -1
  117. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +19 -16
  118. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +5 -0
  119. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +51 -3
  120. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +8 -8
  121. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +11 -0
  123. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +11 -0
  124. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +90 -3
  125. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +92 -39
  126. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +17 -6
  127. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +2 -3
  128. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +7 -0
  129. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +2 -2
  130. package/node_modules/@types/keyv/node_modules/@types/node/package.json +8 -13
  131. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +5 -1
  132. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +1 -0
  133. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +385 -0
  134. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +26 -6
  135. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +1 -3
  136. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +24 -1
  137. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +31 -0
  138. package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
  139. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1 -1
  140. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +19 -16
  141. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +5 -0
  142. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +51 -3
  143. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +8 -8
  144. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +6 -0
  145. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +11 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +11 -0
  147. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +90 -3
  148. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +92 -39
  149. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +17 -6
  150. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +2 -3
  151. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +7 -0
  152. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +2 -2
  153. package/node_modules/@types/responselike/node_modules/@types/node/package.json +8 -13
  154. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +5 -1
  155. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +1 -0
  156. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +385 -0
  157. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +26 -6
  158. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +1 -3
  159. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +24 -1
  160. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +31 -0
  161. package/node_modules/follow-redirects/index.js +45 -14
  162. package/node_modules/follow-redirects/package.json +1 -1
  163. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +1 -1
  164. package/node_modules/got/dist/source/as-promise/types.js +2 -0
  165. package/node_modules/got/dist/source/core/index.d.ts +1 -1
  166. package/node_modules/got/dist/source/core/index.js +9 -3
  167. package/node_modules/got/dist/source/types.d.ts +14 -12
  168. package/node_modules/got/package.json +2 -2
  169. package/node_modules/got/readme.md +11 -10
  170. package/node_modules/keyv/LICENSE +1 -1
  171. package/node_modules/keyv/README.md +12 -10
  172. package/node_modules/keyv/package.json +17 -12
  173. package/node_modules/keyv/src/index.js +14 -16
  174. package/node_modules/mime-db/HISTORY.md +13 -0
  175. package/node_modules/mime-db/db.json +54 -0
  176. package/node_modules/mime-db/package.json +7 -7
  177. package/node_modules/mime-types/HISTORY.md +13 -3
  178. package/node_modules/mime-types/package.json +7 -7
  179. package/package.json +29 -80
@@ -394,6 +394,11 @@ declare module 'node:console' {
394
394
  ignoreErrors?: boolean | undefined;
395
395
  colorMode?: boolean | 'auto' | undefined;
396
396
  inspectOptions?: InspectOptions | undefined;
397
+ /**
398
+ * Set group indentation
399
+ * @default 2
400
+ */
401
+ groupIndentation?: number | undefined;
397
402
  }
398
403
  interface ConsoleConstructor {
399
404
  prototype: Console;
@@ -250,7 +250,7 @@ declare module 'crypto' {
250
250
  */
251
251
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
252
252
  // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
253
- type BinaryToTextEncoding = 'base64' | 'hex';
253
+ type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex';
254
254
  type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
255
255
  type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
256
256
  type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
@@ -1167,6 +1167,26 @@ declare module 'crypto' {
1167
1167
  },
1168
1168
  callback: (err: Error | null, key: KeyObject) => void
1169
1169
  ): void;
1170
+ /**
1171
+ * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
1172
+ *
1173
+ * ```js
1174
+ * const {
1175
+ * generateKeySync
1176
+ * } = await import('crypto');
1177
+ *
1178
+ * const key = generateKeySync('hmac', { length: 64 });
1179
+ * console.log(key.export().toString('hex')); // e89..........41e
1180
+ * ```
1181
+ * @since v15.0.0
1182
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1183
+ */
1184
+ function generateKeySync(
1185
+ type: 'hmac' | 'aes',
1186
+ options: {
1187
+ length: number;
1188
+ }
1189
+ ): KeyObject;
1170
1190
  interface JsonWebKeyInput {
1171
1191
  key: JsonWebKey;
1172
1192
  format: 'jwk';
@@ -2140,7 +2160,7 @@ declare module 'crypto' {
2140
2160
  key: BinaryLike,
2141
2161
  curve: string,
2142
2162
  inputEncoding?: BinaryToTextEncoding,
2143
- outputEncoding?: 'latin1' | 'hex' | 'base64',
2163
+ outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url',
2144
2164
  format?: 'uncompressed' | 'compressed' | 'hybrid'
2145
2165
  ): Buffer | string;
2146
2166
  /**
@@ -2259,7 +2279,7 @@ declare module 'crypto' {
2259
2279
  interface X448KeyPairKeyObjectOptions {}
2260
2280
  interface ECKeyPairKeyObjectOptions {
2261
2281
  /**
2262
- * Name of the curve to use.
2282
+ * Name of the curve to use
2263
2283
  */
2264
2284
  namedCurve: string;
2265
2285
  }
@@ -2269,6 +2289,7 @@ declare module 'crypto' {
2269
2289
  */
2270
2290
  modulusLength: number;
2271
2291
  /**
2292
+ * Public exponent
2272
2293
  * @default 0x10001
2273
2294
  */
2274
2295
  publicExponent?: number | undefined;
@@ -2279,9 +2300,22 @@ declare module 'crypto' {
2279
2300
  */
2280
2301
  modulusLength: number;
2281
2302
  /**
2303
+ * Public exponent
2282
2304
  * @default 0x10001
2283
2305
  */
2284
2306
  publicExponent?: number | undefined;
2307
+ /**
2308
+ * Name of the message digest
2309
+ */
2310
+ hashAlgorithm?: string;
2311
+ /**
2312
+ * Name of the message digest used by MGF1
2313
+ */
2314
+ mgf1HashAlgorithm?: string;
2315
+ /**
2316
+ * Minimal salt length in bytes
2317
+ */
2318
+ saltLength?: string;
2285
2319
  }
2286
2320
  interface DSAKeyPairKeyObjectOptions {
2287
2321
  /**
@@ -2299,6 +2333,7 @@ declare module 'crypto' {
2299
2333
  */
2300
2334
  modulusLength: number;
2301
2335
  /**
2336
+ * Public exponent
2302
2337
  * @default 0x10001
2303
2338
  */
2304
2339
  publicExponent?: number | undefined;
@@ -2316,9 +2351,22 @@ declare module 'crypto' {
2316
2351
  */
2317
2352
  modulusLength: number;
2318
2353
  /**
2354
+ * Public exponent
2319
2355
  * @default 0x10001
2320
2356
  */
2321
2357
  publicExponent?: number | undefined;
2358
+ /**
2359
+ * Name of the message digest
2360
+ */
2361
+ hashAlgorithm?: string;
2362
+ /**
2363
+ * Name of the message digest used by MGF1
2364
+ */
2365
+ mgf1HashAlgorithm?: string;
2366
+ /**
2367
+ * Minimal salt length in bytes
2368
+ */
2369
+ saltLength?: string;
2322
2370
  publicKeyEncoding: {
2323
2371
  type: 'spki';
2324
2372
  format: PubF;
@@ -166,17 +166,17 @@ declare module 'dgram' {
166
166
  * @since v0.1.99
167
167
  * @param callback with no parameters. Called when binding is complete.
168
168
  */
169
- bind(port?: number, address?: string, callback?: () => void): void;
170
- bind(port?: number, callback?: () => void): void;
171
- bind(callback?: () => void): void;
172
- bind(options: BindOptions, callback?: () => void): void;
169
+ bind(port?: number, address?: string, callback?: () => void): this;
170
+ bind(port?: number, callback?: () => void): this;
171
+ bind(callback?: () => void): this;
172
+ bind(options: BindOptions, callback?: () => void): this;
173
173
  /**
174
174
  * Close the underlying socket and stop listening for data on it. If a callback is
175
175
  * provided, it is added as a listener for the `'close'` event.
176
176
  * @since v0.1.99
177
177
  * @param callback Called when the socket has been closed.
178
178
  */
179
- close(callback?: () => void): void;
179
+ close(callback?: () => void): this;
180
180
  /**
181
181
  * Associates the `dgram.Socket` to a remote address and port. Every
182
182
  * message sent by this handle is automatically sent to that destination. Also,
@@ -414,7 +414,7 @@ declare module 'dgram' {
414
414
  * This method throws `EBADF` if called on an unbound socket.
415
415
  * @since v0.3.8
416
416
  */
417
- setMulticastLoopback(flag: boolean): void;
417
+ setMulticastLoopback(flag: boolean): boolean;
418
418
  /**
419
419
  * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
420
420
  * "Time to Live", in this context it specifies the number of IP hops that a
@@ -427,7 +427,7 @@ declare module 'dgram' {
427
427
  * This method throws `EBADF` if called on an unbound socket.
428
428
  * @since v0.3.8
429
429
  */
430
- setMulticastTTL(ttl: number): void;
430
+ setMulticastTTL(ttl: number): number;
431
431
  /**
432
432
  * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer
433
433
  * in bytes.
@@ -457,7 +457,7 @@ declare module 'dgram' {
457
457
  * This method throws `EBADF` if called on an unbound socket.
458
458
  * @since v0.1.101
459
459
  */
460
- setTTL(ttl: number): void;
460
+ setTTL(ttl: number): number;
461
461
  /**
462
462
  * By default, binding a socket will cause it to block the Node.js process from
463
463
  * exiting as long as the socket is open. The `socket.unref()` method can be used
@@ -37,6 +37,7 @@ declare module 'diagnostics_channel' {
37
37
  * // There are subscribers, prepare and publish message
38
38
  * }
39
39
  * ```
40
+ * @since v15.1.0, v14.17.0
40
41
  * @param name The channel name
41
42
  * @return If there are active subscribers
42
43
  */
@@ -51,6 +52,7 @@ declare module 'diagnostics_channel' {
51
52
  *
52
53
  * const channel = diagnostics_channel.channel('my-channel');
53
54
  * ```
55
+ * @since v15.1.0, v14.17.0
54
56
  * @param name The channel name
55
57
  * @return The named channel object
56
58
  */
@@ -63,6 +65,7 @@ declare module 'diagnostics_channel' {
63
65
  * lookups at publish time, enabling very fast publish speeds and allowing
64
66
  * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
65
67
  * with `new Channel(name)` is not supported.
68
+ * @since v15.1.0, v14.17.0
66
69
  */
67
70
  class Channel {
68
71
  readonly name: string;
@@ -82,6 +85,7 @@ declare module 'diagnostics_channel' {
82
85
  * // There are subscribers, prepare and publish message
83
86
  * }
84
87
  * ```
88
+ * @since v15.1.0, v14.17.0
85
89
  */
86
90
  readonly hasSubscribers: boolean;
87
91
  private constructor(name: string);
@@ -99,6 +103,7 @@ declare module 'diagnostics_channel' {
99
103
  * // Received data
100
104
  * });
101
105
  * ```
106
+ * @since v15.1.0, v14.17.0
102
107
  * @param onMessage The handler to receive channel messages
103
108
  */
104
109
  subscribe(onMessage: ChannelListener): void;
@@ -118,6 +123,7 @@ declare module 'diagnostics_channel' {
118
123
  *
119
124
  * channel.unsubscribe(onMessage);
120
125
  * ```
126
+ * @since v15.1.0, v14.17.0
121
127
  * @param onMessage The previous subscribed handler to remove
122
128
  */
123
129
  unsubscribe(onMessage: ChannelListener): void;
@@ -331,6 +331,17 @@ declare module 'dns/promises' {
331
331
  * @param servers array of `RFC 5952` formatted addresses
332
332
  */
333
333
  function setServers(servers: ReadonlyArray<string>): void;
334
+ /**
335
+ * Set the default value of `verbatim` in {@link lookup}. The value could be:
336
+ * - `ipv4first`: sets default `verbatim` `false`.
337
+ * - `verbatim`: sets default `verbatim` `true`.
338
+ *
339
+ * The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
340
+ * When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
341
+ * @since v14.18.0
342
+ * @param order must be 'ipv4first' or 'verbatim'.
343
+ */
344
+ function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
334
345
  class Resolver {
335
346
  constructor(options?: ResolverOptions);
336
347
  cancel(): void;
@@ -526,6 +526,17 @@ declare module 'dns' {
526
526
  * @since v0.11.3
527
527
  */
528
528
  export function getServers(): string[];
529
+ /**
530
+ * Set the default value of `verbatim` in {@link lookup}. The value could be:
531
+ * - `ipv4first`: sets default `verbatim` `false`.
532
+ * - `verbatim`: sets default `verbatim` `true`.
533
+ *
534
+ * The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
535
+ * When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
536
+ * @since v14.18.0
537
+ * @param order must be 'ipv4first' or 'verbatim'.
538
+ */
539
+ export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
529
540
  // Error codes
530
541
  export const NODATA: string;
531
542
  export const FORMERR: string;
@@ -31,6 +31,8 @@ declare module 'fs/promises' {
31
31
  WatchOptions,
32
32
  WatchEventType,
33
33
  CopyOptions,
34
+ ReadStream,
35
+ WriteStream,
34
36
  } from 'node:fs';
35
37
  interface FileChangeInfo<T extends string | Buffer> {
36
38
  eventType: WatchEventType;
@@ -59,6 +61,20 @@ declare module 'fs/promises' {
59
61
  length?: number | null;
60
62
  position?: number | null;
61
63
  }
64
+ interface CreateReadStreamOptions {
65
+ encoding?: BufferEncoding | null | undefined;
66
+ autoClose?: boolean | undefined;
67
+ emitClose?: boolean | undefined;
68
+ start?: number | undefined;
69
+ end?: number | undefined;
70
+ highWaterMark?: number | undefined;
71
+ }
72
+ interface CreateWriteStreamOptions {
73
+ encoding?: BufferEncoding | null | undefined;
74
+ autoClose?: boolean | undefined;
75
+ emitClose?: boolean | undefined;
76
+ start?: number | undefined;
77
+ }
62
78
  // TODO: Add `EventEmitter` close
63
79
  interface FileHandle {
64
80
  /**
@@ -90,6 +106,77 @@ declare module 'fs/promises' {
90
106
  * @return Fulfills with `undefined` upon success.
91
107
  */
92
108
  chmod(mode: Mode): Promise<void>;
109
+ /**
110
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
111
+ * returned by this method has a default `highWaterMark` of 64 kb.
112
+ *
113
+ * `options` can include `start` and `end` values to read a range of bytes from
114
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
115
+ * start counting at 0, allowed values are in the
116
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is
117
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
118
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
119
+ *
120
+ * If the `FileHandle` points to a character device that only supports blocking
121
+ * reads (such as keyboard or sound card), read operations do not finish until data
122
+ * is available. This can prevent the process from exiting and the stream from
123
+ * closing naturally.
124
+ *
125
+ * By default, the stream will emit a `'close'` event after it has been
126
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
127
+ *
128
+ * ```js
129
+ * import { open } from 'fs/promises';
130
+ *
131
+ * const fd = await open('/dev/input/event0');
132
+ * // Create a stream from some character device.
133
+ * const stream = fd.createReadStream();
134
+ * setTimeout(() => {
135
+ * stream.close(); // This may not close the stream.
136
+ * // Artificially marking end-of-stream, as if the underlying resource had
137
+ * // indicated end-of-file by itself, allows the stream to close.
138
+ * // This does not cancel pending read operations, and if there is such an
139
+ * // operation, the process may still not be able to exit successfully
140
+ * // until it finishes.
141
+ * stream.push(null);
142
+ * stream.read(0);
143
+ * }, 100);
144
+ * ```
145
+ *
146
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
147
+ * there's an error. It is the application's responsibility to close it and make
148
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
149
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
150
+ * automatically.
151
+ *
152
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
153
+ *
154
+ * ```js
155
+ * import { open } from 'fs/promises';
156
+ *
157
+ * const fd = await open('sample.txt');
158
+ * fd.createReadStream({ start: 90, end: 99 });
159
+ * ```
160
+ * @since v16.11.0
161
+ */
162
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
163
+ /**
164
+ * `options` may also include a `start` option to allow writing data at some
165
+ * position past the beginning of the file, allowed values are in the
166
+ * \[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 replacing
167
+ * it may require the `flags` `open` option to be set to `r+` rather than the
168
+ * default `r`. The `encoding` can be any one of those accepted by `Buffer`.
169
+ *
170
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
171
+ * then the file descriptor won't be closed, even if there's an error.
172
+ * It is the application's responsibility to close it and make sure there's no
173
+ * file descriptor leak.
174
+ *
175
+ * By default, the stream will emit a `'close'` event after it has been
176
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
177
+ * @since v16.11.0
178
+ */
179
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
93
180
  /**
94
181
  * Forces all currently queued I/O operations associated with the file to the
95
182
  * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
@@ -114,8 +201,8 @@ declare module 'fs/promises' {
114
201
  * number of bytes read is zero.
115
202
  * @since v10.0.0
116
203
  * @param buffer A buffer that will be filled with the file data read.
117
- * @param [offset=0] The location in the buffer at which to start filling.
118
- * @param [length=buffer.byteLength] The number of bytes to read.
204
+ * @param offset The location in the buffer at which to start filling.
205
+ * @param length The number of bytes to read.
119
206
  * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
120
207
  * integer, the current file position will remain unchanged.
121
208
  * @return Fulfills upon success with an object with two properties:
@@ -928,7 +1015,7 @@ declare module 'fs/promises' {
928
1015
  * @since v12.12.0
929
1016
  * @return Fulfills with an {fs.Dir}.
930
1017
  */
931
- function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
1018
+ function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
932
1019
  /**
933
1020
  * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
934
1021
  *