cloudstructs 0.5.4 → 0.5.5

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 (160) hide show
  1. package/.jsii +3 -3
  2. package/lib/codecommit-mirror/index.d.ts +0 -1
  3. package/lib/codecommit-mirror/index.js +5 -6
  4. package/lib/ecs-service-roller/index.d.ts +0 -1
  5. package/lib/ecs-service-roller/index.js +5 -6
  6. package/lib/email-receiver/index.d.ts +0 -1
  7. package/lib/email-receiver/receiver.d.ts +0 -1
  8. package/lib/email-receiver/receiver.js +1 -1
  9. package/lib/email-receiver/s3-function.d.ts +0 -1
  10. package/lib/email-receiver/s3.lambda.d.ts +0 -1
  11. package/lib/email-receiver/whitelist-function.d.ts +0 -1
  12. package/lib/email-receiver/whitelist.lambda.d.ts +0 -1
  13. package/lib/index.d.ts +0 -1
  14. package/lib/saml-identity-provider/index.d.ts +0 -1
  15. package/lib/saml-identity-provider/index.js +4 -5
  16. package/lib/slack-app/index.d.ts +0 -1
  17. package/lib/slack-app/manifest.d.ts +0 -1
  18. package/lib/slack-app/manifest.js +33 -35
  19. package/lib/slack-app/provider-function.d.ts +0 -1
  20. package/lib/slack-app/provider.d.ts +0 -1
  21. package/lib/slack-app/provider.js +2 -3
  22. package/lib/slack-app/provider.lambda.d.ts +0 -1
  23. package/lib/slack-app/provider.lambda.js +3 -4
  24. package/lib/slack-app/slack-app.d.ts +0 -1
  25. package/lib/slack-app/slack-app.js +4 -5
  26. package/lib/slack-events/events-function.d.ts +0 -1
  27. package/lib/slack-events/events.lambda.d.ts +0 -1
  28. package/lib/slack-events/index.d.ts +0 -1
  29. package/lib/slack-events/index.js +1 -1
  30. package/lib/slack-events/signature.d.ts +0 -1
  31. package/lib/slack-textract/detect-function.d.ts +0 -1
  32. package/lib/slack-textract/detect.lambda.d.ts +0 -1
  33. package/lib/slack-textract/index.d.ts +0 -1
  34. package/lib/slack-textract/index.js +1 -1
  35. package/lib/state-machine-cr-provider/index.d.ts +0 -1
  36. package/lib/state-machine-cr-provider/index.js +3 -4
  37. package/lib/state-machine-cr-provider/runtime/http.d.ts +0 -1
  38. package/lib/state-machine-cr-provider/runtime/http.js +3 -4
  39. package/lib/state-machine-cr-provider/runtime/index.d.ts +0 -1
  40. package/lib/state-machine-cr-provider/runtime/index.js +5 -7
  41. package/lib/static-website/index.d.ts +0 -1
  42. package/lib/static-website/index.js +3 -4
  43. package/lib/static-website/origin-request-function.d.ts +0 -1
  44. package/lib/static-website/origin-request.edge-lambda.d.ts +0 -1
  45. package/lib/toolkit-cleaner/clean-images-function.d.ts +0 -1
  46. package/lib/toolkit-cleaner/clean-images.lambda.d.ts +0 -1
  47. package/lib/toolkit-cleaner/clean-images.lambda.js +3 -4
  48. package/lib/toolkit-cleaner/clean-objects-function.d.ts +0 -1
  49. package/lib/toolkit-cleaner/clean-objects.lambda.d.ts +0 -1
  50. package/lib/toolkit-cleaner/clean-objects.lambda.js +3 -4
  51. package/lib/toolkit-cleaner/extract-template-hashes-function.d.ts +0 -1
  52. package/lib/toolkit-cleaner/extract-template-hashes.lambda.d.ts +0 -1
  53. package/lib/toolkit-cleaner/get-stack-names-function.d.ts +0 -1
  54. package/lib/toolkit-cleaner/get-stack-names.lambda.d.ts +0 -1
  55. package/lib/toolkit-cleaner/get-stack-names.lambda.js +2 -3
  56. package/lib/toolkit-cleaner/index.d.ts +0 -1
  57. package/lib/toolkit-cleaner/index.js +4 -5
  58. package/lib/url-shortener/index.d.ts +0 -1
  59. package/lib/url-shortener/index.js +4 -5
  60. package/lib/url-shortener/redirect-function.d.ts +0 -1
  61. package/lib/url-shortener/redirect.edge-lambda.d.ts +0 -1
  62. package/lib/url-shortener/redirect.edge-lambda.js +2 -3
  63. package/lib/url-shortener/shortener-function.d.ts +0 -1
  64. package/lib/url-shortener/shortener.lambda.d.ts +0 -1
  65. package/lib/url-shortener/shortener.lambda.js +3 -4
  66. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  67. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +25 -1
  68. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +9 -2
  69. package/node_modules/@slack/logger/node_modules/@types/node/package.json +3 -3
  70. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +12 -11
  71. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +13 -0
  72. package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +2 -2
  73. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +1 -1
  74. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  75. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +25 -1
  76. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +9 -2
  77. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +3 -3
  78. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +12 -11
  79. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +13 -0
  80. package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +2 -2
  81. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +1 -1
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +25 -1
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +9 -2
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +12 -11
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +13 -0
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +2 -2
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1 -1
  90. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +1 -1
  91. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +25 -1
  92. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +9 -2
  93. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +3 -3
  94. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +12 -11
  95. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +13 -0
  96. package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +2 -2
  97. package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +1 -1
  98. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  99. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +25 -1
  100. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +9 -2
  101. package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
  102. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +12 -11
  103. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +13 -0
  104. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +2 -2
  105. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1 -1
  106. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  107. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +25 -1
  108. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +9 -2
  109. package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
  110. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +12 -11
  111. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +13 -0
  112. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +2 -2
  113. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1 -1
  114. package/package.json +10 -10
  115. package/changelog.md +0 -7
  116. package/lib/codecommit-mirror/index.d.ts.map +0 -1
  117. package/lib/ecs-service-roller/index.d.ts.map +0 -1
  118. package/lib/email-receiver/index.d.ts.map +0 -1
  119. package/lib/email-receiver/receiver.d.ts.map +0 -1
  120. package/lib/email-receiver/s3-function.d.ts.map +0 -1
  121. package/lib/email-receiver/s3.lambda.d.ts.map +0 -1
  122. package/lib/email-receiver/whitelist-function.d.ts.map +0 -1
  123. package/lib/email-receiver/whitelist.lambda.d.ts.map +0 -1
  124. package/lib/index.d.ts.map +0 -1
  125. package/lib/saml-identity-provider/index.d.ts.map +0 -1
  126. package/lib/slack-app/index.d.ts.map +0 -1
  127. package/lib/slack-app/manifest.d.ts.map +0 -1
  128. package/lib/slack-app/provider-function.d.ts.map +0 -1
  129. package/lib/slack-app/provider.d.ts.map +0 -1
  130. package/lib/slack-app/provider.lambda.d.ts.map +0 -1
  131. package/lib/slack-app/slack-app.d.ts.map +0 -1
  132. package/lib/slack-events/events-function.d.ts.map +0 -1
  133. package/lib/slack-events/events.lambda.d.ts.map +0 -1
  134. package/lib/slack-events/index.d.ts.map +0 -1
  135. package/lib/slack-events/signature.d.ts.map +0 -1
  136. package/lib/slack-textract/detect-function.d.ts.map +0 -1
  137. package/lib/slack-textract/detect.lambda.d.ts.map +0 -1
  138. package/lib/slack-textract/index.d.ts.map +0 -1
  139. package/lib/state-machine-cr-provider/index.d.ts.map +0 -1
  140. package/lib/state-machine-cr-provider/runtime/http.d.ts.map +0 -1
  141. package/lib/state-machine-cr-provider/runtime/index.d.ts.map +0 -1
  142. package/lib/static-website/index.d.ts.map +0 -1
  143. package/lib/static-website/origin-request-function.d.ts.map +0 -1
  144. package/lib/static-website/origin-request.edge-lambda.d.ts.map +0 -1
  145. package/lib/toolkit-cleaner/clean-images-function.d.ts.map +0 -1
  146. package/lib/toolkit-cleaner/clean-images.lambda.d.ts.map +0 -1
  147. package/lib/toolkit-cleaner/clean-objects-function.d.ts.map +0 -1
  148. package/lib/toolkit-cleaner/clean-objects.lambda.d.ts.map +0 -1
  149. package/lib/toolkit-cleaner/extract-template-hashes-function.d.ts.map +0 -1
  150. package/lib/toolkit-cleaner/extract-template-hashes.lambda.d.ts.map +0 -1
  151. package/lib/toolkit-cleaner/get-stack-names-function.d.ts.map +0 -1
  152. package/lib/toolkit-cleaner/get-stack-names.lambda.d.ts.map +0 -1
  153. package/lib/toolkit-cleaner/index.d.ts.map +0 -1
  154. package/lib/url-shortener/index.d.ts.map +0 -1
  155. package/lib/url-shortener/redirect-function.d.ts.map +0 -1
  156. package/lib/url-shortener/redirect.edge-lambda.d.ts.map +0 -1
  157. package/lib/url-shortener/shortener-function.d.ts.map +0 -1
  158. package/lib/url-shortener/shortener.lambda.d.ts.map +0 -1
  159. package/releasetag.txt +0 -1
  160. package/version.txt +0 -1
