cloudstructs 0.9.28 → 0.9.29

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 (136) hide show
  1. package/.jsii +4 -4
  2. package/assets/slack-textract/detect.lambda/index.js +63 -34
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/dmarc/index.js +1 -1
  5. package/lib/ecs-service-roller/index.js +2 -2
  6. package/lib/email-receiver/receiver.js +1 -1
  7. package/lib/mjml-template/index.js +1 -1
  8. package/lib/saml-identity-provider/index.js +2 -2
  9. package/lib/slack-app/manifest.js +1 -1
  10. package/lib/slack-app/slack-app.js +2 -2
  11. package/lib/slack-events/index.js +1 -1
  12. package/lib/slack-textract/index.js +1 -1
  13. package/lib/ssl-server-test/index.js +1 -1
  14. package/lib/state-machine-cr-provider/index.js +1 -1
  15. package/lib/static-website/index.js +1 -1
  16. package/lib/toolkit-cleaner/index.js +1 -1
  17. package/lib/url-shortener/index.js +1 -1
  18. package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +4 -3
  19. package/node_modules/@babel/runtime/helpers/wrapRegExp.js +4 -3
  20. package/node_modules/@babel/runtime/package.json +1 -1
  21. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  22. package/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  23. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +4 -11
  24. package/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +14 -12
  25. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +36 -1
  26. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +4 -4
  27. package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -2
  28. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -1
  29. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +936 -1005
  30. package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  31. package/node_modules/@slack/web-api/README.md +4 -4
  32. package/node_modules/@slack/web-api/dist/WebClient.d.ts +30 -1
  33. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  34. package/node_modules/@slack/web-api/dist/WebClient.js +15 -2
  35. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  36. package/node_modules/@slack/web-api/dist/methods.d.ts +1 -1
  37. package/node_modules/@slack/web-api/dist/methods.js +1 -1
  38. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  39. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  40. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +4 -11
  41. package/node_modules/@slack/web-api/node_modules/@types/node/constants.d.ts +14 -12
  42. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +36 -1
  43. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +4 -4
  44. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  45. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -1
  46. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +936 -1005
  47. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  48. package/node_modules/@slack/web-api/package.json +8 -6
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +4 -11
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +14 -12
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +36 -1
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +4 -4
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -1
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +936 -1005
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  59. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  60. package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  61. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +4 -11
  62. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +14 -12
  63. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +36 -1
  64. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +4 -4
  65. package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -2
  66. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -1
  67. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +936 -1005
  68. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  69. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  70. package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  71. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +4 -11
  72. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +14 -12
  73. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +36 -1
  74. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +4 -4
  75. package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
  76. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -1
  77. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +936 -1005
  78. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  79. package/node_modules/abbrev/package.json +9 -11
  80. package/node_modules/axios/CHANGELOG.md +97 -0
  81. package/node_modules/axios/README.md +35 -13
  82. package/node_modules/axios/dist/axios.js +14 -25
  83. package/node_modules/axios/dist/axios.js.map +1 -1
  84. package/node_modules/axios/dist/axios.min.js +2 -1
  85. package/node_modules/axios/dist/axios.min.js.map +1 -1
  86. package/node_modules/axios/dist/browser/axios.cjs +14 -28
  87. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  88. package/node_modules/axios/dist/esm/axios.js +14 -28
  89. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  90. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  91. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  92. package/node_modules/axios/dist/node/axios.cjs +44 -31
  93. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  94. package/node_modules/axios/index.d.cts +1 -0
  95. package/node_modules/axios/index.d.ts +1 -0
  96. package/node_modules/axios/lib/adapters/http.js +1 -1
  97. package/node_modules/axios/lib/core/Axios.js +10 -1
  98. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  99. package/node_modules/axios/lib/env/data.js +1 -1
  100. package/node_modules/axios/lib/helpers/formDataToStream.js +3 -2
  101. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  102. package/node_modules/axios/lib/platform/node/index.js +26 -0
  103. package/node_modules/axios/lib/utils.js +0 -22
  104. package/node_modules/axios/package.json +4 -4
  105. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +0 -1
  106. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +1 -1
  107. package/node_modules/foreground-child/dist/commonjs/index.d.ts +1 -8
  108. package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +1 -1
  109. package/node_modules/foreground-child/dist/commonjs/index.js +2 -2
  110. package/node_modules/foreground-child/dist/commonjs/index.js.map +1 -1
  111. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +0 -1
  112. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +1 -1
  113. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +0 -1
  114. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +1 -1
  115. package/node_modules/foreground-child/dist/esm/all-signals.d.ts +0 -1
  116. package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +1 -1
  117. package/node_modules/foreground-child/dist/esm/index.d.ts +1 -8
  118. package/node_modules/foreground-child/dist/esm/index.d.ts.map +1 -1
  119. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +0 -1
  120. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +1 -1
  121. package/node_modules/foreground-child/dist/esm/watchdog.d.ts +0 -1
  122. package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +1 -1
  123. package/node_modules/foreground-child/package.json +6 -11
  124. package/node_modules/js-beautify/README.md +8 -8
  125. package/node_modules/js-beautify/package.json +2 -2
  126. package/node_modules/nopt/README.md +8 -9
  127. package/node_modules/nopt/lib/nopt-lib.js +5 -40
  128. package/node_modules/nopt/lib/nopt.js +0 -4
  129. package/node_modules/nopt/package.json +9 -10
  130. package/package.json +19 -19
  131. package/node_modules/axios/SECURITY.md +0 -6
  132. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/index.d.ts +0 -0
  133. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/index.js +0 -0
  134. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/license +0 -0
  135. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/package.json +0 -0
  136. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/readme.md +0 -0
@@ -24,7 +24,7 @@ declare module "buffer" {
24
24
  * @param array The octets to store.
25
25
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
26
26
  */
27
- new(array: Uint8Array): Buffer;
27
+ new(array: ArrayLike<number>): Buffer;
28
28
  /**
29
29
  * Produces a Buffer backed by the same allocated memory as
30
30
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
@@ -33,20 +33,6 @@ declare module "buffer" {
33
33
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
34
34
  */
35
35
  new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
36
- /**
37
- * Allocates a new buffer containing the given {array} of octets.
38
- *
39
- * @param array The octets to store.
40
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
41
- */
42
- new(array: readonly any[]): Buffer;
43
- /**
44
- * Copies the passed {buffer} data onto a new {Buffer} instance.
45
- *
46
- * @param buffer The buffer to copy.
47
- * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
48
- */
49
- new(buffer: Buffer): Buffer;
50
36
  /**
51
37
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
52
38
  * Array entries outside that range will be truncated to fit into it.
@@ -58,40 +44,120 @@ declare module "buffer" {
58
44
  * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
59
45
  * ```
60
46
  *
61
- * If `array` is an `Array`\-like object (that is, one with a `length` property of
47
+ * If `array` is an `Array`-like object (that is, one with a `length` property of
62
48
  * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
63
- * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
49
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an
50
+ * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
51
+ * `Buffer.copyBytesFrom()`.
64
52
  *
65
53
  * A `TypeError` will be thrown if `array` is not an `Array` or another type
66
54
  * appropriate for `Buffer.from()` variants.
67
55
  *
68
- * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
56
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
57
+ * `Buffer` pool like `Buffer.allocUnsafe()` does.
69
58
  * @since v5.10.0
70
59
  */
60
+ from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer;
61
+ /**
62
+ * This creates a view of the `ArrayBuffer` without copying the underlying
63
+ * memory. For example, when passed a reference to the `.buffer` property of a
64
+ * `TypedArray` instance, the newly created `Buffer` will share the same
65
+ * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
66
+ *
67
+ * ```js
68
+ * import { Buffer } from 'node:buffer';
69
+ *
70
+ * const arr = new Uint16Array(2);
71
+ *
72
+ * arr[0] = 5000;
73
+ * arr[1] = 4000;
74
+ *
75
+ * // Shares memory with `arr`.
76
+ * const buf = Buffer.from(arr.buffer);
77
+ *
78
+ * console.log(buf);
79
+ * // Prints: <Buffer 88 13 a0 0f>
80
+ *
81
+ * // Changing the original Uint16Array changes the Buffer also.
82
+ * arr[1] = 6000;
83
+ *
84
+ * console.log(buf);
85
+ * // Prints: <Buffer 88 13 70 17>
86
+ * ```
87
+ *
88
+ * The optional `byteOffset` and `length` arguments specify a memory range within
89
+ * the `arrayBuffer` that will be shared by the `Buffer`.
90
+ *
91
+ * ```js
92
+ * import { Buffer } from 'node:buffer';
93
+ *
94
+ * const ab = new ArrayBuffer(10);
95
+ * const buf = Buffer.from(ab, 0, 2);
96
+ *
97
+ * console.log(buf.length);
98
+ * // Prints: 2
99
+ * ```
100
+ *
101
+ * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
102
+ * `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
103
+ * variants.
104
+ *
105
+ * It is important to remember that a backing `ArrayBuffer` can cover a range
106
+ * of memory that extends beyond the bounds of a `TypedArray` view. A new
107
+ * `Buffer` created using the `buffer` property of a `TypedArray` may extend
108
+ * beyond the range of the `TypedArray`:
109
+ *
110
+ * ```js
111
+ * import { Buffer } from 'node:buffer';
112
+ *
113
+ * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
114
+ * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
115
+ * console.log(arrA.buffer === arrB.buffer); // true
116
+ *
117
+ * const buf = Buffer.from(arrB.buffer);
118
+ * console.log(buf);
119
+ * // Prints: <Buffer 63 64 65 66>
120
+ * ```
121
+ * @since v5.10.0
122
+ * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
123
+ * `.buffer` property of a `TypedArray`.
124
+ * @param byteOffset Index of first byte to expose. **Default:** `0`.
125
+ * @param length Number of bytes to expose. **Default:**
126
+ * `arrayBuffer.byteLength - byteOffset`.
127
+ */
71
128
  from(
72
129
  arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
73
130
  byteOffset?: number,
74
131
  length?: number,
75
132
  ): Buffer;
76
133
  /**
77
- * Creates a new Buffer using the passed {data}
78
- * @param data data to create a new Buffer
79
- */
80
- from(data: Uint8Array | readonly number[]): Buffer;
81
- from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
82
- /**
83
- * Creates a new Buffer containing the given JavaScript string {str}.
84
- * If provided, the {encoding} parameter identifies the character encoding.
85
- * If not provided, {encoding} defaults to 'utf8'.
134
+ * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
135
+ * the character encoding to be used when converting `string` into bytes.
136
+ *
137
+ * ```js
138
+ * import { Buffer } from 'node:buffer';
139
+ *
140
+ * const buf1 = Buffer.from('this is a tést');
141
+ * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
142
+ *
143
+ * console.log(buf1.toString());
144
+ * // Prints: this is a tést
145
+ * console.log(buf2.toString());
146
+ * // Prints: this is a tést
147
+ * console.log(buf1.toString('latin1'));
148
+ * // Prints: this is a tést
149
+ * ```
150
+ *
151
+ * A `TypeError` will be thrown if `string` is not a string or another type
152
+ * appropriate for `Buffer.from()` variants.
153
+ *
154
+ * `Buffer.from(string)` may also use the internal `Buffer` pool like
155
+ * `Buffer.allocUnsafe()` does.
156
+ * @since v5.10.0
157
+ * @param string A string to encode.
158
+ * @param encoding The encoding of `string`. **Default:** `'utf8'`.
86
159
  */
87
- from(
88
- str:
89
- | WithImplicitCoercion<string>
90
- | {
91
- [Symbol.toPrimitive](hint: "string"): string;
92
- },
93
- encoding?: BufferEncoding,
94
- ): Buffer;
160
+ from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer;
95
161
  /**
96
162
  * Creates a new Buffer using the passed {data}
97
163
  * @param values to create a new Buffer
@@ -382,4 +448,10 @@ declare module "buffer" {
382
448
  subarray(start?: number, end?: number): Buffer;
383
449
  }
384
450
  }
451
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
452
+ var SlowBuffer: {
453
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
454
+ new(size: number): Buffer;
455
+ prototype: Buffer;
456
+ };
385
457
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack/web-api",
3
- "version": "7.8.0",
3
+ "version": "7.9.0",
4
4
  "description": "Official library for using the Slack Platform's Web API",
5
5
  "author": "Slack Technologies, LLC",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  "npm": ">= 8.6.0"
14
14
  },
15
15
  "repository": "slackapi/node-slack-sdk",
16
- "homepage": "https://slack.dev/node-slack-sdk/web-api",
16
+ "homepage": "https://tools.slack.dev/node-slack-sdk/web-api",
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
@@ -26,11 +26,11 @@
26
26
  "build:clean": "shx rm -rf ./dist ./coverage",
27
27
  "lint": "npx @biomejs/biome check .",
28
28
  "lint:fix": "npx @biomejs/biome check --write .",
29
- "mocha": "mocha --config .mocharc.json \"./src/**/*.spec.ts\"",
29
+ "mocha": "mocha --config ./test/.mocharc.json \"./src/**/*.spec.ts\"",
30
30
  "test": "npm run lint && npm run test:types && npm run test:integration && npm run test:unit",
31
31
  "test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts",
32
32
  "test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build",
33
- "test:unit": "npm run build && c8 npm run mocha",
33
+ "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha",
34
34
  "test:types": "tsd",
35
35
  "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build"
36
36
  },