@@ -20,6 +20,7 @@ declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
21
  import * as streamPromises from 'node:stream/promises';
22
22
  import * as streamConsumers from 'node:stream/consumers';
23
+ import * as streamWeb from 'node:stream/web';
23
24
  class internal extends EventEmitter {
24
25
  pipe<T extends NodeJS.WritableStream>(
25
26
  destination: T,
@@ -52,11 +53,23 @@ declare module 'stream' {
52
53
  * A utility method for creating Readable Streams out of iterators.
53
54
  */
54
55
  static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
56
+ /**
57
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
58
+ * @since v17.0.0
59
+ * @experimental
60
+ */
61
+ static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick<ReadableOptions, 'encoding' | 'highWaterMark' | 'objectMode' | 'signal'>): Readable;
55
62
  /**
56
63
  * Returns whether the stream has been read from or cancelled.
57
64
  * @since v16.8.0
58
65
  */
59
66
  static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
67
+ /**
68
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
69
+ * @since v17.0.0
70
+ * @experimental
71
+ */
72
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
60
73
  /**
61
74
  * Returns whether the stream was destroyed or errored before emitting `'end'`.
62
75
  * @since v16.8.0
@@ -69,7 +69,7 @@ declare module 'timers' {
69
69
  namespace setTimeout {
70
70
  const __promisify__: typeof setTimeoutPromise;
71
71
  }
72
- function clearTimeout(timeoutId: NodeJS.Timeout | undefined): void;
72
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
73
73
  function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
74
74
  // util.promisify no rest args compability
75
75
  // tslint:disable-next-line void-return
@@ -77,7 +77,7 @@ declare module 'timers' {
77
77
  namespace setInterval {
78
78
  const __promisify__: typeof setIntervalPromise;
79
79
  }
80
- function clearInterval(intervalId: NodeJS.Timeout | undefined): void;
80
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
81
81
  function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
82
82
  // util.promisify no rest args compability
83
83
  // tslint:disable-next-line void-return
@@ -158,7 +158,7 @@ declare module 'tls' {
158
158
  * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
159
159
  * @since v0.11.4
160
160
  */
161
- encrypted: boolean;
161
+ encrypted: true;
162
162
  /**
163
163
  * String containing the selected ALPN protocol.
164
164
  * Before a handshake has completed, this value is always null.
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 19 May 2022 14:01:40 GMT
11
+ * Last updated: Fri, 10 Jun 2022 23:01:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
@@ -11,6 +11,7 @@
11
11
  declare module 'fs/promises' {
12
12
  import { Abortable } from 'node:events';
13
13
  import { Stream } from 'node:stream';
14
+ import { ReadableStream } from 'node:stream/web';
14
15
  import {
15
16
  Stats,
16
17
  BigIntStats,
@@ -209,6 +210,29 @@ declare module 'fs/promises' {
209
210
  */
210
211
  read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
211
212
  read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
213
+ /**
214
+ * Returns a `ReadableStream` that may be used to read the files data.
215
+ *
216
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
217
+ * or closing.
218
+ *
219
+ * ```js
220
+ * import { open } from 'node:fs/promises';
221
+ *
222
+ * const file = await open('./some/file/to/read');
223
+ *
224
+ * for await (const chunk of file.readableWebStream())
225
+ * console.log(chunk);
226
+ *
227
+ * await file.close();
228
+ * ```
229
+ *
230
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
231
+ *
232
+ * @since v17.0.0
233
+ * @experimental
234
+ */
235
+ readableWebStream(): ReadableStream;
212
236
  /**
213
237
  * Asynchronously reads the entire contents of a file.
214
238
  *
@@ -487,7 +511,7 @@ declare module 'fs/promises' {
487
511
  * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
488
512
  * @return Fulfills with a {FileHandle} object.
489
513
  */
490
- function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
514
+ function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
491
515
  /**
492
516
  * Renames `oldPath` to `newPath`.
493
517
  * @since v10.0.0
@@ -1998,12 +1998,19 @@ declare module 'fs' {
1998
1998
  * @param [flags='r'] See `support of file system `flags``.
1999
1999
  * @param [mode=0o666]
2000
2000
  */
2001
- export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2001
+ export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2002
+ /**
2003
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2004
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2005
+ * @param [flags='r'] See `support of file system `flags``.
2006
+ */
2007
+ export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2002
2008
  /**
2003
2009
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2004
2010
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2005
2011
  */
2006
- export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2012
+ export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2013
+
2007
2014
  export namespace open {
2008
2015
  /**
2009
2016
  * Asynchronous open(2) - open and possibly create a file.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "17.0.35",
3
+ "version": "17.0.42",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "6238ccaa7b50cbe1d37bc66eabdea21a4bfb4a7fd6bd780350e84241e2810a00",
224
- "typeScriptVersion": "3.9"
223
+ "typesPublisherContentHash": "a4ad0d317dc8e34f56ab5acf9261717963605b2a6593bd2d18ddb4bae7161f26",
224
+ "typeScriptVersion": "4.0"
225
225
  }
@@ -49,6 +49,7 @@ declare module 'process' {
49
49
  openssl: string;
50
50
  }
51
51
  type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
52
+ type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64';
52
53
  type Signals =
53
54
  | 'SIGABRT'
54
55
  | 'SIGALRM'
@@ -641,7 +642,7 @@ declare module 'process' {
641
642
  * Android).
642
643
  * @since v0.1.31
643
644
  */
644
- getgid(): number;
645
+ getgid?: () => number;
645
646
  /**
646
647
  * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
647
648
  * numeric ID or a group name
@@ -668,7 +669,7 @@ declare module 'process' {
668
669
  * @since v0.1.31
669
670
  * @param id The group name or ID
670
671
  */
671
- setgid(id: number | string): void;
672
+ setgid?: (id: number | string) => void;
672
673
  /**
673
674
  * The `process.getuid()` method returns the numeric user identity of the process.
674
675
  * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
@@ -685,7 +686,7 @@ declare module 'process' {
685
686
  * Android).
686
687
  * @since v0.1.28
687
688
  */
688
- getuid(): number;
689
+ getuid?: () => number;
689
690
  /**
690
691
  * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
691
692
  * numeric ID or a username string.
@@ -711,7 +712,7 @@ declare module 'process' {
711
712
  * This feature is not available in `Worker` threads.
712
713
  * @since v0.1.28
713
714
  */
714
- setuid(id: number | string): void;
715
+ setuid?: (id: number | string) => void;
715
716
  /**
716
717
  * The `process.geteuid()` method returns the numerical effective user identity of
717
718
  * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
@@ -728,7 +729,7 @@ declare module 'process' {
728
729
  * Android).
729
730
  * @since v2.0.0
730
731
  */
731
- geteuid(): number;
732
+ geteuid?: () => number;
732
733
  /**
733
734
  * The `process.seteuid()` method sets the effective user identity of the process.
734
735
  * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
@@ -755,7 +756,7 @@ declare module 'process' {
755
756
  * @since v2.0.0
756
757
  * @param id A user name or ID
757
758
  */
758
- seteuid(id: number | string): void;
759
+ seteuid?: (id: number | string) => void;
759
760
  /**
760
761
  * The `process.getegid()` method returns the numerical effective group identity
761
762
  * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
@@ -772,7 +773,7 @@ declare module 'process' {
772
773
  * Android).
773
774
  * @since v2.0.0
774
775
  */
775
- getegid(): number;
776
+ getegid?: () => number;
776
777
  /**
777
778
  * The `process.setegid()` method sets the effective group identity of the process.
778
779
  * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
@@ -799,7 +800,7 @@ declare module 'process' {
799
800
  * @since v2.0.0
800
801
  * @param id A group name or ID
801
802
  */
802
- setegid(id: number | string): void;
803
+ setegid?: (id: number | string) => void;
803
804
  /**
804
805
  * The `process.getgroups()` method returns an array with the supplementary group
805
806
  * IDs. POSIX leaves it unspecified if the effective group ID is included but
@@ -817,7 +818,7 @@ declare module 'process' {
817
818
  * Android).
818
819
  * @since v0.9.4
819
820
  */
820
- getgroups(): number[];
821
+ getgroups?: () => number[];
821
822
  /**
822
823
  * The `process.setgroups()` method sets the supplementary group IDs for the
823
824
  * Node.js process. This is a privileged operation that requires the Node.js
@@ -843,7 +844,7 @@ declare module 'process' {
843
844
  * This feature is not available in `Worker` threads.
844
845
  * @since v0.9.4
845
846
  */
846
- setgroups(groups: ReadonlyArray<string | number>): void;
847
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
847
848
  /**
848
849
  * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
849
850
  * that will be invoked when an uncaught exception occurs, which will receive the
@@ -1049,7 +1050,7 @@ declare module 'process' {
1049
1050
  * ```
1050
1051
  * @since v0.5.0
1051
1052
  */
1052
- readonly arch: string;
1053
+ readonly arch: Architecture;
1053
1054
  /**
1054
1055
  * The `process.platform` property returns a string identifying the operating
1055
1056
  * system platform on which the Node.js process is running.
@@ -20,6 +20,7 @@ declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
21
  import * as streamPromises from 'node:stream/promises';
22
22
  import * as streamConsumers from 'node:stream/consumers';
23
+ import * as streamWeb from 'node:stream/web';
23
24
  class internal extends EventEmitter {
24
25
  pipe<T extends NodeJS.WritableStream>(
25
26
  destination: T,
@@ -52,11 +53,23 @@ declare module 'stream' {
52
53
  * A utility method for creating Readable Streams out of iterators.
53
54
  */
54
55
  static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
56
+ /**
57
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
58
+ * @since v17.0.0
59
+ * @experimental
60
+ */
61
+ static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick<ReadableOptions, 'encoding' | 'highWaterMark' | 'objectMode' | 'signal'>): Readable;
55
62
  /**
56
63
  * Returns whether the stream has been read from or cancelled.
57
64
  * @since v16.8.0
58
65
  */
59
66
  static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
67
+ /**
68
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
69
+ * @since v17.0.0
70
+ * @experimental
71
+ */
72
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
60
73
  /**
61
74
  * Returns whether the stream was destroyed or errored before emitting `'end'`.
62
75
  * @since v16.8.0
@@ -69,7 +69,7 @@ declare module 'timers' {
69
69
  namespace setTimeout {
70
70
  const __promisify__: typeof setTimeoutPromise;
71
71
  }
72
- function clearTimeout(timeoutId: NodeJS.Timeout | undefined): void;
72
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
73
73
  function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
74
74
  // util.promisify no rest args compability
75
75
  // tslint:disable-next-line void-return
@@ -77,7 +77,7 @@ declare module 'timers' {
77
77
  namespace setInterval {
78
78
  const __promisify__: typeof setIntervalPromise;
79
79
  }
80
- function clearInterval(intervalId: NodeJS.Timeout | undefined): void;
80
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
81
81
  function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
82
82
  // util.promisify no rest args compability
83
83
  // tslint:disable-next-line void-return
@@ -158,7 +158,7 @@ declare module 'tls' {
158
158
  * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
159
159
  * @since v0.11.4
160
160
  */
161
- encrypted: boolean;
161
+ encrypted: true;
162
162
  /**
163
163
  * String containing the selected ALPN protocol.
164
164
  * Before a handshake has completed, this value is always null.
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 19 May 2022 14:01:40 GMT
11
+ * Last updated: Fri, 10 Jun 2022 23:01:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
@@ -11,6 +11,7 @@
11
11
  declare module 'fs/promises' {
12
12
  import { Abortable } from 'node:events';
13
13
  import { Stream } from 'node:stream';
14
+ import { ReadableStream } from 'node:stream/web';
14
15
  import {
15
16
  Stats,
16
17
  BigIntStats,
@@ -209,6 +210,29 @@ declare module 'fs/promises' {
209
210
  */
210
211
  read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
211
212
  read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
213
+ /**
214
+ * Returns a `ReadableStream` that may be used to read the files data.
215
+ *
216
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
217
+ * or closing.
218
+ *
219
+ * ```js
220
+ * import { open } from 'node:fs/promises';
221
+ *
222
+ * const file = await open('./some/file/to/read');
223
+ *
224
+ * for await (const chunk of file.readableWebStream())
225
+ * console.log(chunk);
226
+ *
227
+ * await file.close();
228
+ * ```
229
+ *
230
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
231
+ *
232
+ * @since v17.0.0
233
+ * @experimental
234
+ */
235
+ readableWebStream(): ReadableStream;
212
236
  /**
213
237
  * Asynchronously reads the entire contents of a file.
214
238
  *
@@ -487,7 +511,7 @@ declare module 'fs/promises' {
487
511
  * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
488
512
  * @return Fulfills with a {FileHandle} object.
489
513
  */
490
- function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
514
+ function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
491
515
  /**
492
516
  * Renames `oldPath` to `newPath`.
493
517
  * @since v10.0.0
@@ -1998,12 +1998,19 @@ declare module 'fs' {
1998
1998
  * @param [flags='r'] See `support of file system `flags``.
1999
1999
  * @param [mode=0o666]
2000
2000
  */
2001
- export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2001
+ export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2002
+ /**
2003
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2004
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2005
+ * @param [flags='r'] See `support of file system `flags``.
2006
+ */
2007
+ export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2002
2008
  /**
2003
2009
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2004
2010
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2005
2011
  */
2006
- export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2012
+ export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2013
+
2007
2014
  export namespace open {
2008
2015
  /**
2009
2016
  * Asynchronous open(2) - open and possibly create a file.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "17.0.35",
3
+ "version": "17.0.42",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "6238ccaa7b50cbe1d37bc66eabdea21a4bfb4a7fd6bd780350e84241e2810a00",
224
- "typeScriptVersion": "3.9"
223
+ "typesPublisherContentHash": "a4ad0d317dc8e34f56ab5acf9261717963605b2a6593bd2d18ddb4bae7161f26",
224
+ "typeScriptVersion": "4.0"
225
225
  }
@@ -49,6 +49,7 @@ declare module 'process' {
49
49
  openssl: string;
50
50
  }
51
51
  type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
52
+ type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64';
52
53
  type Signals =
53
54
  | 'SIGABRT'
54
55
  | 'SIGALRM'
@@ -641,7 +642,7 @@ declare module 'process' {
641
642
  * Android).
642
643
  * @since v0.1.31
643
644
  */
644
- getgid(): number;
645
+ getgid?: () => number;
645
646
  /**
646
647
  * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
647
648
  * numeric ID or a group name
@@ -668,7 +669,7 @@ declare module 'process' {
668
669
  * @since v0.1.31
669
670
  * @param id The group name or ID
670
671
  */
671
- setgid(id: number | string): void;
672
+ setgid?: (id: number | string) => void;
672
673
  /**
673
674
  * The `process.getuid()` method returns the numeric user identity of the process.
674
675
  * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
@@ -685,7 +686,7 @@ declare module 'process' {
685
686
  * Android).
686
687
  * @since v0.1.28
687
688
  */
688
- getuid(): number;
689
+ getuid?: () => number;
689
690
  /**
690
691
  * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
691
692
  * numeric ID or a username string.
@@ -711,7 +712,7 @@ declare module 'process' {
711
712
  * This feature is not available in `Worker` threads.
712
713
  * @since v0.1.28
713
714
  */
714
- setuid(id: number | string): void;
715
+ setuid?: (id: number | string) => void;
715
716
  /**
716
717
  * The `process.geteuid()` method returns the numerical effective user identity of
717
718
  * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
@@ -728,7 +729,7 @@ declare module 'process' {
728
729
  * Android).
729
730
  * @since v2.0.0
730
731
  */
731
- geteuid(): number;
732
+ geteuid?: () => number;
732
733
  /**
733
734
  * The `process.seteuid()` method sets the effective user identity of the process.
734
735
  * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
@@ -755,7 +756,7 @@ declare module 'process' {
755
756
  * @since v2.0.0
756
757
  * @param id A user name or ID
757
758
  */
758
- seteuid(id: number | string): void;
759
+ seteuid?: (id: number | string) => void;
759
760
  /**
760
761
  * The `process.getegid()` method returns the numerical effective group identity
761
762
  * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
@@ -772,7 +773,7 @@ declare module 'process' {
772
773
  * Android).
773
774
  * @since v2.0.0
774
775
  */
775
- getegid(): number;
776
+ getegid?: () => number;
776
777
  /**
777
778
  * The `process.setegid()` method sets the effective group identity of the process.
778
779
  * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
@@ -799,7 +800,7 @@ declare module 'process' {
799
800
  * @since v2.0.0
800
801
  * @param id A group name or ID
801
802
  */
802
- setegid(id: number | string): void;
803
+ setegid?: (id: number | string) => void;
803
804
  /**
804
805
  * The `process.getgroups()` method returns an array with the supplementary group
805
806
  * IDs. POSIX leaves it unspecified if the effective group ID is included but
@@ -817,7 +818,7 @@ declare module 'process' {
817
818
  * Android).
818
819
  * @since v0.9.4
819
820
  */
820
- getgroups(): number[];
821
+ getgroups?: () => number[];
821
822
  /**
822
823
  * The `process.setgroups()` method sets the supplementary group IDs for the
823
824
  * Node.js process. This is a privileged operation that requires the Node.js
@@ -843,7 +844,7 @@ declare module 'process' {
843
844
  * This feature is not available in `Worker` threads.
844
845
  * @since v0.9.4
845
846
  */
846
- setgroups(groups: ReadonlyArray<string | number>): void;
847
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
847
848
  /**
848
849
  * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
849
850
  * that will be invoked when an uncaught exception occurs, which will receive the
@@ -1049,7 +1050,7 @@ declare module 'process' {
1049
1050
  * ```
1050
1051
  * @since v0.5.0
1051
1052
  */
1052
- readonly arch: string;
1053
+ readonly arch: Architecture;
1053
1054
  /**
1054
1055
  * The `process.platform` property returns a string identifying the operating
1055
1056
  * system platform on which the Node.js process is running.
@@ -20,6 +20,7 @@ declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
21
  import * as streamPromises from 'node:stream/promises';
22
22
  import * as streamConsumers from 'node:stream/consumers';
23
+ import * as streamWeb from 'node:stream/web';
23
24
  class internal extends EventEmitter {
24
25
  pipe<T extends NodeJS.WritableStream>(
25
26
  destination: T,
@@ -52,11 +53,23 @@ declare module 'stream' {
52
53
  * A utility method for creating Readable Streams out of iterators.
53
54
  */
54
55
  static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
56
+ /**
57
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
58
+ * @since v17.0.0
59
+ * @experimental
60
+ */
61
+ static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick<ReadableOptions, 'encoding' | 'highWaterMark' | 'objectMode' | 'signal'>): Readable;
55
62
  /**
56
63
  * Returns whether the stream has been read from or cancelled.
57
64
  * @since v16.8.0
58
65
  */
59
66
  static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
67
+ /**
68
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
69
+ * @since v17.0.0
70
+ * @experimental
71
+ */
72
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
60
73
  /**
61
74
  * Returns whether the stream was destroyed or errored before emitting `'end'`.
62
75
  * @since v16.8.0
@@ -69,7 +69,7 @@ declare module 'timers' {
69
69
  namespace setTimeout {
70
70
  const __promisify__: typeof setTimeoutPromise;
71
71
  }
72
- function clearTimeout(timeoutId: NodeJS.Timeout | undefined): void;
72
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
73
73
  function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
74
74
  // util.promisify no rest args compability
75
75
  // tslint:disable-next-line void-return
@@ -77,7 +77,7 @@ declare module 'timers' {
77
77
  namespace setInterval {
78
78
  const __promisify__: typeof setIntervalPromise;
79
79
  }
80
- function clearInterval(intervalId: NodeJS.Timeout | undefined): void;
80
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
81
81
  function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
82
82
  // util.promisify no rest args compability
83
83
  // tslint:disable-next-line void-return
@@ -158,7 +158,7 @@ declare module 'tls' {
158
158
  * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
159
159
  * @since v0.11.4
160
160
  */
161
- encrypted: boolean;
161
+ encrypted: true;
162
162
  /**
163
163
  * String containing the selected ALPN protocol.
164
164
  * Before a handshake has completed, this value is always null.
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 19 May 2022 14:01:40 GMT
11
+ * Last updated: Fri, 10 Jun 2022 23:01:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14