@@ -39,7 +39,7 @@
39
39
  "@slack/types": "^2.9.0",
40
40
  "@types/node": ">=18.0.0",
41
41
  "@types/retry": "0.12.0",
42
- "axios": "^1.7.8",
42
+ "axios": "^1.8.3",
43
43
  "eventemitter3": "^5.0.1",
44
44
  "form-data": "^4.0.0",
45
45
  "is-electron": "2.2.2",
@@ -59,8 +59,10 @@
59
59
  "c8": "^10.1.2",
60
60
  "chai": "^4",
61
61
  "mocha": "^11",
62
+ "mocha-junit-reporter": "^2.2.1",
63
+ "mocha-multi-reporters": "^1.5.1",
62
64
  "nock": "^13",
63
- "shx": "^0.3.2",
65
+ "shx": "^0.4.0",
64
66
  "sinon": "^19",
65
67
  "source-map-support": "^0.5.21",
66
68
  "ts-node": "^10",
@@ -8,7 +8,7 @@ This package contains type definitions for node (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: Fri, 21 Feb 2025 20:33:17 GMT
11
+ * Last updated: Sat, 08 Mar 2025 07:02:57 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -1,4 +1,6 @@
1
1
  declare module "buffer" {
2
+ type ImplicitArrayBuffer<T extends WithImplicitCoercion<ArrayBufferLike>> = T extends
3
+ { valueOf(): infer V extends ArrayBufferLike } ? V : T;
2
4
  global {
3
5
  interface BufferConstructor {
4
6
  // see buffer.d.ts for implementation shared with all TypeScript versions
@@ -24,7 +26,7 @@ declare module "buffer" {
24
26
  * @param array The octets to store.
25
27
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
26
28
  */
27
- new(array: Uint8Array): Buffer<ArrayBuffer>;
29
+ new(array: ArrayLike<number>): Buffer<ArrayBuffer>;
28
30
  /**
29
31
  * Produces a Buffer backed by the same allocated memory as
30
32
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
@@ -33,20 +35,6 @@ declare module "buffer" {
33
35
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
34
36
  */
35
37
  new<TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(arrayBuffer: TArrayBuffer): Buffer<TArrayBuffer>;
36
- /**
37
- * Allocates a new buffer containing the given {array} of octets.
38
- *
39
- * @param array The octets to store.
40
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
41
- */
42
- new(array: readonly any[]): Buffer<ArrayBuffer>;
43
- /**
44
- * Copies the passed {buffer} data onto a new {Buffer} instance.
45
- *
46
- * @param buffer The buffer to copy.
47
- * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
48
- */
49
- new(buffer: Buffer): Buffer<ArrayBuffer>;
50
38
  /**
51
39
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
52
40
  * Array entries outside that range will be truncated to fit into it.
@@ -58,40 +46,120 @@ declare module "buffer" {
58
46
  * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
59
47
  * ```
60
48
  *
61
- * If `array` is an `Array`\-like object (that is, one with a `length` property of
49
+ * If `array` is an `Array`-like object (that is, one with a `length` property of
62
50
  * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
63
- * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
51
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an
52
+ * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
53
+ * `Buffer.copyBytesFrom()`.
64
54
  *
65
55
  * A `TypeError` will be thrown if `array` is not an `Array` or another type
66
56
  * appropriate for `Buffer.from()` variants.
67
57
  *
68
- * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
58
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
59
+ * `Buffer` pool like `Buffer.allocUnsafe()` does.
69
60
  * @since v5.10.0
70
61
  */
71
- from<TArrayBuffer extends ArrayBufferLike>(
72
- arrayBuffer: WithImplicitCoercion<TArrayBuffer>,
73
- byteOffset?: number,
74
- length?: number,
75
- ): Buffer<TArrayBuffer>;
62
+ from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer<ArrayBuffer>;
76
63
  /**
77
- * Creates a new Buffer using the passed {data}
78
- * @param data data to create a new Buffer
64
+ * This creates a view of the `ArrayBuffer` without copying the underlying
65
+ * memory. For example, when passed a reference to the `.buffer` property of a
66
+ * `TypedArray` instance, the newly created `Buffer` will share the same
67
+ * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
68
+ *
69
+ * ```js
70
+ * import { Buffer } from 'node:buffer';
71
+ *
72
+ * const arr = new Uint16Array(2);
73
+ *
74
+ * arr[0] = 5000;
75
+ * arr[1] = 4000;
76
+ *
77
+ * // Shares memory with `arr`.
78
+ * const buf = Buffer.from(arr.buffer);
79
+ *
80
+ * console.log(buf);
81
+ * // Prints: <Buffer 88 13 a0 0f>
82
+ *
83
+ * // Changing the original Uint16Array changes the Buffer also.
84
+ * arr[1] = 6000;
85
+ *
86
+ * console.log(buf);
87
+ * // Prints: <Buffer 88 13 70 17>
88
+ * ```
89
+ *
90
+ * The optional `byteOffset` and `length` arguments specify a memory range within
91
+ * the `arrayBuffer` that will be shared by the `Buffer`.
92
+ *
93
+ * ```js
94
+ * import { Buffer } from 'node:buffer';
95
+ *
96
+ * const ab = new ArrayBuffer(10);
97
+ * const buf = Buffer.from(ab, 0, 2);
98
+ *
99
+ * console.log(buf.length);
100
+ * // Prints: 2
101
+ * ```
102
+ *
103
+ * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
104
+ * `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
105
+ * variants.
106
+ *
107
+ * It is important to remember that a backing `ArrayBuffer` can cover a range
108
+ * of memory that extends beyond the bounds of a `TypedArray` view. A new
109
+ * `Buffer` created using the `buffer` property of a `TypedArray` may extend
110
+ * beyond the range of the `TypedArray`:
111
+ *
112
+ * ```js
113
+ * import { Buffer } from 'node:buffer';
114
+ *
115
+ * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
116
+ * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
117
+ * console.log(arrA.buffer === arrB.buffer); // true
118
+ *
119
+ * const buf = Buffer.from(arrB.buffer);
120
+ * console.log(buf);
121
+ * // Prints: <Buffer 63 64 65 66>
122
+ * ```
123
+ * @since v5.10.0
124
+ * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
125
+ * `.buffer` property of a `TypedArray`.
126
+ * @param byteOffset Index of first byte to expose. **Default:** `0`.
127
+ * @param length Number of bytes to expose. **Default:**
128
+ * `arrayBuffer.byteLength - byteOffset`.
79
129
  */
80
- from(data: Uint8Array | readonly number[]): Buffer<ArrayBuffer>;
81
- from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer<ArrayBuffer>;
130
+ from<TArrayBuffer extends WithImplicitCoercion<ArrayBufferLike>>(
131
+ arrayBuffer: TArrayBuffer,
132
+ byteOffset?: number,
133
+ length?: number,
134
+ ): Buffer<ImplicitArrayBuffer<TArrayBuffer>>;
82
135
  /**
83
- * Creates a new Buffer containing the given JavaScript string {str}.
84
- * If provided, the {encoding} parameter identifies the character encoding.
85
- * If not provided, {encoding} defaults to 'utf8'.
136
+ * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
137
+ * the character encoding to be used when converting `string` into bytes.
138
+ *
139
+ * ```js
140
+ * import { Buffer } from 'node:buffer';
141
+ *
142
+ * const buf1 = Buffer.from('this is a tést');
143
+ * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
144
+ *
145
+ * console.log(buf1.toString());
146
+ * // Prints: this is a tést
147
+ * console.log(buf2.toString());
148
+ * // Prints: this is a tést
149
+ * console.log(buf1.toString('latin1'));
150
+ * // Prints: this is a tést
151
+ * ```
152
+ *
153
+ * A `TypeError` will be thrown if `string` is not a string or another type
154
+ * appropriate for `Buffer.from()` variants.
155
+ *
156
+ * `Buffer.from(string)` may also use the internal `Buffer` pool like
157
+ * `Buffer.allocUnsafe()` does.
158
+ * @since v5.10.0
159
+ * @param string A string to encode.
160
+ * @param encoding The encoding of `string`. **Default:** `'utf8'`.
86
161
  */
87
- from(
88
- str:
89
- | WithImplicitCoercion<string>
90
- | {
91
- [Symbol.toPrimitive](hint: "string"): string;
92
- },
93
- encoding?: BufferEncoding,
94
- ): Buffer<ArrayBuffer>;
162
+ from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
95
163
  /**
96
164
  * Creates a new Buffer using the passed {data}
97
165
  * @param values to create a new Buffer
@@ -383,4 +451,10 @@ declare module "buffer" {
383
451
  subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
384
452
  }
385
453
  }
454
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
455
+ var SlowBuffer: {
456
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
457
+ new(size: number): Buffer<ArrayBuffer>;
458
+ prototype: Buffer;
459
+ };
386
460
  }
@@ -114,11 +114,6 @@ declare module "buffer" {
114
114
  * @param toEnc To target encoding.
115
115
  */
116
116
  export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
117
- export const SlowBuffer: {
118
- /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
119
- new(size: number): Buffer;
120
- prototype: Buffer;
121
- };
122
117
  /**
123
118
  * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
124
119
  * a prior call to `URL.createObjectURL()`.
@@ -237,7 +232,10 @@ declare module "buffer" {
237
232
  }
238
233
  export import atob = globalThis.atob;
239
234
  export import btoa = globalThis.btoa;
240
-
235
+ export type WithImplicitCoercion<T> =
236
+ | T
237
+ | { valueOf(): T }
238
+ | (T extends string ? { [Symbol.toPrimitive](hint: "string"): T } : never);
241
239
  global {
242
240
  namespace NodeJS {
243
241
  export { BufferEncoding };
@@ -256,11 +254,6 @@ declare module "buffer" {
256
254
  | "latin1"
257
255
  | "binary"
258
256
  | "hex";
259
- type WithImplicitCoercion<T> =
260
- | T
261
- | {
262
- valueOf(): T;
263
- };
264
257
  /**
265
258
  * Raw data is stored in instances of the Buffer class.
266
259
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
@@ -1,16 +1,18 @@
1
- /** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
1
+ /**
2
+ * @deprecated The `node:constants` module is deprecated. When requiring access to constants
3
+ * relevant to specific Node.js builtin modules, developers should instead refer
4
+ * to the `constants` property exposed by the relevant module. For instance,
5
+ * `require('node:fs').constants` and `require('node:os').constants`.
6
+ */
2
7
  declare module "constants" {
3
- import { constants as osConstants, SignalConstants } from "node:os";
4
- import { constants as cryptoConstants } from "node:crypto";
5
- import { constants as fsConstants } from "node:fs";
6
-
7
- const exp:
8
- & typeof osConstants.errno
9
- & typeof osConstants.priority
10
- & SignalConstants
11
- & typeof cryptoConstants
12
- & typeof fsConstants;
13
- export = exp;
8
+ const constants:
9
+ & typeof import("node:os").constants.dlopen
10
+ & typeof import("node:os").constants.errno
11
+ & typeof import("node:os").constants.priority
12
+ & typeof import("node:os").constants.signals
13
+ & typeof import("node:fs").constants
14
+ & typeof import("node:crypto").constants;
15
+ export = constants;
14
16
  }
15
17
 
16
18
  declare module "node:constants" {
@@ -682,9 +682,10 @@ declare module "crypto" {
682
682
  */
683
683
  type: KeyObjectType;
684
684
  }
685
- type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
685
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm";
686
686
  type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
687
687
  type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
688
+ type CipherChaCha20Poly1305Types = "chacha20-poly1305";
688
689
  type BinaryLike = string | NodeJS.ArrayBufferView;
689
690
  type CipherKey = BinaryLike | KeyObject;
690
691
  interface CipherCCMOptions extends stream.TransformOptions {
@@ -696,6 +697,10 @@ declare module "crypto" {
696
697
  interface CipherOCBOptions extends stream.TransformOptions {
697
698
  authTagLength: number;
698
699
  }
700
+ interface CipherChaCha20Poly1305Options extends stream.TransformOptions {
701
+ /** @default 16 */
702
+ authTagLength?: number | undefined;
703
+ }
699
704
  /**
700
705
  * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
701
706
  * initialization vector (`iv`).
@@ -744,6 +749,12 @@ declare module "crypto" {
744
749
  iv: BinaryLike,
745
750
  options?: CipherGCMOptions,
746
751
  ): CipherGCM;
752
+ function createCipheriv(
753
+ algorithm: CipherChaCha20Poly1305Types,
754
+ key: CipherKey,
755
+ iv: BinaryLike,
756
+ options?: CipherChaCha20Poly1305Options,
757
+ ): CipherChaCha20Poly1305;
747
758
  function createCipheriv(
748
759
  algorithm: string,
749
760
  key: CipherKey,
@@ -943,6 +954,15 @@ declare module "crypto" {
943
954
  ): this;
944
955
  getAuthTag(): Buffer;
945
956
  }
957
+ interface CipherChaCha20Poly1305 extends Cipher {
958
+ setAAD(
959
+ buffer: NodeJS.ArrayBufferView,
960
+ options: {
961
+ plaintextLength: number;
962
+ },
963
+ ): this;
964
+ getAuthTag(): Buffer;
965
+ }
946
966
  /**
947
967
  * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
948
968
  *
@@ -990,6 +1010,12 @@ declare module "crypto" {
990
1010
  iv: BinaryLike,
991
1011
  options?: CipherGCMOptions,
992
1012
  ): DecipherGCM;
1013
+ function createDecipheriv(
1014
+ algorithm: CipherChaCha20Poly1305Types,
1015
+ key: CipherKey,
1016
+ iv: BinaryLike,
1017
+ options?: CipherChaCha20Poly1305Options,
1018
+ ): DecipherChaCha20Poly1305;
993
1019
  function createDecipheriv(
994
1020
  algorithm: string,
995
1021
  key: CipherKey,
@@ -1175,6 +1201,15 @@ declare module "crypto" {
1175
1201
  },
1176
1202
  ): this;
1177
1203
  }
1204
+ interface DecipherChaCha20Poly1305 extends Decipher {
1205
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1206
+ setAAD(
1207
+ buffer: NodeJS.ArrayBufferView,
1208
+ options: {
1209
+ plaintextLength: number;
1210
+ },
1211
+ ): this;
1212
+ }
1178
1213
  interface PrivateKeyInput {
1179
1214
  key: string | Buffer;
1180
1215
  format?: KeyFormat | undefined;
@@ -325,9 +325,9 @@ declare module "module" {
325
325
  }
326
326
  interface ResolveFnOutput {
327
327
  /**
328
- * A hint to the load hook (it might be ignored)
328
+ * A hint to the load hook (it might be ignored); can be an intermediary value.
329
329
  */
330
- format?: ModuleFormat | null | undefined;
330
+ format?: string | null | undefined;
331
331
  /**
332
332
  * The import attributes to use when caching the module (optional; if excluded the input will be used)
333
333
  */
@@ -365,9 +365,9 @@ declare module "module" {
365
365
  */
366
366
  conditions: string[];
367
367
  /**
368
- * The format optionally supplied by the `resolve` hook chain
368
+ * The format optionally supplied by the `resolve` hook chain (can be an intermediary value).
369
369
  */
370
- format: ModuleFormat | null | undefined;
370
+ format: string | null | undefined;
371
371
  /**
372
372
  * An object whose key-value pairs represent the assertions for the module to import
373
373
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.13.5",
3
+ "version": "22.13.10",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -215,6 +215,6 @@
215
215
  "undici-types": "~6.20.0"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "f50d94abf6b192ce8d4087c8e3714bfeea42915f01b0f6338f726e5286a67f3a",
218
+ "typesPublisherContentHash": "25fcca4abf7a12f9be2302bc659011d734e5385c4d6aa230045dc3f241321494",
219
219
  "typeScriptVersion": "5.0"
220
220
  }
@@ -205,7 +205,12 @@ declare module "stream/web" {
205
205
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
206
206
  interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
207
207
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
208
- read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
208
+ read<T extends ArrayBufferView>(
209
+ view: T,
210
+ options?: {
211
+ min?: number;
212
+ },
213
+ ): Promise<ReadableStreamReadResult<T>>;
209
214
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
210
215
  releaseLock(): void;
211
216
  }