엄성진

fixed untracked files

Showing 1000 changed files with 0 additions and 4000 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../decompress-zip/bin/decompress-zip" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../decompress-zip/bin/decompress-zip" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\decompress-zip\bin\decompress-zip" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../mime/cli.js" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../mime/cli.js" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\mime\cli.js" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../mime/cli.js" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../mime/cli.js" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -"$basedir/../ngrok/bin/ngrok" "$@"
9 -exit $?
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -"%dp0%\..\ngrok\bin\ngrok" %*
5 -ENDLOCAL
6 -EXIT /b %errorlevel%
7 -:find_dp0
8 -SET dp0=%~dp0
9 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -& "$basedir/../ngrok/bin/ngrok" $args
11 -exit $LASTEXITCODE
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../nopt/bin/nopt.js" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\nopt\bin\nopt.js" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../nopt/bin/nopt.js" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../sshpk/bin/sshpk-conv" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../sshpk/bin/sshpk-sign" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../sshpk/bin/sshpk-verify" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../uuid/bin/uuid" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../uuid/bin/uuid" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\uuid\bin\uuid" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../uuid/bin/uuid" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../uuid/bin/uuid" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -## 7.3.0 (26 Apr 2021)
2 -
3 -### Feature
4 -* Support Flex Message Update 2 (#271)
5 -* Messaging API - January 2021 update (#277)
6 -
7 -### Misc
8 -* Add TypeScript Example (#270)
9 -* Update dependencies (#270)(#272)(#283)
10 -
11 -## 7.2.0 (18 Sep 2020)
12 -
13 -### Feature
14 -* Messaging API - December 2020 update (#268)
15 -* Messaging API - October 2020 update (#261)(#264)
16 -* update some Flex Message Update 2 (#265)
17 -
18 -### Misc
19 -* Update dependencies (#267)
20 -
21 -## 7.1.0 (18 Sep 2020)
22 -
23 -### Feature
24 -* Messaging API - August 2020 update (#240)(#251)(#258)
25 -* Messaging API - September 2020 update (#248)
26 -* Add Video viewing complete event (#241)
27 -* Channel access token v2.1 support key id (#231)
28 -* OAuth API v2.1 endpoint change (#233)
29 -
30 -### Bug fix
31 -* Accept label in richmenu area actions (#246)
32 -* Update dependencies & fix format (#234)(#236)(#238)(#243)(#250)
33 -* fix: fix createUploadAudienceGroup & updateUploadAudienceGroup API doc (#249)
34 -
35 -### Misc
36 -* Add Release CI & change release flow (#256)
37 -* Add: build doc github workflow
38 -
39 -## 7.0.0 (15 June 2020)
40 -
41 -### Breaking Changes
42 -* Node.js: drop 8 & adopt 14 (#222)
43 -
44 -### Feature
45 -* Support Channel access token v2.1 (#223)
46 -* Support Messaging API update for June 2020 (#228)
47 -* add X-Line-Retry-Key support (#224)
48 -* Support emojis in text message webhook (#218)
49 -* narrowcast api & audience apis (#193)
50 -* Add support for sticon in text messages (#214)
51 -* Add language support for profile API (#215)
52 -* Support icon-nickname-switch (#207)
53 -* Define LINE_SIGNATURE_HTTP_HEADER_NAME (#200)
54 -* add docs for getUserInteractionStatistics (#195)
55 -
56 -### Bug fixs & Feature Changes
57 -* fix getUserInteractionStatistics (#194)
58 -* type fix: accept string in the aspectRatio property of flex image and flex icon (#212)
59 -
60 -### Others
61 -* update dependencies & rewrite to promise (#225 & #229)
62 -* fix vulnerabilities (#217)
63 -* add emoji test (#198)
64 -* update vuepress to 1.x (#188)
65 -
66 -## 6.8.4 (19 Dec 2019)
67 -
68 -### Bug fix
69 -
70 -* Fix typo in type of FriendDemographics (#177)
71 -* Add label property to ImageMapAction type (#187)
72 -
73 -### Feature
74 -
75 -* Change data api's domain to api-data.line.me (#178)
76 -* Add getUserInteractionStatistics API (#183)
77 -* Add new properties in webhook types (#182)
78 -
79 -### Misc
80 -
81 -* Rewrite test in nock (#179)
82 -* Update dependencies (#180)
83 -
84 -## 6.8.3 (05 Nov 2019)
85 -
86 -### Bug fix
87 -
88 -* Add exception handler in middleware (#153)
89 -
90 -### Feature
91 -
92 -* Flex Message Update 1 (#173)
93 -* Support friend statistics API (#161)
94 -
95 -### Misc
96 -
97 -* Update dependencies (#174)
98 -
99 -## 6.8.2 (08 Aug 2019)
100 -
101 -### Bug fix
102 -
103 -* Fix LINEThings Scenario Execution Event Types (#158)
104 -
105 -## 6.8.1 (29 Jul 2019)
106 -
107 -### Bug fix
108 -
109 -* Fix a type wrong in Template Message (#163)
110 -
111 -### Feature
112 -* Get `X-LINE-Request-Id` by using `responseData['x-line-request-id']` (#151 #157)
113 -
114 -## 6.8.0 (25 Jun 2019)
115 -
116 -### Feature
117 -
118 -* Add new parameter in push/reply/multicast/broadcast API to catch up the newest bot API (#147)
119 -* Add new APIs in bot API (#147)
120 - - Get the target limit for additional messages
121 - - Get number of messages sent this month
122 - - Get number of sent broadcast messages
123 - - Send broadcast message
124 -
125 -### Breaking changes
126 -* Deprecate Node 6 and start to support Node 12 (#139)
127 -* Remove polyfills for Node 6 (#149)
128 -
129 -### Type
130 -
131 -* Add LINE Things Event (#150)
132 -
133 -### Misc
134 -* Update axios and other dependencies by running `npm audit fix` to fix vulnerabilities. (#148 #154)
135 -
136 -## 6.7.0 (18 Apr 2019)
137 -
138 -### Feature
139 -
140 -* Add alt URL field to URI action (#135)
141 -* Implement (un)linkRichMenuToMultipleUsers (#135)
142 -
143 -### Type
144 -
145 -* Fix typo in a type (#124)
146 -
147 -
148 -## 6.6.0 (4 Mar 2019)
149 -
150 -### Feature
151 -
152 -* Add DeviceLinkEvent / DeviceUnlinkEvent (#123)
153 -
154 -### Type
155 -
156 -* Fix FlexSpacer to have optional 'size' property (#122)
157 -
158 -### Misc
159 -
160 -* Run `npm audit fix` to fix minor dependency vulnerability.
161 -
162 -
163 -## 6.5.0 (16 Feb 2019)
164 -
165 -### Feature
166 -
167 -* Add APIs to get number of sent messages (#116)
168 -* Add account link event (#117)
169 -
170 -### Misc
171 -
172 -* Fix a typo in doc (#119)
173 -
174 -
175 -## 6.4.0 (19 Nov 2018)
176 -
177 -### Feature
178 -
179 -* Add `getLinkToken` API (#96)
180 -* Handle `req.rawBody` in Google Cloud Functions (#101)
181 -* [Kitchensink] Add ngrok functionality (#99)
182 -
183 -### Type
184 -
185 -* Add types for video in imagemap message (#100)
186 -* Add `contentProvider` fields to content messages (#103)
187 -* Add `destination` field to webhook request body (#102)
188 -* Add `MemberJoinEvent` and `MemberLeaveEvent` types (#107)
189 -
190 -### Misc
191 -
192 -* Don't include doc in released source
193 -* Upgrade TypeScript to 3.1.6 (#94)
194 -* Refactoring (#94, #98, #99)
195 -* Remove webhook-tester tool
196 -
197 -
198 -## 6.3.0 (21 Sep 2018)
199 -
200 -### Feature
201 -
202 -* Add default rich menu APIs (#87)
203 -
204 -### Type
205 -
206 -* Add missing `defaultAction` field to `TemplateColumn`
207 -
208 -### Misc
209 -
210 -* Use VuePress as documentation engine (#85)
211 -* Upgrade minimum supported Node.js version to 6
212 -
213 -
214 -## 6.2.1 (16 Aug 2018)
215 -
216 -### Misc
217 -
218 -* Remove gitbook-cli from dev dependencies
219 -
220 -
221 -## 6.2.0 (15 Aug 2018)
222 -
223 -#### Type
224 -
225 -* Add QuickReply types (#83)
226 -* Format type comments
227 -
228 -#### Misc
229 -
230 -* Upgrade TypeScript to 3
231 -
232 -
233 -## 6.1.1 (14 Aug 2018)
234 -
235 -#### Type
236 -
237 -* Update FlexMessage types (#81)
238 -
239 -#### Misc
240 -
241 -* Add test coverage (#78)
242 -* Add JSDoc comments (#80)
243 -
244 -
245 -## 6.1.0 (19 June 2018)
246 -
247 -#### Type
248 -
249 -* Add types for flex message (#74)
250 -* Simplify type definition for `Action`
251 -
252 -
253 -## 6.0.3 (18 June 2018)
254 -
255 -#### Misc
256 -
257 -* Move get-audio-duration dep to proper package.json (#73)
258 -* Vulnerability fix with `npm audit fix`
259 -
260 -
261 -## 6.0.2 (21 May 2018)
262 -
263 -#### Type
264 -
265 -* Add missing `displayText` field to postback action (#63)
266 -* Add missing `FileEventMessage` to `EventMessage` (#71)
267 -
268 -#### Misc
269 -
270 -* Add audio duration lib to kitchensink example (#68)
271 -
272 -
273 -## 6.0.1 (13 Mar 2018)
274 -
275 -#### Type
276 -
277 -* Fix misimplemented 'AudioMessage' type (#61)
278 -
279 -
280 -## 6.0.0 (27 Feb 2018)
281 -
282 -#### Major
283 -
284 -* Fix misimplemented 'unlinkRichMenuFromUser' API
285 -
286 -#### Type
287 -
288 -* Fix TemplateColumn type definition (#48)
289 -
290 -#### Misc
291 -
292 -* Update GitHub issue template (#43)
293 -* Add Code of Conduct (#50)
294 -* Catch errors properly in examples (#52)
295 -
296 -
297 -## 5.2.0 (11 Dec 2017)
298 -
299 -#### Minor
300 -
301 -* Set Content-Length manually for postBinary (#42)
302 -
303 -
304 -## 5.1.0 (7 Dec 2017)
305 -
306 -#### Minor
307 -
308 -* Add new fields (#39)
309 -
310 -#### Misc
311 -
312 -* Fix Windows build (#38)
313 -* Add start scripts and webhook info to examples
314 -
315 -
316 -## 5.0.1 (14 Nov 2017)
317 -
318 -#### Minor
319 -
320 -* Fix typo in `ImageMapMessage` type
321 -* Add kitchensink example (#36)
322 -
323 -
324 -## 5.0.0 (2 Nov 2017)
325 -
326 -#### Major
327 -
328 -* Implement rich menu API (#34)
329 -
330 -#### Type
331 -
332 -* Rename `ImageMapArea` and `TemplateAction`s into general ones
333 -
334 -#### Misc
335 -
336 -* Do not enforce `checkJSON` for some APIs where it means nothing
337 -* Change how to check request object in test cases
338 -
339 -
340 -## 4.0.0 (25 Oct 2017)
341 -
342 -#### Major
343 -
344 -* Make index script export exceptions and types (#31)
345 -
346 -#### Type
347 -
348 -* Simplify config types for client and middleware (#31)
349 -
350 -#### Misc
351 -
352 -* Fix information and links in doc
353 -* Use Prettier instead of TSLint (#30)
354 -* Install git hooks for precommit and prepush (#30)
355 -
356 -
357 -## 3.1.1 (19 Sep 2017)
358 -
359 -#### Type
360 -
361 -* Fix type of postback.params
362 -
363 -
364 -## 3.1.0 (19 Sep 2017)
365 -
366 -#### Major
367 -
368 -* Make middleware return `SignatureValidationFailed` for no signature (#26)
369 -
370 -#### Type
371 -
372 -* Add `FileEventMessage` type
373 -
374 -
375 -## 3.0.0 (8 Sep 2017)
376 -
377 -#### Major
378 -
379 -* Implement "Get group/room member profile" API (#15)
380 -* Implement "Get group/room member IDs" API (#23)
381 -* `getMessageContent` now returns `Promise<ReadableStream>` (#20)
382 -
383 -#### Type
384 -
385 -* Add "datetimepicker" support (#21)
386 -* Fix typo in `TemplateURIAction` type (#21)
387 -
388 -#### Misc
389 -
390 -* Package updates and corresponding fixes
391 -* Use npm 5 instead of Yarn in dev
392 -* Fix `clean` script to work in Windows
393 -* Use "axios" for internal HTTP client instead of "got" (#20)
394 -
395 -
396 -## 2.0.0 (12 June 2017)
397 -
398 -#### Type
399 -
400 -* Use literal types for 'type' fields
401 -
402 -#### Misc
403 -
404 -* Update yarn.lock with the latest Yarn
405 -
406 -
407 -## 1.1.0 (31 May 2017)
408 -
409 -* Handle pre-parsed body (string and buffer only)
410 -
411 -#### Type
412 -
413 -* Separate config type into client and middleware types
414 -* Add `userId` to group and room event sources
415 -
416 -#### Misc
417 -
418 -* Create issue template (#4)
419 -
420 -
421 -## 1.0.0 (11 May 2017)
422 -
423 -* Initial release
This diff is collapsed. Click to expand it.
1 -# LINE Messaging API SDK for nodejs
2 -
3 -[![Travis CI](https://travis-ci.org/line/line-bot-sdk-nodejs.svg?branch=master)](https://travis-ci.org/line/line-bot-sdk-nodejs)
4 -[![npmjs](https://badge.fury.io/js/%40line%2Fbot-sdk.svg)](https://www.npmjs.com/package/@line/bot-sdk)
5 -
6 -
7 -## Introduction
8 -The LINE Messaging API SDK for nodejs makes it easy to develop bots using LINE Messaging API, and you can create a sample bot within minutes.
9 -
10 -## Documentation
11 -
12 -See the official API documentation for more information
13 -
14 -- English: https://developers.line.biz/en/docs/messaging-api/overview/
15 -- Japanese: https://developers.line.biz/ja/docs/messaging-api/overview/
16 -
17 -line-bot-sdk-nodejs documentation: https://line.github.io/line-bot-sdk-nodejs/#getting-started
18 -
19 -## Requirements
20 -
21 -* **Node.js** 10 or higher
22 -
23 -## Installation
24 -
25 -Using [npm](https://www.npmjs.com/):
26 -
27 -``` bash
28 -$ npm install @line/bot-sdk --save
29 -```
30 -
31 -## Help and media
32 -FAQ: https://developers.line.biz/en/faq/
33 -
34 -Community Q&A: https://www.line-community.me/questions
35 -
36 -News: https://developers.line.biz/en/news/
37 -
38 -Twitter: @LINE_DEV
39 -
40 -## Versioning
41 -This project respects semantic versioning
42 -
43 -See http://semver.org/
44 -
45 -## Contributing
46 -
47 -Please check [CONTRIBUTING](CONTRIBUTING.md) before making a contribution.
48 -
49 -## License
50 -```
51 -Copyright (C) 2016 LINE Corp.
52 -
53 -Licensed under the Apache License, Version 2.0 (the "License");
54 -you may not use this file except in compliance with the License.
55 -You may obtain a copy of the License at
56 -
57 - http://www.apache.org/licenses/LICENSE-2.0
58 -
59 -Unless required by applicable law or agreed to in writing, software
60 -distributed under the License is distributed on an "AS IS" BASIS,
61 -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62 -See the License for the specific language governing permissions and
63 -limitations under the License.
64 -```
1 -/// <reference types="node" />
2 -import { Readable } from "stream";
3 -import * as Types from "./types";
4 -import { AxiosRequestConfig } from "axios";
5 -declare type RequestOption = {
6 - retryKey: string;
7 -};
8 -export default class Client {
9 - config: Types.ClientConfig;
10 - private http;
11 - private requestOption;
12 - constructor(config: Types.ClientConfig);
13 - setRequestOptionOnce(option: Partial<RequestOption>): void;
14 - private generateRequestConfig;
15 - private parseHTTPResponse;
16 - pushMessage(to: string, messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
17 - replyMessage(replyToken: string, messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
18 - multicast(to: string[], messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
19 - narrowcast(messages: Types.Message | Types.Message[], recipient?: Types.ReceieptObject, filter?: {
20 - demographic: Types.DemographicFilterObject;
21 - }, limit?: {
22 - max?: number;
23 - upToRemainingQuota?: boolean;
24 - }, notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
25 - broadcast(messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
26 - getProfile(userId: string): Promise<Types.Profile>;
27 - private getChatMemberProfile;
28 - getGroupMemberProfile(groupId: string, userId: string): Promise<Types.Profile>;
29 - getRoomMemberProfile(roomId: string, userId: string): Promise<Types.Profile>;
30 - private getChatMemberIds;
31 - getGroupMemberIds(groupId: string): Promise<string[]>;
32 - getRoomMemberIds(roomId: string): Promise<string[]>;
33 - getGroupMembersCount(groupId: string): Promise<Types.MembersCountResponse>;
34 - getRoomMembersCount(roomId: string): Promise<Types.MembersCountResponse>;
35 - getGroupSummary(groupId: string): Promise<Types.GroupSummaryResponse>;
36 - getMessageContent(messageId: string): Promise<Readable>;
37 - private leaveChat;
38 - leaveGroup(groupId: string): Promise<any>;
39 - leaveRoom(roomId: string): Promise<any>;
40 - getRichMenu(richMenuId: string): Promise<Types.RichMenuResponse>;
41 - createRichMenu(richMenu: Types.RichMenu): Promise<string>;
42 - deleteRichMenu(richMenuId: string): Promise<any>;
43 - getRichMenuIdOfUser(userId: string): Promise<string>;
44 - linkRichMenuToUser(userId: string, richMenuId: string): Promise<any>;
45 - unlinkRichMenuFromUser(userId: string): Promise<any>;
46 - linkRichMenuToMultipleUsers(richMenuId: string, userIds: string[]): Promise<any>;
47 - unlinkRichMenusFromMultipleUsers(userIds: string[]): Promise<any>;
48 - getRichMenuImage(richMenuId: string): Promise<Readable>;
49 - setRichMenuImage(richMenuId: string, data: Buffer | Readable, contentType?: string): Promise<any>;
50 - getRichMenuList(): Promise<Array<Types.RichMenuResponse>>;
51 - setDefaultRichMenu(richMenuId: string): Promise<{}>;
52 - getDefaultRichMenuId(): Promise<string>;
53 - deleteDefaultRichMenu(): Promise<{}>;
54 - getLinkToken(userId: string): Promise<string>;
55 - getNumberOfSentReplyMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
56 - getNumberOfSentPushMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
57 - getNumberOfSentMulticastMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
58 - getNarrowcastProgress(requestId: string): Promise<Types.NarrowcastProgressResponse>;
59 - getTargetLimitForAdditionalMessages(): Promise<Types.TargetLimitForAdditionalMessages>;
60 - getNumberOfMessagesSentThisMonth(): Promise<Types.NumberOfMessagesSentThisMonth>;
61 - getNumberOfSentBroadcastMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
62 - getNumberOfMessageDeliveries(date: string): Promise<Types.NumberOfMessageDeliveriesResponse>;
63 - getNumberOfFollowers(date: string): Promise<Types.NumberOfFollowersResponse>;
64 - getFriendDemographics(): Promise<Types.FriendDemographics>;
65 - getUserInteractionStatistics(requestId: string): Promise<Types.UserInteractionStatistics>;
66 - createUploadAudienceGroup(uploadAudienceGroup: {
67 - description: string;
68 - isIfaAudience?: boolean;
69 - audiences?: {
70 - id: string;
71 - }[];
72 - uploadDescription?: string;
73 - }): Promise<{
74 - audienceGroupId: number;
75 - type: string;
76 - description: string;
77 - created: number;
78 - }>;
79 - createUploadAudienceGroupByFile(uploadAudienceGroup: {
80 - description: string;
81 - isIfaAudience?: boolean;
82 - uploadDescription?: string;
83 - file: Buffer | Readable;
84 - }): Promise<{
85 - audienceGroupId: number;
86 - type: "UPLOAD";
87 - description: string;
88 - created: number;
89 - }>;
90 - updateUploadAudienceGroup(uploadAudienceGroup: {
91 - audienceGroupId: number;
92 - description?: string;
93 - uploadDescription?: string;
94 - audiences: {
95 - id: string;
96 - }[];
97 - }, httpConfig?: Partial<AxiosRequestConfig>): Promise<{}>;
98 - updateUploadAudienceGroupByFile(uploadAudienceGroup: {
99 - audienceGroupId: number;
100 - uploadDescription?: string;
101 - file: Buffer | Readable;
102 - }, httpConfig?: Partial<AxiosRequestConfig>): Promise<{}>;
103 - createClickAudienceGroup(clickAudienceGroup: {
104 - description: string;
105 - requestId: string;
106 - clickUrl?: string;
107 - }): Promise<{
108 - audienceGroupId: number;
109 - type: string;
110 - created: number;
111 - } & {
112 - description: string;
113 - requestId: string;
114 - clickUrl?: string;
115 - }>;
116 - createImpAudienceGroup(impAudienceGroup: {
117 - requestId: string;
118 - description: string;
119 - }): Promise<{
120 - audienceGroupId: number;
121 - type: string;
122 - created: number;
123 - } & {
124 - requestId: string;
125 - description: string;
126 - }>;
127 - setDescriptionAudienceGroup(description: string, audienceGroupId: string): Promise<{}>;
128 - deleteAudienceGroup(audienceGroupId: string): Promise<{}>;
129 - getAudienceGroup(audienceGroupId: string): Promise<Types.AudienceGroup>;
130 - getAudienceGroups(page: number, description?: string, status?: Types.AudienceGroupStatus, size?: number, createRoute?: Types.AudienceGroupCreateRoute, includesExternalPublicGroups?: boolean): Promise<{
131 - audienceGroups: Types.AudienceGroups;
132 - hasNextPage: boolean;
133 - totalCount: number;
134 - readWriteAudienceGroupTotalCount: number;
135 - page: number;
136 - size: number;
137 - }>;
138 - getAudienceGroupAuthorityLevel(): Promise<{
139 - authorityLevel: Types.AudienceGroupAuthorityLevel;
140 - }>;
141 - changeAudienceGroupAuthorityLevel(authorityLevel: Types.AudienceGroupAuthorityLevel): Promise<{}>;
142 - getBotInfo(): Promise<Types.BotInfoResponse>;
143 - setWebhookEndpointUrl(endpoint: string): Promise<{}>;
144 - getWebhookEndpointInfo(): Promise<Types.WebhookEndpointInfoResponse>;
145 - testWebhookEndpoint(endpoint?: string): Promise<Types.TestWebhookEndpointResponse>;
146 -}
147 -export declare class OAuth {
148 - private http;
149 - constructor();
150 - issueAccessToken(client_id: string, client_secret: string): Promise<Types.ChannelAccessToken>;
151 - revokeAccessToken(access_token: string): Promise<{}>;
152 - issueChannelAccessTokenV2_1(client_assertion: string): Promise<Types.ChannelAccessToken>;
153 - getChannelAccessTokenKeyIdsV2_1(client_assertion: string): Promise<{
154 - key_ids: string[];
155 - }>;
156 - revokeChannelAccessTokenV2_1(client_id: string, client_secret: string, access_token: string): Promise<{}>;
157 -}
158 -export {};
This diff is collapsed. Click to expand it.
1 -export declare const MESSAGING_API_PREFIX = "https://api.line.me/v2/bot";
2 -export declare const DATA_API_PREFIX = "https://api-data.line.me/v2/bot";
3 -export declare const OAUTH_BASE_PREFIX = "https://api.line.me/v2/oauth";
4 -export declare const OAUTH_BASE_PREFIX_V2_1 = "https://api.line.me/oauth2/v2.1";
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -exports.OAUTH_BASE_PREFIX_V2_1 = exports.OAUTH_BASE_PREFIX = exports.DATA_API_PREFIX = exports.MESSAGING_API_PREFIX = void 0;
4 -exports.MESSAGING_API_PREFIX = `https://api.line.me/v2/bot`;
5 -exports.DATA_API_PREFIX = `https://api-data.line.me/v2/bot`;
6 -exports.OAUTH_BASE_PREFIX = `https://api.line.me/v2/oauth`;
7 -exports.OAUTH_BASE_PREFIX_V2_1 = `https://api.line.me/oauth2/v2.1`;
1 -export declare class SignatureValidationFailed extends Error {
2 - signature?: string;
3 - constructor(message: string, signature?: string);
4 -}
5 -export declare class JSONParseError extends Error {
6 - raw: any;
7 - constructor(message: string, raw: any);
8 -}
9 -export declare class RequestError extends Error {
10 - code: string;
11 - private originalError;
12 - constructor(message: string, code: string, originalError: Error);
13 -}
14 -export declare class ReadError extends Error {
15 - private originalError;
16 - constructor(originalError: Error);
17 -}
18 -export declare class HTTPError extends Error {
19 - statusCode: number;
20 - statusMessage: string;
21 - originalError: any;
22 - constructor(message: string, statusCode: number, statusMessage: string, originalError: any);
23 -}
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -exports.HTTPError = exports.ReadError = exports.RequestError = exports.JSONParseError = exports.SignatureValidationFailed = void 0;
4 -class SignatureValidationFailed extends Error {
5 - constructor(message, signature) {
6 - super(message);
7 - this.signature = signature;
8 - }
9 -}
10 -exports.SignatureValidationFailed = SignatureValidationFailed;
11 -class JSONParseError extends Error {
12 - constructor(message, raw) {
13 - super(message);
14 - this.raw = raw;
15 - }
16 -}
17 -exports.JSONParseError = JSONParseError;
18 -class RequestError extends Error {
19 - constructor(message, code, originalError) {
20 - super(message);
21 - this.code = code;
22 - this.originalError = originalError;
23 - }
24 -}
25 -exports.RequestError = RequestError;
26 -class ReadError extends Error {
27 - constructor(originalError) {
28 - super(originalError.message);
29 - this.originalError = originalError;
30 - }
31 -}
32 -exports.ReadError = ReadError;
33 -class HTTPError extends Error {
34 - constructor(message, statusCode, statusMessage, originalError) {
35 - super(message);
36 - this.statusCode = statusCode;
37 - this.statusMessage = statusMessage;
38 - this.originalError = originalError;
39 - }
40 -}
41 -exports.HTTPError = HTTPError;
1 -/// <reference types="node" />
2 -import { AxiosResponse, AxiosRequestConfig } from "axios";
3 -import { Readable } from "stream";
4 -interface httpClientConfig extends Partial<AxiosRequestConfig> {
5 - baseURL?: string;
6 - defaultHeaders?: any;
7 - responseParser?: <T>(res: AxiosResponse) => T;
8 -}
9 -export default class HTTPClient {
10 - private instance;
11 - private config;
12 - constructor(config?: httpClientConfig);
13 - get<T>(url: string, params?: any): Promise<T>;
14 - getStream(url: string, params?: any): Promise<Readable>;
15 - post<T>(url: string, body?: any, config?: Partial<AxiosRequestConfig>): Promise<T>;
16 - private responseParse;
17 - put<T>(url: string, body?: any, config?: Partial<AxiosRequestConfig>): Promise<T>;
18 - postForm<T>(url: string, body?: any): Promise<T>;
19 - toBuffer(data: Buffer | Readable): Promise<Buffer>;
20 - postBinary<T>(url: string, data: Buffer | Readable, contentType?: string): Promise<T>;
21 - delete<T>(url: string, params?: any): Promise<T>;
22 - private wrapError;
23 -}
24 -export {};
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -const axios_1 = require("axios");
4 -const stream_1 = require("stream");
5 -const exceptions_1 = require("./exceptions");
6 -const fileType = require("file-type");
7 -const qs = require("querystring");
8 -const pkg = require("../package.json");
9 -class HTTPClient {
10 - constructor(config = {}) {
11 - this.config = config;
12 - const { baseURL, defaultHeaders } = config;
13 - this.instance = axios_1.default.create({
14 - baseURL,
15 - headers: Object.assign({}, defaultHeaders, {
16 - "User-Agent": `${pkg.name}/${pkg.version}`,
17 - }),
18 - });
19 - this.instance.interceptors.response.use(res => res, err => Promise.reject(this.wrapError(err)));
20 - }
21 - async get(url, params) {
22 - const res = await this.instance.get(url, { params });
23 - return res.data;
24 - }
25 - async getStream(url, params) {
26 - const res = await this.instance.get(url, {
27 - params,
28 - responseType: "stream",
29 - });
30 - return res.data;
31 - }
32 - async post(url, body, config) {
33 - const res = await this.instance.post(url, body, Object.assign({ headers: Object.assign({ "Content-Type": "application/json" }, (config && config.headers)) }, config));
34 - return this.responseParse(res);
35 - }
36 - responseParse(res) {
37 - const { responseParser } = this.config;
38 - if (responseParser)
39 - return responseParser(res);
40 - else
41 - return res.data;
42 - }
43 - async put(url, body, config) {
44 - const res = await this.instance.put(url, body, Object.assign({ headers: Object.assign({ "Content-Type": "application/json" }, (config && config.headers)) }, config));
45 - return this.responseParse(res);
46 - }
47 - async postForm(url, body) {
48 - const res = await this.instance.post(url, qs.stringify(body), {
49 - headers: { "Content-Type": "application/x-www-form-urlencoded" },
50 - });
51 - return res.data;
52 - }
53 - async toBuffer(data) {
54 - if (Buffer.isBuffer(data)) {
55 - return data;
56 - }
57 - else if (data instanceof stream_1.Readable) {
58 - return await new Promise((resolve, reject) => {
59 - const buffers = [];
60 - let size = 0;
61 - data.on("data", (chunk) => {
62 - buffers.push(chunk);
63 - size += chunk.length;
64 - });
65 - data.on("end", () => resolve(Buffer.concat(buffers, size)));
66 - data.on("error", reject);
67 - });
68 - }
69 - else {
70 - throw new Error("invalid data type for binary data");
71 - }
72 - }
73 - async postBinary(url, data, contentType) {
74 - const buffer = await this.toBuffer(data);
75 - const res = await this.instance.post(url, buffer, {
76 - headers: {
77 - "Content-Type": contentType || (await fileType.fromBuffer(buffer)).mime,
78 - "Content-Length": buffer.length,
79 - },
80 - });
81 - return res.data;
82 - }
83 - async delete(url, params) {
84 - const res = await this.instance.delete(url, { params });
85 - return res.data;
86 - }
87 - wrapError(err) {
88 - if (err.response) {
89 - return new exceptions_1.HTTPError(err.message, err.response.status, err.response.statusText, err);
90 - }
91 - else if (err.code) {
92 - return new exceptions_1.RequestError(err.message, err.code, err);
93 - }
94 - else if (err.config) {
95 - // unknown, but from axios
96 - return new exceptions_1.ReadError(err);
97 - }
98 - // otherwise, just rethrow
99 - return err;
100 - }
101 -}
102 -exports.default = HTTPClient;
1 -import Client, { OAuth } from "./client";
2 -import middleware from "./middleware";
3 -import validateSignature from "./validate-signature";
4 -export { Client, middleware, validateSignature, OAuth };
5 -export * from "./exceptions";
6 -export * from "./types";
1 -"use strict";
2 -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 - if (k2 === undefined) k2 = k;
4 - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5 -}) : (function(o, m, k, k2) {
6 - if (k2 === undefined) k2 = k;
7 - o[k2] = m[k];
8 -}));
9 -var __exportStar = (this && this.__exportStar) || function(m, exports) {
10 - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11 -};
12 -Object.defineProperty(exports, "__esModule", { value: true });
13 -exports.OAuth = exports.validateSignature = exports.middleware = exports.Client = void 0;
14 -const client_1 = require("./client");
15 -exports.Client = client_1.default;
16 -Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return client_1.OAuth; } });
17 -const middleware_1 = require("./middleware");
18 -exports.middleware = middleware_1.default;
19 -const validate_signature_1 = require("./validate-signature");
20 -exports.validateSignature = validate_signature_1.default;
21 -// re-export exceptions and types
22 -__exportStar(require("./exceptions"), exports);
23 -__exportStar(require("./types"), exports);
1 -/// <reference types="node" />
2 -import * as http from "http";
3 -import * as Types from "./types";
4 -export declare type Request = http.IncomingMessage & {
5 - body: any;
6 -};
7 -export declare type Response = http.ServerResponse;
8 -export declare type NextCallback = (err?: Error) => void;
9 -export declare type Middleware = (req: Request, res: Response, next: NextCallback) => void | Promise<void>;
10 -export default function middleware(config: Types.MiddlewareConfig): Middleware;
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -const body_parser_1 = require("body-parser");
4 -const exceptions_1 = require("./exceptions");
5 -const Types = require("./types");
6 -const validate_signature_1 = require("./validate-signature");
7 -function isValidBody(body) {
8 - return (body && typeof body === "string") || Buffer.isBuffer(body);
9 -}
10 -function middleware(config) {
11 - if (!config.channelSecret) {
12 - throw new Error("no channel secret");
13 - }
14 - const secret = config.channelSecret;
15 - const _middleware = async (req, res, next) => {
16 - // header names are lower-cased
17 - // https://nodejs.org/api/http.html#http_message_headers
18 - const signature = req.headers[Types.LINE_SIGNATURE_HTTP_HEADER_NAME];
19 - if (!signature) {
20 - next(new exceptions_1.SignatureValidationFailed("no signature"));
21 - return;
22 - }
23 - const body = await (async () => {
24 - if (isValidBody(req.rawBody)) {
25 - // rawBody is provided in Google Cloud Functions and others
26 - return req.rawBody;
27 - }
28 - else if (isValidBody(req.body)) {
29 - return req.body;
30 - }
31 - else {
32 - // body may not be parsed yet, parse it to a buffer
33 - return new Promise((resolve, reject) => body_parser_1.raw({ type: "*/*" })(req, res, (error) => error ? reject(error) : resolve(req.body)));
34 - }
35 - })();
36 - if (!validate_signature_1.default(body, secret, signature)) {
37 - next(new exceptions_1.SignatureValidationFailed("signature validation failed", signature));
38 - return;
39 - }
40 - const strBody = Buffer.isBuffer(body) ? body.toString() : body;
41 - try {
42 - req.body = JSON.parse(strBody);
43 - next();
44 - }
45 - catch (err) {
46 - next(new exceptions_1.JSONParseError(err.message, strBody));
47 - }
48 - };
49 - return (req, res, next) => {
50 - _middleware(req, res, next).catch(next);
51 - };
52 -}
53 -exports.default = middleware;
This diff is collapsed. Click to expand it.
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -exports.LINE_SIGNATURE_HTTP_HEADER_NAME = exports.LINE_REQUEST_ID_HTTP_HEADER_NAME = void 0;
4 -exports.LINE_REQUEST_ID_HTTP_HEADER_NAME = "x-line-request-id";
5 -exports.LINE_SIGNATURE_HTTP_HEADER_NAME = "x-line-signature";
1 -import * as FormData from "form-data";
2 -export declare function toArray<T>(maybeArr: T | T[]): T[];
3 -export declare function ensureJSON<T>(raw: T): T;
4 -export declare function createMultipartFormData(this: FormData | void, formBody: Record<string, any>): FormData;
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -exports.createMultipartFormData = exports.ensureJSON = exports.toArray = void 0;
4 -const exceptions_1 = require("./exceptions");
5 -const FormData = require("form-data");
6 -function toArray(maybeArr) {
7 - return Array.isArray(maybeArr) ? maybeArr : [maybeArr];
8 -}
9 -exports.toArray = toArray;
10 -function ensureJSON(raw) {
11 - if (typeof raw === "object") {
12 - return raw;
13 - }
14 - else {
15 - throw new exceptions_1.JSONParseError("Failed to parse response body as JSON", raw);
16 - }
17 -}
18 -exports.ensureJSON = ensureJSON;
19 -function createMultipartFormData(formBody) {
20 - const formData = this instanceof FormData ? this : new FormData();
21 - Object.entries(formBody).forEach(([key, value]) => {
22 - if (Buffer.isBuffer(value) || value instanceof Uint8Array) {
23 - formData.append(key, value);
24 - }
25 - else {
26 - formData.append(key, String(value));
27 - }
28 - });
29 - return formData;
30 -}
31 -exports.createMultipartFormData = createMultipartFormData;
1 -/// <reference types="node" />
2 -export default function validateSignature(body: string | Buffer, channelSecret: string, signature: string): boolean;
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -const crypto_1 = require("crypto");
4 -function s2b(str, encoding) {
5 - return Buffer.from(str, encoding);
6 -}
7 -function safeCompare(a, b) {
8 - if (a.length !== b.length) {
9 - return false;
10 - }
11 - return crypto_1.timingSafeEqual(a, b);
12 -}
13 -function validateSignature(body, channelSecret, signature) {
14 - return safeCompare(crypto_1.createHmac("SHA256", channelSecret).update(body).digest(), s2b(signature, "base64"));
15 -}
16 -exports.default = validateSignature;
This diff is collapsed. Click to expand it.
1 -export const MESSAGING_API_PREFIX = `https://api.line.me/v2/bot`;
2 -export const DATA_API_PREFIX = `https://api-data.line.me/v2/bot`;
3 -export const OAUTH_BASE_PREFIX = `https://api.line.me/v2/oauth`;
4 -export const OAUTH_BASE_PREFIX_V2_1 = `https://api.line.me/oauth2/v2.1`;
1 -export class SignatureValidationFailed extends Error {
2 - constructor(message: string, public signature?: string) {
3 - super(message);
4 - }
5 -}
6 -
7 -export class JSONParseError extends Error {
8 - constructor(message: string, public raw: any) {
9 - super(message);
10 - }
11 -}
12 -
13 -export class RequestError extends Error {
14 - constructor(
15 - message: string,
16 - public code: string,
17 - private originalError: Error,
18 - ) {
19 - super(message);
20 - }
21 -}
22 -
23 -export class ReadError extends Error {
24 - constructor(private originalError: Error) {
25 - super(originalError.message);
26 - }
27 -}
28 -
29 -export class HTTPError extends Error {
30 - constructor(
31 - message: string,
32 - public statusCode: number,
33 - public statusMessage: string,
34 - public originalError: any,
35 - ) {
36 - super(message);
37 - }
38 -}
1 -import axios, {
2 - AxiosInstance,
3 - AxiosError,
4 - AxiosResponse,
5 - AxiosRequestConfig,
6 -} from "axios";
7 -import { Readable } from "stream";
8 -import { HTTPError, ReadError, RequestError } from "./exceptions";
9 -import * as fileType from "file-type";
10 -import * as qs from "querystring";
11 -
12 -const pkg = require("../package.json");
13 -
14 -interface httpClientConfig extends Partial<AxiosRequestConfig> {
15 - baseURL?: string;
16 - defaultHeaders?: any;
17 - responseParser?: <T>(res: AxiosResponse) => T;
18 -}
19 -
20 -export default class HTTPClient {
21 - private instance: AxiosInstance;
22 - private config: httpClientConfig;
23 -
24 - constructor(config: httpClientConfig = {}) {
25 - this.config = config;
26 - const { baseURL, defaultHeaders } = config;
27 - this.instance = axios.create({
28 - baseURL,
29 - headers: Object.assign({}, defaultHeaders, {
30 - "User-Agent": `${pkg.name}/${pkg.version}`,
31 - }),
32 - });
33 -
34 - this.instance.interceptors.response.use(
35 - res => res,
36 - err => Promise.reject(this.wrapError(err)),
37 - );
38 - }
39 -
40 - public async get<T>(url: string, params?: any): Promise<T> {
41 - const res = await this.instance.get(url, { params });
42 - return res.data;
43 - }
44 -
45 - public async getStream(url: string, params?: any): Promise<Readable> {
46 - const res = await this.instance.get(url, {
47 - params,
48 - responseType: "stream",
49 - });
50 - return res.data as Readable;
51 - }
52 -
53 - public async post<T>(
54 - url: string,
55 - body?: any,
56 - config?: Partial<AxiosRequestConfig>,
57 - ): Promise<T> {
58 - const res = await this.instance.post(url, body, {
59 - headers: {
60 - "Content-Type": "application/json",
61 - ...(config && config.headers),
62 - },
63 - ...config,
64 - });
65 -
66 - return this.responseParse(res);
67 - }
68 -
69 - private responseParse(res: AxiosResponse) {
70 - const { responseParser } = this.config;
71 - if (responseParser) return responseParser(res);
72 - else return res.data;
73 - }
74 -
75 - public async put<T>(
76 - url: string,
77 - body?: any,
78 - config?: Partial<AxiosRequestConfig>,
79 - ): Promise<T> {
80 - const res = await this.instance.put(url, body, {
81 - headers: {
82 - "Content-Type": "application/json",
83 - ...(config && config.headers),
84 - },
85 - ...config,
86 - });
87 -
88 - return this.responseParse(res);
89 - }
90 -
91 - public async postForm<T>(url: string, body?: any): Promise<T> {
92 - const res = await this.instance.post(url, qs.stringify(body), {
93 - headers: { "Content-Type": "application/x-www-form-urlencoded" },
94 - });
95 -
96 - return res.data;
97 - }
98 -
99 - public async toBuffer(data: Buffer | Readable) {
100 - if (Buffer.isBuffer(data)) {
101 - return data;
102 - } else if (data instanceof Readable) {
103 - return await new Promise<Buffer>((resolve, reject) => {
104 - const buffers: Buffer[] = [];
105 - let size = 0;
106 - data.on("data", (chunk: Buffer) => {
107 - buffers.push(chunk);
108 - size += chunk.length;
109 - });
110 - data.on("end", () => resolve(Buffer.concat(buffers, size)));
111 - data.on("error", reject);
112 - });
113 - } else {
114 - throw new Error("invalid data type for binary data");
115 - }
116 - }
117 -
118 - public async postBinary<T>(
119 - url: string,
120 - data: Buffer | Readable,
121 - contentType?: string,
122 - ): Promise<T> {
123 - const buffer = await this.toBuffer(data);
124 -
125 - const res = await this.instance.post(url, buffer, {
126 - headers: {
127 - "Content-Type": contentType || (await fileType.fromBuffer(buffer)).mime,
128 - "Content-Length": buffer.length,
129 - },
130 - });
131 -
132 - return res.data;
133 - }
134 -
135 - public async delete<T>(url: string, params?: any): Promise<T> {
136 - const res = await this.instance.delete(url, { params });
137 - return res.data;
138 - }
139 -
140 - private wrapError(err: AxiosError): Error {
141 - if (err.response) {
142 - return new HTTPError(
143 - err.message,
144 - err.response.status,
145 - err.response.statusText,
146 - err,
147 - );
148 - } else if (err.code) {
149 - return new RequestError(err.message, err.code, err);
150 - } else if (err.config) {
151 - // unknown, but from axios
152 - return new ReadError(err);
153 - }
154 -
155 - // otherwise, just rethrow
156 - return err;
157 - }
158 -}
1 -import Client, { OAuth } from "./client";
2 -import middleware from "./middleware";
3 -import validateSignature from "./validate-signature";
4 -
5 -export { Client, middleware, validateSignature, OAuth };
6 -
7 -// re-export exceptions and types
8 -export * from "./exceptions";
9 -export * from "./types";
1 -import { raw } from "body-parser";
2 -import * as http from "http";
3 -import { JSONParseError, SignatureValidationFailed } from "./exceptions";
4 -import * as Types from "./types";
5 -import validateSignature from "./validate-signature";
6 -
7 -export type Request = http.IncomingMessage & { body: any };
8 -export type Response = http.ServerResponse;
9 -export type NextCallback = (err?: Error) => void;
10 -
11 -export type Middleware = (
12 - req: Request,
13 - res: Response,
14 - next: NextCallback,
15 -) => void | Promise<void>;
16 -
17 -function isValidBody(body?: any): body is string | Buffer {
18 - return (body && typeof body === "string") || Buffer.isBuffer(body);
19 -}
20 -
21 -export default function middleware(config: Types.MiddlewareConfig): Middleware {
22 - if (!config.channelSecret) {
23 - throw new Error("no channel secret");
24 - }
25 -
26 - const secret = config.channelSecret;
27 -
28 - const _middleware: Middleware = async (req, res, next) => {
29 - // header names are lower-cased
30 - // https://nodejs.org/api/http.html#http_message_headers
31 - const signature = req.headers[
32 - Types.LINE_SIGNATURE_HTTP_HEADER_NAME
33 - ] as string;
34 -
35 - if (!signature) {
36 - next(new SignatureValidationFailed("no signature"));
37 - return;
38 - }
39 -
40 - const body = await (async (): Promise<string | Buffer> => {
41 - if (isValidBody((req as any).rawBody)) {
42 - // rawBody is provided in Google Cloud Functions and others
43 - return (req as any).rawBody;
44 - } else if (isValidBody(req.body)) {
45 - return req.body;
46 - } else {
47 - // body may not be parsed yet, parse it to a buffer
48 - return new Promise<Buffer>((resolve, reject) =>
49 - raw({ type: "*/*" })(req as any, res as any, (error: Error) =>
50 - error ? reject(error) : resolve(req.body),
51 - ),
52 - );
53 - }
54 - })();
55 -
56 - if (!validateSignature(body, secret, signature)) {
57 - next(
58 - new SignatureValidationFailed("signature validation failed", signature),
59 - );
60 - return;
61 - }
62 -
63 - const strBody = Buffer.isBuffer(body) ? body.toString() : body;
64 -
65 - try {
66 - req.body = JSON.parse(strBody);
67 - next();
68 - } catch (err) {
69 - next(new JSONParseError(err.message, strBody));
70 - }
71 - };
72 - return (req, res, next): void => {
73 - (<Promise<void>>_middleware(req, res, next)).catch(next);
74 - };
75 -}
This diff is collapsed. Click to expand it.
1 -import { JSONParseError } from "./exceptions";
2 -import * as FormData from "form-data";
3 -
4 -export function toArray<T>(maybeArr: T | T[]): T[] {
5 - return Array.isArray(maybeArr) ? maybeArr : [maybeArr];
6 -}
7 -
8 -export function ensureJSON<T>(raw: T): T {
9 - if (typeof raw === "object") {
10 - return raw;
11 - } else {
12 - throw new JSONParseError("Failed to parse response body as JSON", raw);
13 - }
14 -}
15 -
16 -export function createMultipartFormData(
17 - this: FormData | void,
18 - formBody: Record<string, any>,
19 -): FormData {
20 - const formData = this instanceof FormData ? this : new FormData();
21 - Object.entries(formBody).forEach(([key, value]) => {
22 - if (Buffer.isBuffer(value) || value instanceof Uint8Array) {
23 - formData.append(key, value);
24 - } else {
25 - formData.append(key, String(value));
26 - }
27 - });
28 - return formData;
29 -}
1 -import { createHmac, timingSafeEqual } from "crypto";
2 -
3 -function s2b(str: string, encoding: BufferEncoding): Buffer {
4 - return Buffer.from(str, encoding);
5 -}
6 -
7 -function safeCompare(a: Buffer, b: Buffer): boolean {
8 - if (a.length !== b.length) {
9 - return false;
10 - }
11 - return timingSafeEqual(a, b);
12 -}
13 -
14 -export default function validateSignature(
15 - body: string | Buffer,
16 - channelSecret: string,
17 - signature: string,
18 -): boolean {
19 - return safeCompare(
20 - createHmac("SHA256", channelSecret).update(body).digest(),
21 - s2b(signature, "base64"),
22 - );
23 -}
1 - MIT License
2 -
3 - Copyright (c) Microsoft Corporation.
4 -
5 - Permission is hereby granted, free of charge, to any person obtaining a copy
6 - of this software and associated documentation files (the "Software"), to deal
7 - in the Software without restriction, including without limitation the rights
8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 - copies of the Software, and to permit persons to whom the Software is
10 - furnished to do so, subject to the following conditions:
11 -
12 - The above copyright notice and this permission notice shall be included in all
13 - copies or substantial portions of the Software.
14 -
15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 - SOFTWARE
1 -# Installation
2 -> `npm install --save @types/node`
3 -
4 -# Summary
5 -This package contains type definitions for Node.js (http://nodejs.org/).
6 -
7 -# Details
8 -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9 -
10 -### Additional Details
11 - * Last updated: Tue, 18 May 2021 17:01:58 GMT
12 - * Dependencies: none
13 - * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14 -
15 -# Credits
16 -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), and [Bond](https://github.com/bondz).
1 -declare module 'assert' {
2 - /** An alias of `assert.ok()`. */
3 - function assert(value: any, message?: string | Error): asserts value;
4 - namespace assert {
5 - class AssertionError extends Error {
6 - actual: any;
7 - expected: any;
8 - operator: string;
9 - generatedMessage: boolean;
10 - code: 'ERR_ASSERTION';
11 -
12 - constructor(options?: {
13 - /** If provided, the error message is set to this value. */
14 - message?: string;
15 - /** The `actual` property on the error instance. */
16 - actual?: any;
17 - /** The `expected` property on the error instance. */
18 - expected?: any;
19 - /** The `operator` property on the error instance. */
20 - operator?: string;
21 - /** If provided, the generated stack trace omits frames before this function. */
22 - // tslint:disable-next-line:ban-types
23 - stackStartFn?: Function;
24 - });
25 - }
26 -
27 - class CallTracker {
28 - calls(exact?: number): () => void;
29 - calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 - report(): CallTrackerReportInformation[];
31 - verify(): void;
32 - }
33 - interface CallTrackerReportInformation {
34 - message: string;
35 - /** The actual number of times the function was called. */
36 - actual: number;
37 - /** The number of times the function was expected to be called. */
38 - expected: number;
39 - /** The name of the function that is wrapped. */
40 - operator: string;
41 - /** A stack trace of the function. */
42 - stack: object;
43 - }
44 -
45 - type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 -
47 - function fail(message?: string | Error): never;
48 - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 - function fail(
50 - actual: any,
51 - expected: any,
52 - message?: string | Error,
53 - operator?: string,
54 - // tslint:disable-next-line:ban-types
55 - stackStartFn?: Function,
56 - ): never;
57 - function ok(value: any, message?: string | Error): asserts value;
58 - /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 - function equal(actual: any, expected: any, message?: string | Error): void;
60 - /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 - function notEqual(actual: any, expected: any, message?: string | Error): void;
62 - /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 - function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 - /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 - function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 - function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
67 - function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 - function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
69 - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 -
71 - function throws(block: () => any, message?: string | Error): void;
72 - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 - function doesNotThrow(block: () => any, message?: string | Error): void;
74 - function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 -
76 - function ifError(value: any): asserts value is null | undefined;
77 -
78 - function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 - function rejects(
80 - block: (() => Promise<any>) | Promise<any>,
81 - error: AssertPredicate,
82 - message?: string | Error,
83 - ): Promise<void>;
84 - function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 - function doesNotReject(
86 - block: (() => Promise<any>) | Promise<any>,
87 - error: AssertPredicate,
88 - message?: string | Error,
89 - ): Promise<void>;
90 -
91 - function match(value: string, regExp: RegExp, message?: string | Error): void;
92 - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 -
94 - const strict: Omit<
95 - typeof assert,
96 - | 'equal'
97 - | 'notEqual'
98 - | 'deepEqual'
99 - | 'notDeepEqual'
100 - | 'ok'
101 - | 'strictEqual'
102 - | 'deepStrictEqual'
103 - | 'ifError'
104 - | 'strict'
105 - > & {
106 - (value: any, message?: string | Error): asserts value;
107 - equal: typeof strictEqual;
108 - notEqual: typeof notStrictEqual;
109 - deepEqual: typeof deepStrictEqual;
110 - notDeepEqual: typeof notDeepStrictEqual;
111 -
112 - // Mapped types and assertion functions are incompatible?
113 - // TS2775: Assertions require every name in the call target
114 - // to be declared with an explicit type annotation.
115 - ok: typeof ok;
116 - strictEqual: typeof strictEqual;
117 - deepStrictEqual: typeof deepStrictEqual;
118 - ifError: typeof ifError;
119 - strict: typeof strict;
120 - };
121 - }
122 -
123 - export = assert;
124 -}
1 -/**
2 - * Async Hooks module: https://nodejs.org/api/async_hooks.html
3 - */
4 -declare module 'async_hooks' {
5 - /**
6 - * Returns the asyncId of the current execution context.
7 - */
8 - function executionAsyncId(): number;
9 -
10 - /**
11 - * The resource representing the current execution.
12 - * Useful to store data within the resource.
13 - *
14 - * Resource objects returned by `executionAsyncResource()` are most often internal
15 - * Node.js handle objects with undocumented APIs. Using any functions or properties
16 - * on the object is likely to crash your application and should be avoided.
17 - *
18 - * Using `executionAsyncResource()` in the top-level execution context will
19 - * return an empty object as there is no handle or request object to use,
20 - * but having an object representing the top-level can be helpful.
21 - */
22 - function executionAsyncResource(): object;
23 -
24 - /**
25 - * Returns the ID of the resource responsible for calling the callback that is currently being executed.
26 - */
27 - function triggerAsyncId(): number;
28 -
29 - interface HookCallbacks {
30 - /**
31 - * Called when a class is constructed that has the possibility to emit an asynchronous event.
32 - * @param asyncId a unique ID for the async resource
33 - * @param type the type of the async resource
34 - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
35 - * @param resource reference to the resource representing the async operation, needs to be released during destroy
36 - */
37 - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
38 -
39 - /**
40 - * When an asynchronous operation is initiated or completes a callback is called to notify the user.
41 - * The before callback is called just before said callback is executed.
42 - * @param asyncId the unique identifier assigned to the resource about to execute the callback.
43 - */
44 - before?(asyncId: number): void;
45 -
46 - /**
47 - * Called immediately after the callback specified in before is completed.
48 - * @param asyncId the unique identifier assigned to the resource which has executed the callback.
49 - */
50 - after?(asyncId: number): void;
51 -
52 - /**
53 - * Called when a promise has resolve() called. This may not be in the same execution id
54 - * as the promise itself.
55 - * @param asyncId the unique id for the promise that was resolve()d.
56 - */
57 - promiseResolve?(asyncId: number): void;
58 -
59 - /**
60 - * Called after the resource corresponding to asyncId is destroyed
61 - * @param asyncId a unique ID for the async resource
62 - */
63 - destroy?(asyncId: number): void;
64 - }
65 -
66 - interface AsyncHook {
67 - /**
68 - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
69 - */
70 - enable(): this;
71 -
72 - /**
73 - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
74 - */
75 - disable(): this;
76 - }
77 -
78 - /**
79 - * Registers functions to be called for different lifetime events of each async operation.
80 - * @param options the callbacks to register
81 - * @return an AsyncHooks instance used for disabling and enabling hooks
82 - */
83 - function createHook(options: HookCallbacks): AsyncHook;
84 -
85 - interface AsyncResourceOptions {
86 - /**
87 - * The ID of the execution context that created this async event.
88 - * @default executionAsyncId()
89 - */
90 - triggerAsyncId?: number;
91 -
92 - /**
93 - * Disables automatic `emitDestroy` when the object is garbage collected.
94 - * This usually does not need to be set (even if `emitDestroy` is called
95 - * manually), unless the resource's `asyncId` is retrieved and the
96 - * sensitive API's `emitDestroy` is called with it.
97 - * @default false
98 - */
99 - requireManualDestroy?: boolean;
100 - }
101 -
102 - /**
103 - * The class AsyncResource was designed to be extended by the embedder's async resources.
104 - * Using this users can easily trigger the lifetime events of their own resources.
105 - */
106 - class AsyncResource {
107 - /**
108 - * AsyncResource() is meant to be extended. Instantiating a
109 - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
110 - * async_hook.executionAsyncId() is used.
111 - * @param type The type of async event.
112 - * @param triggerAsyncId The ID of the execution context that created
113 - * this async event (default: `executionAsyncId()`), or an
114 - * AsyncResourceOptions object (since 9.3)
115 - */
116 - constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
117 -
118 - /**
119 - * Binds the given function to the current execution context.
120 - * @param fn The function to bind to the current execution context.
121 - * @param type An optional name to associate with the underlying `AsyncResource`.
122 - */
123 - static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
124 -
125 - /**
126 - * Binds the given function to execute to this `AsyncResource`'s scope.
127 - * @param fn The function to bind to the current `AsyncResource`.
128 - */
129 - bind<Func extends (...args: any[]) => any>(fn: Func): Func & { asyncResource: AsyncResource };
130 -
131 - /**
132 - * Call the provided function with the provided arguments in the
133 - * execution context of the async resource. This will establish the
134 - * context, trigger the AsyncHooks before callbacks, call the function,
135 - * trigger the AsyncHooks after callbacks, and then restore the original
136 - * execution context.
137 - * @param fn The function to call in the execution context of this
138 - * async resource.
139 - * @param thisArg The receiver to be used for the function call.
140 - * @param args Optional arguments to pass to the function.
141 - */
142 - runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
143 -
144 - /**
145 - * Call AsyncHooks destroy callbacks.
146 - */
147 - emitDestroy(): this;
148 -
149 - /**
150 - * @return the unique ID assigned to this AsyncResource instance.
151 - */
152 - asyncId(): number;
153 -
154 - /**
155 - * @return the trigger ID for this AsyncResource instance.
156 - */
157 - triggerAsyncId(): number;
158 - }
159 -
160 - /**
161 - * When having multiple instances of `AsyncLocalStorage`, they are independent
162 - * from each other. It is safe to instantiate this class multiple times.
163 - */
164 - class AsyncLocalStorage<T> {
165 - /**
166 - * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
167 - * to `asyncLocalStorage.getStore()` will return `undefined` until
168 - * `asyncLocalStorage.run()` is called again.
169 - *
170 - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
171 - * instance will be exited.
172 - *
173 - * Calling `asyncLocalStorage.disable()` is required before the
174 - * `asyncLocalStorage` can be garbage collected. This does not apply to stores
175 - * provided by the `asyncLocalStorage`, as those objects are garbage collected
176 - * along with the corresponding async resources.
177 - *
178 - * This method is to be used when the `asyncLocalStorage` is not in use anymore
179 - * in the current process.
180 - */
181 - disable(): void;
182 -
183 - /**
184 - * This method returns the current store. If this method is called outside of an
185 - * asynchronous context initialized by calling `asyncLocalStorage.run`, it will
186 - * return `undefined`.
187 - */
188 - getStore(): T | undefined;
189 -
190 - /**
191 - * This methods runs a function synchronously within a context and return its
192 - * return value. The store is not accessible outside of the callback function or
193 - * the asynchronous operations created within the callback.
194 - *
195 - * Optionally, arguments can be passed to the function. They will be passed to the
196 - * callback function.
197 - *
198 - * I the callback function throws an error, it will be thrown by `run` too. The
199 - * stacktrace will not be impacted by this call and the context will be exited.
200 - */
201 - // TODO: Apply generic vararg once available
202 - run<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
203 -
204 - /**
205 - * This methods runs a function synchronously outside of a context and return its
206 - * return value. The store is not accessible within the callback function or the
207 - * asynchronous operations created within the callback.
208 - *
209 - * Optionally, arguments can be passed to the function. They will be passed to the
210 - * callback function.
211 - *
212 - * If the callback function throws an error, it will be thrown by `exit` too. The
213 - * stacktrace will not be impacted by this call and the context will be
214 - * re-entered.
215 - */
216 - // TODO: Apply generic vararg once available
217 - exit<R>(callback: (...args: any[]) => R, ...args: any[]): R;
218 -
219 - /**
220 - * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
221 - * for the remainder of the current synchronous execution and will persist
222 - * through any following asynchronous calls.
223 - */
224 - enterWith(store: T): void;
225 - }
226 -}
1 -// NOTE: These definitions support NodeJS and TypeScript 3.7.
2 -
3 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 -// - ~/index.d.ts - Definitions specific to TypeScript 2.1
6 -// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
7 -// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
8 -
9 -// Reference required types from the default lib:
10 -/// <reference lib="es2018" />
11 -/// <reference lib="esnext.asynciterable" />
12 -/// <reference lib="esnext.intl" />
13 -/// <reference lib="esnext.bigint" />
14 -
15 -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 -/// <reference path="ts3.6/base.d.ts" />
17 -
18 -// TypeScript 3.7-specific augmentations:
19 -/// <reference path="assert.d.ts" />
1 -declare module 'buffer' {
2 - export const INSPECT_MAX_BYTES: number;
3 - export const kMaxLength: number;
4 - export const kStringMaxLength: number;
5 - export const constants: {
6 - MAX_LENGTH: number;
7 - MAX_STRING_LENGTH: number;
8 - };
9 - const BuffType: typeof Buffer;
10 -
11 - export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
12 -
13 - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
14 -
15 - export const SlowBuffer: {
16 - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
17 - new(size: number): Buffer;
18 - prototype: Buffer;
19 - };
20 -
21 - export { BuffType as Buffer };
22 -}
1 -declare module 'console' {
2 - import { InspectOptions } from 'util';
3 -
4 - global {
5 - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
6 - interface Console {
7 - Console: NodeJS.ConsoleConstructor;
8 - /**
9 - * A simple assertion test that verifies whether `value` is truthy.
10 - * If it is not, an `AssertionError` is thrown.
11 - * If provided, the error `message` is formatted using `util.format()` and used as the error message.
12 - */
13 - assert(value: any, message?: string, ...optionalParams: any[]): void;
14 - /**
15 - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
16 - * When `stdout` is not a TTY, this method does nothing.
17 - */
18 - clear(): void;
19 - /**
20 - * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
21 - */
22 - count(label?: string): void;
23 - /**
24 - * Resets the internal counter specific to `label`.
25 - */
26 - countReset(label?: string): void;
27 - /**
28 - * The `console.debug()` function is an alias for {@link console.log()}.
29 - */
30 - debug(message?: any, ...optionalParams: any[]): void;
31 - /**
32 - * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`.
33 - * This function bypasses any custom `inspect()` function defined on `obj`.
34 - */
35 - dir(obj: any, options?: InspectOptions): void;
36 - /**
37 - * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting
38 - */
39 - dirxml(...data: any[]): void;
40 - /**
41 - * Prints to `stderr` with newline.
42 - */
43 - error(message?: any, ...optionalParams: any[]): void;
44 - /**
45 - * Increases indentation of subsequent lines by two spaces.
46 - * If one or more `label`s are provided, those are printed first without the additional indentation.
47 - */
48 - group(...label: any[]): void;
49 - /**
50 - * The `console.groupCollapsed()` function is an alias for {@link console.group()}.
51 - */
52 - groupCollapsed(...label: any[]): void;
53 - /**
54 - * Decreases indentation of subsequent lines by two spaces.
55 - */
56 - groupEnd(): void;
57 - /**
58 - * The {@link console.info()} function is an alias for {@link console.log()}.
59 - */
60 - info(message?: any, ...optionalParams: any[]): void;
61 - /**
62 - * Prints to `stdout` with newline.
63 - */
64 - log(message?: any, ...optionalParams: any[]): void;
65 - /**
66 - * This method does not display anything unless used in the inspector.
67 - * Prints to `stdout` the array `array` formatted as a table.
68 - */
69 - table(tabularData: any, properties?: ReadonlyArray<string>): void;
70 - /**
71 - * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
72 - */
73 - time(label?: string): void;
74 - /**
75 - * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
76 - */
77 - timeEnd(label?: string): void;
78 - /**
79 - * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
80 - */
81 - timeLog(label?: string, ...data: any[]): void;
82 - /**
83 - * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
84 - */
85 - trace(message?: any, ...optionalParams: any[]): void;
86 - /**
87 - * The {@link console.warn()} function is an alias for {@link console.error()}.
88 - */
89 - warn(message?: any, ...optionalParams: any[]): void;
90 -
91 - // --- Inspector mode only ---
92 - /**
93 - * This method does not display anything unless used in the inspector.
94 - * Starts a JavaScript CPU profile with an optional label.
95 - */
96 - profile(label?: string): void;
97 - /**
98 - * This method does not display anything unless used in the inspector.
99 - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
100 - */
101 - profileEnd(label?: string): void;
102 - /**
103 - * This method does not display anything unless used in the inspector.
104 - * Adds an event with the label `label` to the Timeline panel of the inspector.
105 - */
106 - timeStamp(label?: string): void;
107 - }
108 -
109 - var console: Console;
110 -
111 - namespace NodeJS {
112 - interface ConsoleConstructorOptions {
113 - stdout: WritableStream;
114 - stderr?: WritableStream;
115 - ignoreErrors?: boolean;
116 - colorMode?: boolean | 'auto';
117 - inspectOptions?: InspectOptions;
118 - }
119 -
120 - interface ConsoleConstructor {
121 - prototype: Console;
122 - new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
123 - new(options: ConsoleConstructorOptions): Console;
124 - }
125 -
126 - interface Global {
127 - console: typeof console;
128 - }
129 - }
130 - }
131 -
132 - export = console;
133 -}
1 -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
2 -declare module 'constants' {
3 - import { constants as osConstants, SignalConstants } from 'os';
4 - import { constants as cryptoConstants } from 'crypto';
5 - import { constants as fsConstants } from 'fs';
6 -
7 - const exp: typeof osConstants.errno &
8 - typeof osConstants.priority &
9 - SignalConstants &
10 - typeof cryptoConstants &
11 - typeof fsConstants;
12 - export = exp;
13 -}
1 -declare module 'dgram' {
2 - import { AddressInfo } from 'net';
3 - import * as dns from 'dns';
4 - import EventEmitter = require('events');
5 -
6 - interface RemoteInfo {
7 - address: string;
8 - family: 'IPv4' | 'IPv6';
9 - port: number;
10 - size: number;
11 - }
12 -
13 - interface BindOptions {
14 - port?: number;
15 - address?: string;
16 - exclusive?: boolean;
17 - fd?: number;
18 - }
19 -
20 - type SocketType = "udp4" | "udp6";
21 -
22 - interface SocketOptions {
23 - type: SocketType;
24 - reuseAddr?: boolean;
25 - /**
26 - * @default false
27 - */
28 - ipv6Only?: boolean;
29 - recvBufferSize?: number;
30 - sendBufferSize?: number;
31 - lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
32 - }
33 -
34 - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35 - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
36 -
37 - class Socket extends EventEmitter {
38 - addMembership(multicastAddress: string, multicastInterface?: string): void;
39 - address(): AddressInfo;
40 - bind(port?: number, address?: string, callback?: () => void): void;
41 - bind(port?: number, callback?: () => void): void;
42 - bind(callback?: () => void): void;
43 - bind(options: BindOptions, callback?: () => void): void;
44 - close(callback?: () => void): void;
45 - connect(port: number, address?: string, callback?: () => void): void;
46 - connect(port: number, callback: () => void): void;
47 - disconnect(): void;
48 - dropMembership(multicastAddress: string, multicastInterface?: string): void;
49 - getRecvBufferSize(): number;
50 - getSendBufferSize(): number;
51 - ref(): this;
52 - remoteAddress(): AddressInfo;
53 - send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
54 - send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
55 - send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
56 - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
57 - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
58 - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
59 - setBroadcast(flag: boolean): void;
60 - setMulticastInterface(multicastInterface: string): void;
61 - setMulticastLoopback(flag: boolean): void;
62 - setMulticastTTL(ttl: number): void;
63 - setRecvBufferSize(size: number): void;
64 - setSendBufferSize(size: number): void;
65 - setTTL(ttl: number): void;
66 - unref(): this;
67 - /**
68 - * Tells the kernel to join a source-specific multicast channel at the given
69 - * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the
70 - * `IP_ADD_SOURCE_MEMBERSHIP` socket option.
71 - * If the `multicastInterface` argument
72 - * is not specified, the operating system will choose one interface and will add
73 - * membership to it.
74 - * To add membership to every available interface, call
75 - * `socket.addSourceSpecificMembership()` multiple times, once per interface.
76 - */
77 - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
78 -
79 - /**
80 - * Instructs the kernel to leave a source-specific multicast channel at the given
81 - * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`
82 - * socket option. This method is automatically called by the kernel when the
83 - * socket is closed or the process terminates, so most apps will never have
84 - * reason to call this.
85 - *
86 - * If `multicastInterface` is not specified, the operating system will attempt to
87 - * drop membership on all valid interfaces.
88 - */
89 - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
90 -
91 - /**
92 - * events.EventEmitter
93 - * 1. close
94 - * 2. connect
95 - * 3. error
96 - * 4. listening
97 - * 5. message
98 - */
99 - addListener(event: string, listener: (...args: any[]) => void): this;
100 - addListener(event: "close", listener: () => void): this;
101 - addListener(event: "connect", listener: () => void): this;
102 - addListener(event: "error", listener: (err: Error) => void): this;
103 - addListener(event: "listening", listener: () => void): this;
104 - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
105 -
106 - emit(event: string | symbol, ...args: any[]): boolean;
107 - emit(event: "close"): boolean;
108 - emit(event: "connect"): boolean;
109 - emit(event: "error", err: Error): boolean;
110 - emit(event: "listening"): boolean;
111 - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
112 -
113 - on(event: string, listener: (...args: any[]) => void): this;
114 - on(event: "close", listener: () => void): this;
115 - on(event: "connect", listener: () => void): this;
116 - on(event: "error", listener: (err: Error) => void): this;
117 - on(event: "listening", listener: () => void): this;
118 - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
119 -
120 - once(event: string, listener: (...args: any[]) => void): this;
121 - once(event: "close", listener: () => void): this;
122 - once(event: "connect", listener: () => void): this;
123 - once(event: "error", listener: (err: Error) => void): this;
124 - once(event: "listening", listener: () => void): this;
125 - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
126 -
127 - prependListener(event: string, listener: (...args: any[]) => void): this;
128 - prependListener(event: "close", listener: () => void): this;
129 - prependListener(event: "connect", listener: () => void): this;
130 - prependListener(event: "error", listener: (err: Error) => void): this;
131 - prependListener(event: "listening", listener: () => void): this;
132 - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
133 -
134 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
135 - prependOnceListener(event: "close", listener: () => void): this;
136 - prependOnceListener(event: "connect", listener: () => void): this;
137 - prependOnceListener(event: "error", listener: (err: Error) => void): this;
138 - prependOnceListener(event: "listening", listener: () => void): this;
139 - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
140 - }
141 -}
1 -declare module 'domain' {
2 - import EventEmitter = require('events');
3 -
4 - global {
5 - namespace NodeJS {
6 - interface Domain extends EventEmitter {
7 - run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
8 - add(emitter: EventEmitter | Timer): void;
9 - remove(emitter: EventEmitter | Timer): void;
10 - bind<T extends Function>(cb: T): T;
11 - intercept<T extends Function>(cb: T): T;
12 - }
13 - }
14 - }
15 -
16 - interface Domain extends NodeJS.Domain {}
17 - class Domain extends EventEmitter {
18 - members: Array<EventEmitter | NodeJS.Timer>;
19 - enter(): void;
20 - exit(): void;
21 - }
22 -
23 - function create(): Domain;
24 -}
1 -declare module 'events' {
2 - interface EventEmitterOptions {
3 - /**
4 - * Enables automatic capturing of promise rejection.
5 - */
6 - captureRejections?: boolean;
7 - }
8 -
9 - interface NodeEventTarget {
10 - once(event: string | symbol, listener: (...args: any[]) => void): this;
11 - }
12 -
13 - interface DOMEventTarget {
14 - addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
15 - }
16 -
17 - interface EventEmitter extends NodeJS.EventEmitter {}
18 - class EventEmitter {
19 - constructor(options?: EventEmitterOptions);
20 -
21 - static once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
22 - static once(emitter: DOMEventTarget, event: string): Promise<any[]>;
23 - static on(emitter: NodeJS.EventEmitter, event: string): AsyncIterableIterator<any>;
24 -
25 - /** @deprecated since v4.0.0 */
26 - static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
27 -
28 - /**
29 - * This symbol shall be used to install a listener for only monitoring `'error'`
30 - * events. Listeners installed using this symbol are called before the regular
31 - * `'error'` listeners are called.
32 - *
33 - * Installing a listener using this symbol does not change the behavior once an
34 - * `'error'` event is emitted, therefore the process will still crash if no
35 - * regular `'error'` listener is installed.
36 - */
37 - static readonly errorMonitor: unique symbol;
38 - static readonly captureRejectionSymbol: unique symbol;
39 -
40 - /**
41 - * Sets or gets the default captureRejection value for all emitters.
42 - */
43 - // TODO: These should be described using static getter/setter pairs:
44 - static captureRejections: boolean;
45 - static defaultMaxListeners: number;
46 - }
47 -
48 - import internal = require('events');
49 - namespace EventEmitter {
50 - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
51 - export { internal as EventEmitter };
52 - }
53 -
54 - global {
55 - namespace NodeJS {
56 - interface EventEmitter {
57 - addListener(event: string | symbol, listener: (...args: any[]) => void): this;
58 - on(event: string | symbol, listener: (...args: any[]) => void): this;
59 - once(event: string | symbol, listener: (...args: any[]) => void): this;
60 - removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
61 - off(event: string | symbol, listener: (...args: any[]) => void): this;
62 - removeAllListeners(event?: string | symbol): this;
63 - setMaxListeners(n: number): this;
64 - getMaxListeners(): number;
65 - listeners(event: string | symbol): Function[];
66 - rawListeners(event: string | symbol): Function[];
67 - emit(event: string | symbol, ...args: any[]): boolean;
68 - listenerCount(event: string | symbol): number;
69 - // Added in Node 6...
70 - prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
71 - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
72 - eventNames(): Array<string | symbol>;
73 - }
74 - }
75 - }
76 -
77 - export = EventEmitter;
78 -}
This diff could not be displayed because it is too large.
1 -declare var global: NodeJS.Global & typeof globalThis;
1 -declare module 'https' {
2 - import * as tls from 'tls';
3 - import * as http from 'http';
4 - import { URL } from 'url';
5 -
6 - type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
7 -
8 - type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
9 - rejectUnauthorized?: boolean; // Defaults to true
10 - servername?: string; // SNI TLS Extension
11 - };
12 -
13 - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
14 - rejectUnauthorized?: boolean;
15 - maxCachedSessions?: number;
16 - }
17 -
18 - class Agent extends http.Agent {
19 - constructor(options?: AgentOptions);
20 - options: AgentOptions;
21 - }
22 -
23 - interface Server extends http.HttpBase {}
24 - class Server extends tls.Server {
25 - constructor(requestListener?: http.RequestListener);
26 - constructor(options: ServerOptions, requestListener?: http.RequestListener);
27 - }
28 -
29 - function createServer(requestListener?: http.RequestListener): Server;
30 - function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
31 - function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
32 - function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
33 - function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
34 - function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
35 - let globalAgent: Agent;
36 -}
1 -// Type definitions for non-npm package Node.js 14.17
2 -// Project: http://nodejs.org/
3 -// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4 -// DefinitelyTyped <https://github.com/DefinitelyTyped>
5 -// Alberto Schiabel <https://github.com/jkomyno>
6 -// Alvis HT Tang <https://github.com/alvis>
7 -// Andrew Makarov <https://github.com/r3nya>
8 -// Benjamin Toueg <https://github.com/btoueg>
9 -// Chigozirim C. <https://github.com/smac89>
10 -// David Junger <https://github.com/touffy>
11 -// Deividas Bakanas <https://github.com/DeividasBakanas>
12 -// Eugene Y. Q. Shen <https://github.com/eyqs>
13 -// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
14 -// Hoàng Văn Khải <https://github.com/KSXGitHub>
15 -// Huw <https://github.com/hoo29>
16 -// Kelvin Jin <https://github.com/kjin>
17 -// Klaus Meinhardt <https://github.com/ajafff>
18 -// Lishude <https://github.com/islishude>
19 -// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
20 -// Mohsen Azimi <https://github.com/mohsen1>
21 -// Nicolas Even <https://github.com/n-e>
22 -// Nikita Galkin <https://github.com/galkin>
23 -// Parambir Singh <https://github.com/parambirs>
24 -// Sebastian Silbermann <https://github.com/eps1lon>
25 -// Simon Schick <https://github.com/SimonSchick>
26 -// Thomas den Hollander <https://github.com/ThomasdenH>
27 -// Wilco Bakker <https://github.com/WilcoBakker>
28 -// wwwy3y3 <https://github.com/wwwy3y3>
29 -// Samuel Ainsworth <https://github.com/samuela>
30 -// Kyle Uehlein <https://github.com/kuehlein>
31 -// Thanik Bhongbhibhat <https://github.com/bhongy>
32 -// Marcin Kopacz <https://github.com/chyzwar>
33 -// Trivikram Kamat <https://github.com/trivikr>
34 -// Minh Son Nguyen <https://github.com/nguymin4>
35 -// Junxiao Shi <https://github.com/yoursunny>
36 -// Ilia Baryshnikov <https://github.com/qwelias>
37 -// ExE Boss <https://github.com/ExE-Boss>
38 -// Surasak Chaisurin <https://github.com/Ryan-Willpower>
39 -// Piotr Błażejewicz <https://github.com/peterblazejewicz>
40 -// Anna Henningsen <https://github.com/addaleax>
41 -// Jason Kwok <https://github.com/JasonHK>
42 -// Victor Perin <https://github.com/victorperin>
43 -// Yongsheng Zhang <https://github.com/ZYSzys>
44 -// Bond <https://github.com/bondz>
45 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
46 -
47 -// NOTE: These definitions support NodeJS and TypeScript 3.7.
48 -// Typically type modifications should be made in base.d.ts instead of here
49 -
50 -/// <reference path="base.d.ts" />
51 -
52 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
53 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
54 -// - ~/index.d.ts - Definitions specific to TypeScript 2.8
55 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5
56 -
57 -// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides
58 -// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
59 -// prior to TypeScript 3.5, so the older definitions will be found here.
This diff could not be displayed because it is too large.
1 -declare module 'module' {
2 - import { URL } from 'url';
3 - namespace Module {
4 - /**
5 - * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
6 - * It does not add or remove exported names from the ES Modules.
7 - */
8 - function syncBuiltinESMExports(): void;
9 -
10 - function findSourceMap(path: string, error?: Error): SourceMap;
11 - interface SourceMapPayload {
12 - file: string;
13 - version: number;
14 - sources: string[];
15 - sourcesContent: string[];
16 - names: string[];
17 - mappings: string;
18 - sourceRoot: string;
19 - }
20 -
21 - interface SourceMapping {
22 - generatedLine: number;
23 - generatedColumn: number;
24 - originalSource: string;
25 - originalLine: number;
26 - originalColumn: number;
27 - }
28 -
29 - class SourceMap {
30 - readonly payload: SourceMapPayload;
31 - constructor(payload: SourceMapPayload);
32 - findEntry(line: number, column: number): SourceMapping;
33 - }
34 - }
35 - interface Module extends NodeModule {}
36 - class Module {
37 - static runMain(): void;
38 - static wrap(code: string): string;
39 -
40 - /**
41 - * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
42 - */
43 - static createRequireFromPath(path: string): NodeRequire;
44 - static createRequire(path: string | URL): NodeRequire;
45 - static builtinModules: string[];
46 -
47 - static Module: typeof Module;
48 -
49 - constructor(id: string, parent?: Module);
50 - }
51 - export = Module;
52 -}
1 -declare module 'os' {
2 - interface CpuInfo {
3 - model: string;
4 - speed: number;
5 - times: {
6 - user: number;
7 - nice: number;
8 - sys: number;
9 - idle: number;
10 - irq: number;
11 - };
12 - }
13 -
14 - interface NetworkInterfaceBase {
15 - address: string;
16 - netmask: string;
17 - mac: string;
18 - internal: boolean;
19 - cidr: string | null;
20 - }
21 -
22 - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
23 - family: "IPv4";
24 - }
25 -
26 - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
27 - family: "IPv6";
28 - scopeid: number;
29 - }
30 -
31 - interface UserInfo<T> {
32 - username: T;
33 - uid: number;
34 - gid: number;
35 - shell: T;
36 - homedir: T;
37 - }
38 -
39 - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
40 -
41 - function hostname(): string;
42 - function loadavg(): number[];
43 - function uptime(): number;
44 - function freemem(): number;
45 - function totalmem(): number;
46 - function cpus(): CpuInfo[];
47 - function type(): string;
48 - function release(): string;
49 - function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
50 - function homedir(): string;
51 - function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52 - function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
53 -
54 - type SignalConstants = {
55 - [key in NodeJS.Signals]: number;
56 - };
57 -
58 - namespace constants {
59 - const UV_UDP_REUSEADDR: number;
60 - namespace signals {}
61 - const signals: SignalConstants;
62 - namespace errno {
63 - const E2BIG: number;
64 - const EACCES: number;
65 - const EADDRINUSE: number;
66 - const EADDRNOTAVAIL: number;
67 - const EAFNOSUPPORT: number;
68 - const EAGAIN: number;
69 - const EALREADY: number;
70 - const EBADF: number;
71 - const EBADMSG: number;
72 - const EBUSY: number;
73 - const ECANCELED: number;
74 - const ECHILD: number;
75 - const ECONNABORTED: number;
76 - const ECONNREFUSED: number;
77 - const ECONNRESET: number;
78 - const EDEADLK: number;
79 - const EDESTADDRREQ: number;
80 - const EDOM: number;
81 - const EDQUOT: number;
82 - const EEXIST: number;
83 - const EFAULT: number;
84 - const EFBIG: number;
85 - const EHOSTUNREACH: number;
86 - const EIDRM: number;
87 - const EILSEQ: number;
88 - const EINPROGRESS: number;
89 - const EINTR: number;
90 - const EINVAL: number;
91 - const EIO: number;
92 - const EISCONN: number;
93 - const EISDIR: number;
94 - const ELOOP: number;
95 - const EMFILE: number;
96 - const EMLINK: number;
97 - const EMSGSIZE: number;
98 - const EMULTIHOP: number;
99 - const ENAMETOOLONG: number;
100 - const ENETDOWN: number;
101 - const ENETRESET: number;
102 - const ENETUNREACH: number;
103 - const ENFILE: number;
104 - const ENOBUFS: number;
105 - const ENODATA: number;
106 - const ENODEV: number;
107 - const ENOENT: number;
108 - const ENOEXEC: number;
109 - const ENOLCK: number;
110 - const ENOLINK: number;
111 - const ENOMEM: number;
112 - const ENOMSG: number;
113 - const ENOPROTOOPT: number;
114 - const ENOSPC: number;
115 - const ENOSR: number;
116 - const ENOSTR: number;
117 - const ENOSYS: number;
118 - const ENOTCONN: number;
119 - const ENOTDIR: number;
120 - const ENOTEMPTY: number;
121 - const ENOTSOCK: number;
122 - const ENOTSUP: number;
123 - const ENOTTY: number;
124 - const ENXIO: number;
125 - const EOPNOTSUPP: number;
126 - const EOVERFLOW: number;
127 - const EPERM: number;
128 - const EPIPE: number;
129 - const EPROTO: number;
130 - const EPROTONOSUPPORT: number;
131 - const EPROTOTYPE: number;
132 - const ERANGE: number;
133 - const EROFS: number;
134 - const ESPIPE: number;
135 - const ESRCH: number;
136 - const ESTALE: number;
137 - const ETIME: number;
138 - const ETIMEDOUT: number;
139 - const ETXTBSY: number;
140 - const EWOULDBLOCK: number;
141 - const EXDEV: number;
142 - const WSAEINTR: number;
143 - const WSAEBADF: number;
144 - const WSAEACCES: number;
145 - const WSAEFAULT: number;
146 - const WSAEINVAL: number;
147 - const WSAEMFILE: number;
148 - const WSAEWOULDBLOCK: number;
149 - const WSAEINPROGRESS: number;
150 - const WSAEALREADY: number;
151 - const WSAENOTSOCK: number;
152 - const WSAEDESTADDRREQ: number;
153 - const WSAEMSGSIZE: number;
154 - const WSAEPROTOTYPE: number;
155 - const WSAENOPROTOOPT: number;
156 - const WSAEPROTONOSUPPORT: number;
157 - const WSAESOCKTNOSUPPORT: number;
158 - const WSAEOPNOTSUPP: number;
159 - const WSAEPFNOSUPPORT: number;
160 - const WSAEAFNOSUPPORT: number;
161 - const WSAEADDRINUSE: number;
162 - const WSAEADDRNOTAVAIL: number;
163 - const WSAENETDOWN: number;
164 - const WSAENETUNREACH: number;
165 - const WSAENETRESET: number;
166 - const WSAECONNABORTED: number;
167 - const WSAECONNRESET: number;
168 - const WSAENOBUFS: number;
169 - const WSAEISCONN: number;
170 - const WSAENOTCONN: number;
171 - const WSAESHUTDOWN: number;
172 - const WSAETOOMANYREFS: number;
173 - const WSAETIMEDOUT: number;
174 - const WSAECONNREFUSED: number;
175 - const WSAELOOP: number;
176 - const WSAENAMETOOLONG: number;
177 - const WSAEHOSTDOWN: number;
178 - const WSAEHOSTUNREACH: number;
179 - const WSAENOTEMPTY: number;
180 - const WSAEPROCLIM: number;
181 - const WSAEUSERS: number;
182 - const WSAEDQUOT: number;
183 - const WSAESTALE: number;
184 - const WSAEREMOTE: number;
185 - const WSASYSNOTREADY: number;
186 - const WSAVERNOTSUPPORTED: number;
187 - const WSANOTINITIALISED: number;
188 - const WSAEDISCON: number;
189 - const WSAENOMORE: number;
190 - const WSAECANCELLED: number;
191 - const WSAEINVALIDPROCTABLE: number;
192 - const WSAEINVALIDPROVIDER: number;
193 - const WSAEPROVIDERFAILEDINIT: number;
194 - const WSASYSCALLFAILURE: number;
195 - const WSASERVICE_NOT_FOUND: number;
196 - const WSATYPE_NOT_FOUND: number;
197 - const WSA_E_NO_MORE: number;
198 - const WSA_E_CANCELLED: number;
199 - const WSAEREFUSED: number;
200 - }
201 - namespace priority {
202 - const PRIORITY_LOW: number;
203 - const PRIORITY_BELOW_NORMAL: number;
204 - const PRIORITY_NORMAL: number;
205 - const PRIORITY_ABOVE_NORMAL: number;
206 - const PRIORITY_HIGH: number;
207 - const PRIORITY_HIGHEST: number;
208 - }
209 - }
210 -
211 - function arch(): string;
212 - /**
213 - * Returns a string identifying the kernel version.
214 - * On POSIX systems, the operating system release is determined by calling
215 - * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
216 - * `GetVersionExW()` will be used. See
217 - * https://en.wikipedia.org/wiki/Uname#Examples for more information.
218 - */
219 - function version(): string;
220 - function platform(): NodeJS.Platform;
221 - function tmpdir(): string;
222 - const EOL: string;
223 - function endianness(): "BE" | "LE";
224 - /**
225 - * Gets the priority of a process.
226 - * Defaults to current process.
227 - */
228 - function getPriority(pid?: number): number;
229 - /**
230 - * Sets the priority of the current process.
231 - * @param priority Must be in range of -20 to 19
232 - */
233 - function setPriority(priority: number): void;
234 - /**
235 - * Sets the priority of the process specified process.
236 - * @param priority Must be in range of -20 to 19
237 - */
238 - function setPriority(pid: number, priority: number): void;
239 -}
1 -{
2 - "_args": [
3 - [
4 - "@types/node@14.17.0",
5 - "C:\\Users\\MS\\Documents\\opensourseSW\\LineMusicChatbot"
6 - ]
7 - ],
8 - "_from": "@types/node@14.17.0",
9 - "_id": "@types/node@14.17.0",
10 - "_inBundle": false,
11 - "_integrity": "sha512-w8VZUN/f7SSbvVReb9SWp6cJFevxb4/nkG65yLAya//98WgocKm5PLDAtSs5CtJJJM+kHmJjO/6mmYW4MHShZA==",
12 - "_location": "/@line/bot-sdk/@types/node",
13 - "_phantomChildren": {},
14 - "_requested": {
15 - "type": "version",
16 - "registry": true,
17 - "raw": "@types/node@14.17.0",
18 - "name": "@types/node",
19 - "escapedName": "@types%2fnode",
20 - "scope": "@types",
21 - "rawSpec": "14.17.0",
22 - "saveSpec": null,
23 - "fetchSpec": "14.17.0"
24 - },
25 - "_requiredBy": [
26 - "/@line/bot-sdk"
27 - ],
28 - "_resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.0.tgz",
29 - "_spec": "14.17.0",
30 - "_where": "C:\\Users\\MS\\Documents\\opensourseSW\\LineMusicChatbot",
31 - "bugs": {
32 - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
33 - },
34 - "contributors": [
35 - {
36 - "name": "Microsoft TypeScript",
37 - "url": "https://github.com/Microsoft"
38 - },
39 - {
40 - "name": "DefinitelyTyped",
41 - "url": "https://github.com/DefinitelyTyped"
42 - },
43 - {
44 - "name": "Alberto Schiabel",
45 - "url": "https://github.com/jkomyno"
46 - },
47 - {
48 - "name": "Alvis HT Tang",
49 - "url": "https://github.com/alvis"
50 - },
51 - {
52 - "name": "Andrew Makarov",
53 - "url": "https://github.com/r3nya"
54 - },
55 - {
56 - "name": "Benjamin Toueg",
57 - "url": "https://github.com/btoueg"
58 - },
59 - {
60 - "name": "Chigozirim C.",
61 - "url": "https://github.com/smac89"
62 - },
63 - {
64 - "name": "David Junger",
65 - "url": "https://github.com/touffy"
66 - },
67 - {
68 - "name": "Deividas Bakanas",
69 - "url": "https://github.com/DeividasBakanas"
70 - },
71 - {
72 - "name": "Eugene Y. Q. Shen",
73 - "url": "https://github.com/eyqs"
74 - },
75 - {
76 - "name": "Hannes Magnusson",
77 - "url": "https://github.com/Hannes-Magnusson-CK"
78 - },
79 - {
80 - "name": "Hoàng Văn Khải",
81 - "url": "https://github.com/KSXGitHub"
82 - },
83 - {
84 - "name": "Huw",
85 - "url": "https://github.com/hoo29"
86 - },
87 - {
88 - "name": "Kelvin Jin",
89 - "url": "https://github.com/kjin"
90 - },
91 - {
92 - "name": "Klaus Meinhardt",
93 - "url": "https://github.com/ajafff"
94 - },
95 - {
96 - "name": "Lishude",
97 - "url": "https://github.com/islishude"
98 - },
99 - {
100 - "name": "Mariusz Wiktorczyk",
101 - "url": "https://github.com/mwiktorczyk"
102 - },
103 - {
104 - "name": "Mohsen Azimi",
105 - "url": "https://github.com/mohsen1"
106 - },
107 - {
108 - "name": "Nicolas Even",
109 - "url": "https://github.com/n-e"
110 - },
111 - {
112 - "name": "Nikita Galkin",
113 - "url": "https://github.com/galkin"
114 - },
115 - {
116 - "name": "Parambir Singh",
117 - "url": "https://github.com/parambirs"
118 - },
119 - {
120 - "name": "Sebastian Silbermann",
121 - "url": "https://github.com/eps1lon"
122 - },
123 - {
124 - "name": "Simon Schick",
125 - "url": "https://github.com/SimonSchick"
126 - },
127 - {
128 - "name": "Thomas den Hollander",
129 - "url": "https://github.com/ThomasdenH"
130 - },
131 - {
132 - "name": "Wilco Bakker",
133 - "url": "https://github.com/WilcoBakker"
134 - },
135 - {
136 - "name": "wwwy3y3",
137 - "url": "https://github.com/wwwy3y3"
138 - },
139 - {
140 - "name": "Samuel Ainsworth",
141 - "url": "https://github.com/samuela"
142 - },
143 - {
144 - "name": "Kyle Uehlein",
145 - "url": "https://github.com/kuehlein"
146 - },
147 - {
148 - "name": "Thanik Bhongbhibhat",
149 - "url": "https://github.com/bhongy"
150 - },
151 - {
152 - "name": "Marcin Kopacz",
153 - "url": "https://github.com/chyzwar"
154 - },
155 - {
156 - "name": "Trivikram Kamat",
157 - "url": "https://github.com/trivikr"
158 - },
159 - {
160 - "name": "Minh Son Nguyen",
161 - "url": "https://github.com/nguymin4"
162 - },
163 - {
164 - "name": "Junxiao Shi",
165 - "url": "https://github.com/yoursunny"
166 - },
167 - {
168 - "name": "Ilia Baryshnikov",
169 - "url": "https://github.com/qwelias"
170 - },
171 - {
172 - "name": "ExE Boss",
173 - "url": "https://github.com/ExE-Boss"
174 - },
175 - {
176 - "name": "Surasak Chaisurin",
177 - "url": "https://github.com/Ryan-Willpower"
178 - },
179 - {
180 - "name": "Piotr Błażejewicz",
181 - "url": "https://github.com/peterblazejewicz"
182 - },
183 - {
184 - "name": "Anna Henningsen",
185 - "url": "https://github.com/addaleax"
186 - },
187 - {
188 - "name": "Jason Kwok",
189 - "url": "https://github.com/JasonHK"
190 - },
191 - {
192 - "name": "Victor Perin",
193 - "url": "https://github.com/victorperin"
194 - },
195 - {
196 - "name": "Yongsheng Zhang",
197 - "url": "https://github.com/ZYSzys"
198 - },
199 - {
200 - "name": "Bond",
201 - "url": "https://github.com/bondz"
202 - }
203 - ],
204 - "dependencies": {},
205 - "description": "TypeScript definitions for Node.js",
206 - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
207 - "license": "MIT",
208 - "main": "",
209 - "name": "@types/node",
210 - "repository": {
211 - "type": "git",
212 - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
213 - "directory": "types/node"
214 - },
215 - "scripts": {},
216 - "typeScriptVersion": "3.5",
217 - "types": "index.d.ts",
218 - "typesPublisherContentHash": "59aa27843360a7098bd998782f2b3887cf699ed3bd362c55c887193910a8ec4c",
219 - "typesVersions": {
220 - "<=3.6": {
221 - "*": [
222 - "ts3.6/*"
223 - ]
224 - }
225 - },
226 - "version": "14.17.0"
227 -}
1 -declare module 'path' {
2 - namespace path {
3 - /**
4 - * A parsed path object generated by path.parse() or consumed by path.format().
5 - */
6 - interface ParsedPath {
7 - /**
8 - * The root of the path such as '/' or 'c:\'
9 - */
10 - root: string;
11 - /**
12 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
13 - */
14 - dir: string;
15 - /**
16 - * The file name including extension (if any) such as 'index.html'
17 - */
18 - base: string;
19 - /**
20 - * The file extension (if any) such as '.html'
21 - */
22 - ext: string;
23 - /**
24 - * The file name without extension (if any) such as 'index'
25 - */
26 - name: string;
27 - }
28 -
29 - interface FormatInputPathObject {
30 - /**
31 - * The root of the path such as '/' or 'c:\'
32 - */
33 - root?: string;
34 - /**
35 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
36 - */
37 - dir?: string;
38 - /**
39 - * The file name including extension (if any) such as 'index.html'
40 - */
41 - base?: string;
42 - /**
43 - * The file extension (if any) such as '.html'
44 - */
45 - ext?: string;
46 - /**
47 - * The file name without extension (if any) such as 'index'
48 - */
49 - name?: string;
50 - }
51 -
52 - interface PlatformPath {
53 - /**
54 - * Normalize a string path, reducing '..' and '.' parts.
55 - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
56 - *
57 - * @param p string path to normalize.
58 - */
59 - normalize(p: string): string;
60 - /**
61 - * Join all arguments together and normalize the resulting path.
62 - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
63 - *
64 - * @param paths paths to join.
65 - */
66 - join(...paths: string[]): string;
67 - /**
68 - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
69 - *
70 - * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
71 - *
72 - * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
73 - * until an absolute path is found. If after using all {from} paths still no absolute path is found,
74 - * the current working directory is used as well. The resulting path is normalized,
75 - * and trailing slashes are removed unless the path gets resolved to the root directory.
76 - *
77 - * @param pathSegments string paths to join. Non-string arguments are ignored.
78 - */
79 - resolve(...pathSegments: string[]): string;
80 - /**
81 - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
82 - *
83 - * @param path path to test.
84 - */
85 - isAbsolute(p: string): boolean;
86 - /**
87 - * Solve the relative path from {from} to {to}.
88 - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
89 - */
90 - relative(from: string, to: string): string;
91 - /**
92 - * Return the directory name of a path. Similar to the Unix dirname command.
93 - *
94 - * @param p the path to evaluate.
95 - */
96 - dirname(p: string): string;
97 - /**
98 - * Return the last portion of a path. Similar to the Unix basename command.
99 - * Often used to extract the file name from a fully qualified path.
100 - *
101 - * @param p the path to evaluate.
102 - * @param ext optionally, an extension to remove from the result.
103 - */
104 - basename(p: string, ext?: string): string;
105 - /**
106 - * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
107 - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
108 - *
109 - * @param p the path to evaluate.
110 - */
111 - extname(p: string): string;
112 - /**
113 - * The platform-specific file separator. '\\' or '/'.
114 - */
115 - readonly sep: string;
116 - /**
117 - * The platform-specific file delimiter. ';' or ':'.
118 - */
119 - readonly delimiter: string;
120 - /**
121 - * Returns an object from a path string - the opposite of format().
122 - *
123 - * @param pathString path to evaluate.
124 - */
125 - parse(p: string): ParsedPath;
126 - /**
127 - * Returns a path string from an object - the opposite of parse().
128 - *
129 - * @param pathString path to evaluate.
130 - */
131 - format(pP: FormatInputPathObject): string;
132 - /**
133 - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
134 - * If path is not a string, path will be returned without modifications.
135 - * This method is meaningful only on Windows system.
136 - * On POSIX systems, the method is non-operational and always returns path without modifications.
137 - */
138 - toNamespacedPath(path: string): string;
139 - /**
140 - * Posix specific pathing.
141 - * Same as parent object on posix.
142 - */
143 - readonly posix: PlatformPath;
144 - /**
145 - * Windows specific pathing.
146 - * Same as parent object on windows
147 - */
148 - readonly win32: PlatformPath;
149 - }
150 - }
151 - const path: path.PlatformPath;
152 - export = path;
153 -}
1 -/**
2 - * @deprecated since v7.0.0
3 - * The version of the punycode module bundled in Node.js is being deprecated.
4 - * In a future major version of Node.js this module will be removed.
5 - * Users currently depending on the punycode module should switch to using
6 - * the userland-provided Punycode.js module instead.
7 - */
8 -declare module 'punycode' {
9 - /**
10 - * @deprecated since v7.0.0
11 - * The version of the punycode module bundled in Node.js is being deprecated.
12 - * In a future major version of Node.js this module will be removed.
13 - * Users currently depending on the punycode module should switch to using
14 - * the userland-provided Punycode.js module instead.
15 - */
16 - function decode(string: string): string;
17 - /**
18 - * @deprecated since v7.0.0
19 - * The version of the punycode module bundled in Node.js is being deprecated.
20 - * In a future major version of Node.js this module will be removed.
21 - * Users currently depending on the punycode module should switch to using
22 - * the userland-provided Punycode.js module instead.
23 - */
24 - function encode(string: string): string;
25 - /**
26 - * @deprecated since v7.0.0
27 - * The version of the punycode module bundled in Node.js is being deprecated.
28 - * In a future major version of Node.js this module will be removed.
29 - * Users currently depending on the punycode module should switch to using
30 - * the userland-provided Punycode.js module instead.
31 - */
32 - function toUnicode(domain: string): string;
33 - /**
34 - * @deprecated since v7.0.0
35 - * The version of the punycode module bundled in Node.js is being deprecated.
36 - * In a future major version of Node.js this module will be removed.
37 - * Users currently depending on the punycode module should switch to using
38 - * the userland-provided Punycode.js module instead.
39 - */
40 - function toASCII(domain: string): string;
41 - /**
42 - * @deprecated since v7.0.0
43 - * The version of the punycode module bundled in Node.js is being deprecated.
44 - * In a future major version of Node.js this module will be removed.
45 - * Users currently depending on the punycode module should switch to using
46 - * the userland-provided Punycode.js module instead.
47 - */
48 - const ucs2: ucs2;
49 - interface ucs2 {
50 - /**
51 - * @deprecated since v7.0.0
52 - * The version of the punycode module bundled in Node.js is being deprecated.
53 - * In a future major version of Node.js this module will be removed.
54 - * Users currently depending on the punycode module should switch to using
55 - * the userland-provided Punycode.js module instead.
56 - */
57 - decode(string: string): number[];
58 - /**
59 - * @deprecated since v7.0.0
60 - * The version of the punycode module bundled in Node.js is being deprecated.
61 - * In a future major version of Node.js this module will be removed.
62 - * Users currently depending on the punycode module should switch to using
63 - * the userland-provided Punycode.js module instead.
64 - */
65 - encode(codePoints: ReadonlyArray<number>): string;
66 - }
67 - /**
68 - * @deprecated since v7.0.0
69 - * The version of the punycode module bundled in Node.js is being deprecated.
70 - * In a future major version of Node.js this module will be removed.
71 - * Users currently depending on the punycode module should switch to using
72 - * the userland-provided Punycode.js module instead.
73 - */
74 - const version: string;
75 -}
1 -declare module 'querystring' {
2 - interface StringifyOptions {
3 - encodeURIComponent?: (str: string) => string;
4 - }
5 -
6 - interface ParseOptions {
7 - maxKeys?: number;
8 - decodeURIComponent?: (str: string) => string;
9 - }
10 -
11 - interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
12 -
13 - interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {
14 - }
15 -
16 - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
17 - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
18 - /**
19 - * The querystring.encode() function is an alias for querystring.stringify().
20 - */
21 - const encode: typeof stringify;
22 - /**
23 - * The querystring.decode() function is an alias for querystring.parse().
24 - */
25 - const decode: typeof parse;
26 - function escape(str: string): string;
27 - function unescape(str: string): string;
28 -}
1 -declare module 'readline' {
2 - import EventEmitter = require('events');
3 -
4 - interface Key {
5 - sequence?: string;
6 - name?: string;
7 - ctrl?: boolean;
8 - meta?: boolean;
9 - shift?: boolean;
10 - }
11 -
12 - class Interface extends EventEmitter {
13 - readonly terminal: boolean;
14 -
15 - // Need direct access to line/cursor data, for use in external processes
16 - // see: https://github.com/nodejs/node/issues/30347
17 - /** The current input data */
18 - readonly line: string;
19 - /** The current cursor position in the input line */
20 - readonly cursor: number;
21 -
22 - /**
23 - * NOTE: According to the documentation:
24 - *
25 - * > Instances of the `readline.Interface` class are constructed using the
26 - * > `readline.createInterface()` method.
27 - *
28 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
29 - */
30 - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
31 - /**
32 - * NOTE: According to the documentation:
33 - *
34 - * > Instances of the `readline.Interface` class are constructed using the
35 - * > `readline.createInterface()` method.
36 - *
37 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
38 - */
39 - protected constructor(options: ReadLineOptions);
40 -
41 - setPrompt(prompt: string): void;
42 - prompt(preserveCursor?: boolean): void;
43 - question(query: string, callback: (answer: string) => void): void;
44 - pause(): this;
45 - resume(): this;
46 - close(): void;
47 - write(data: string | Buffer, key?: Key): void;
48 -
49 - /**
50 - * Returns the real position of the cursor in relation to the input
51 - * prompt + string. Long input (wrapping) strings, as well as multiple
52 - * line prompts are included in the calculations.
53 - */
54 - getCursorPos(): CursorPos;
55 -
56 - /**
57 - * events.EventEmitter
58 - * 1. close
59 - * 2. line
60 - * 3. pause
61 - * 4. resume
62 - * 5. SIGCONT
63 - * 6. SIGINT
64 - * 7. SIGTSTP
65 - */
66 -
67 - addListener(event: string, listener: (...args: any[]) => void): this;
68 - addListener(event: "close", listener: () => void): this;
69 - addListener(event: "line", listener: (input: string) => void): this;
70 - addListener(event: "pause", listener: () => void): this;
71 - addListener(event: "resume", listener: () => void): this;
72 - addListener(event: "SIGCONT", listener: () => void): this;
73 - addListener(event: "SIGINT", listener: () => void): this;
74 - addListener(event: "SIGTSTP", listener: () => void): this;
75 -
76 - emit(event: string | symbol, ...args: any[]): boolean;
77 - emit(event: "close"): boolean;
78 - emit(event: "line", input: string): boolean;
79 - emit(event: "pause"): boolean;
80 - emit(event: "resume"): boolean;
81 - emit(event: "SIGCONT"): boolean;
82 - emit(event: "SIGINT"): boolean;
83 - emit(event: "SIGTSTP"): boolean;
84 -
85 - on(event: string, listener: (...args: any[]) => void): this;
86 - on(event: "close", listener: () => void): this;
87 - on(event: "line", listener: (input: string) => void): this;
88 - on(event: "pause", listener: () => void): this;
89 - on(event: "resume", listener: () => void): this;
90 - on(event: "SIGCONT", listener: () => void): this;
91 - on(event: "SIGINT", listener: () => void): this;
92 - on(event: "SIGTSTP", listener: () => void): this;
93 -
94 - once(event: string, listener: (...args: any[]) => void): this;
95 - once(event: "close", listener: () => void): this;
96 - once(event: "line", listener: (input: string) => void): this;
97 - once(event: "pause", listener: () => void): this;
98 - once(event: "resume", listener: () => void): this;
99 - once(event: "SIGCONT", listener: () => void): this;
100 - once(event: "SIGINT", listener: () => void): this;
101 - once(event: "SIGTSTP", listener: () => void): this;
102 -
103 - prependListener(event: string, listener: (...args: any[]) => void): this;
104 - prependListener(event: "close", listener: () => void): this;
105 - prependListener(event: "line", listener: (input: string) => void): this;
106 - prependListener(event: "pause", listener: () => void): this;
107 - prependListener(event: "resume", listener: () => void): this;
108 - prependListener(event: "SIGCONT", listener: () => void): this;
109 - prependListener(event: "SIGINT", listener: () => void): this;
110 - prependListener(event: "SIGTSTP", listener: () => void): this;
111 -
112 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
113 - prependOnceListener(event: "close", listener: () => void): this;
114 - prependOnceListener(event: "line", listener: (input: string) => void): this;
115 - prependOnceListener(event: "pause", listener: () => void): this;
116 - prependOnceListener(event: "resume", listener: () => void): this;
117 - prependOnceListener(event: "SIGCONT", listener: () => void): this;
118 - prependOnceListener(event: "SIGINT", listener: () => void): this;
119 - prependOnceListener(event: "SIGTSTP", listener: () => void): this;
120 - [Symbol.asyncIterator](): AsyncIterableIterator<string>;
121 - }
122 -
123 - type ReadLine = Interface; // type forwarded for backwards compatibility
124 -
125 - type Completer = (line: string) => CompleterResult;
126 - type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
127 -
128 - type CompleterResult = [string[], string];
129 -
130 - interface ReadLineOptions {
131 - input: NodeJS.ReadableStream;
132 - output?: NodeJS.WritableStream;
133 - completer?: Completer | AsyncCompleter;
134 - terminal?: boolean;
135 - historySize?: number;
136 - prompt?: string;
137 - crlfDelay?: number;
138 - removeHistoryDuplicates?: boolean;
139 - escapeCodeTimeout?: number;
140 - tabSize?: number;
141 - }
142 -
143 - function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
144 - function createInterface(options: ReadLineOptions): Interface;
145 - function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
146 -
147 - type Direction = -1 | 0 | 1;
148 -
149 - interface CursorPos {
150 - rows: number;
151 - cols: number;
152 - }
153 -
154 - /**
155 - * Clears the current line of this WriteStream in a direction identified by `dir`.
156 - */
157 - function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
158 - /**
159 - * Clears this `WriteStream` from the current cursor down.
160 - */
161 - function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
162 - /**
163 - * Moves this WriteStream's cursor to the specified position.
164 - */
165 - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
166 - /**
167 - * Moves this WriteStream's cursor relative to its current position.
168 - */
169 - function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
170 -}
1 -declare module 'string_decoder' {
2 - class StringDecoder {
3 - constructor(encoding?: BufferEncoding);
4 - write(buffer: Buffer): string;
5 - end(buffer?: Buffer): string;
6 - }
7 -}
1 -declare module 'timers' {
2 - function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
3 - namespace setTimeout {
4 - function __promisify__(ms: number): Promise<void>;
5 - function __promisify__<T>(ms: number, value: T): Promise<T>;
6 - }
7 - function clearTimeout(timeoutId: NodeJS.Timeout): void;
8 - function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
9 - function clearInterval(intervalId: NodeJS.Timeout): void;
10 - function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
11 - namespace setImmediate {
12 - function __promisify__(): Promise<void>;
13 - function __promisify__<T>(value: T): Promise<T>;
14 - }
15 - function clearImmediate(immediateId: NodeJS.Immediate): void;
16 -}
1 -declare module 'trace_events' {
2 - /**
3 - * The `Tracing` object is used to enable or disable tracing for sets of
4 - * categories. Instances are created using the
5 - * `trace_events.createTracing()` method.
6 - *
7 - * When created, the `Tracing` object is disabled. Calling the
8 - * `tracing.enable()` method adds the categories to the set of enabled trace
9 - * event categories. Calling `tracing.disable()` will remove the categories
10 - * from the set of enabled trace event categories.
11 - */
12 - interface Tracing {
13 - /**
14 - * A comma-separated list of the trace event categories covered by this
15 - * `Tracing` object.
16 - */
17 - readonly categories: string;
18 -
19 - /**
20 - * Disables this `Tracing` object.
21 - *
22 - * Only trace event categories _not_ covered by other enabled `Tracing`
23 - * objects and _not_ specified by the `--trace-event-categories` flag
24 - * will be disabled.
25 - */
26 - disable(): void;
27 -
28 - /**
29 - * Enables this `Tracing` object for the set of categories covered by
30 - * the `Tracing` object.
31 - */
32 - enable(): void;
33 -
34 - /**
35 - * `true` only if the `Tracing` object has been enabled.
36 - */
37 - readonly enabled: boolean;
38 - }
39 -
40 - interface CreateTracingOptions {
41 - /**
42 - * An array of trace category names. Values included in the array are
43 - * coerced to a string when possible. An error will be thrown if the
44 - * value cannot be coerced.
45 - */
46 - categories: string[];
47 - }
48 -
49 - /**
50 - * Creates and returns a Tracing object for the given set of categories.
51 - */
52 - function createTracing(options: CreateTracingOptions): Tracing;
53 -
54 - /**
55 - * Returns a comma-separated list of all currently-enabled trace event
56 - * categories. The current set of enabled trace event categories is
57 - * determined by the union of all currently-enabled `Tracing` objects and
58 - * any categories enabled using the `--trace-event-categories` flag.
59 - */
60 - function getEnabledCategories(): string | undefined;
61 -}
1 -declare module 'assert' {
2 - /** An alias of `assert.ok()`. */
3 - function assert(value: any, message?: string | Error): void;
4 - namespace assert {
5 - class AssertionError extends Error {
6 - actual: any;
7 - expected: any;
8 - operator: string;
9 - generatedMessage: boolean;
10 - code: 'ERR_ASSERTION';
11 -
12 - constructor(options?: {
13 - /** If provided, the error message is set to this value. */
14 - message?: string;
15 - /** The `actual` property on the error instance. */
16 - actual?: any;
17 - /** The `expected` property on the error instance. */
18 - expected?: any;
19 - /** The `operator` property on the error instance. */
20 - operator?: string;
21 - /** If provided, the generated stack trace omits frames before this function. */
22 - // tslint:disable-next-line:ban-types
23 - stackStartFn?: Function;
24 - });
25 - }
26 -
27 - class CallTracker {
28 - calls(exact?: number): () => void;
29 - calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 - report(): CallTrackerReportInformation[];
31 - verify(): void;
32 - }
33 - interface CallTrackerReportInformation {
34 - message: string;
35 - /** The actual number of times the function was called. */
36 - actual: number;
37 - /** The number of times the function was expected to be called. */
38 - expected: number;
39 - /** The name of the function that is wrapped. */
40 - operator: string;
41 - /** A stack trace of the function. */
42 - stack: object;
43 - }
44 -
45 - type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 -
47 - function fail(message?: string | Error): never;
48 - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 - function fail(
50 - actual: any,
51 - expected: any,
52 - message?: string | Error,
53 - operator?: string,
54 - // tslint:disable-next-line:ban-types
55 - stackStartFn?: Function,
56 - ): never;
57 - function ok(value: any, message?: string | Error): void;
58 - /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 - function equal(actual: any, expected: any, message?: string | Error): void;
60 - /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 - function notEqual(actual: any, expected: any, message?: string | Error): void;
62 - /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 - function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 - /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 - function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 - function strictEqual(actual: any, expected: any, message?: string | Error): void;
67 - function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 - function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
69 - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 -
71 - function throws(block: () => any, message?: string | Error): void;
72 - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 - function doesNotThrow(block: () => any, message?: string | Error): void;
74 - function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 -
76 - function ifError(value: any): void;
77 -
78 - function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 - function rejects(
80 - block: (() => Promise<any>) | Promise<any>,
81 - error: AssertPredicate,
82 - message?: string | Error,
83 - ): Promise<void>;
84 - function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 - function doesNotReject(
86 - block: (() => Promise<any>) | Promise<any>,
87 - error: AssertPredicate,
88 - message?: string | Error,
89 - ): Promise<void>;
90 -
91 - function match(value: string, regExp: RegExp, message?: string | Error): void;
92 - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 -
94 - const strict: typeof assert;
95 - }
96 -
97 - export = assert;
98 -}
1 -// NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier.
2 -
3 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 -// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above
6 -// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
7 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
8 -
9 -// Reference required types from the default lib:
10 -/// <reference lib="es2018" />
11 -/// <reference lib="esnext.asynciterable" />
12 -/// <reference lib="esnext.intl" />
13 -/// <reference lib="esnext.bigint" />
14 -
15 -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 -/// <reference path="../globals.d.ts" />
17 -/// <reference path="../async_hooks.d.ts" />
18 -/// <reference path="../buffer.d.ts" />
19 -/// <reference path="../child_process.d.ts" />
20 -/// <reference path="../cluster.d.ts" />
21 -/// <reference path="../console.d.ts" />
22 -/// <reference path="../constants.d.ts" />
23 -/// <reference path="../crypto.d.ts" />
24 -/// <reference path="../dgram.d.ts" />
25 -/// <reference path="../dns.d.ts" />
26 -/// <reference path="../domain.d.ts" />
27 -/// <reference path="../events.d.ts" />
28 -/// <reference path="../fs.d.ts" />
29 -/// <reference path="../fs/promises.d.ts" />
30 -/// <reference path="../http.d.ts" />
31 -/// <reference path="../http2.d.ts" />
32 -/// <reference path="../https.d.ts" />
33 -/// <reference path="../inspector.d.ts" />
34 -/// <reference path="../module.d.ts" />
35 -/// <reference path="../net.d.ts" />
36 -/// <reference path="../os.d.ts" />
37 -/// <reference path="../path.d.ts" />
38 -/// <reference path="../perf_hooks.d.ts" />
39 -/// <reference path="../process.d.ts" />
40 -/// <reference path="../punycode.d.ts" />
41 -/// <reference path="../querystring.d.ts" />
42 -/// <reference path="../readline.d.ts" />
43 -/// <reference path="../repl.d.ts" />
44 -/// <reference path="../stream.d.ts" />
45 -/// <reference path="../string_decoder.d.ts" />
46 -/// <reference path="../timers.d.ts" />
47 -/// <reference path="../tls.d.ts" />
48 -/// <reference path="../trace_events.d.ts" />
49 -/// <reference path="../tty.d.ts" />
50 -/// <reference path="../url.d.ts" />
51 -/// <reference path="../util.d.ts" />
52 -/// <reference path="../v8.d.ts" />
53 -/// <reference path="../vm.d.ts" />
54 -/// <reference path="../worker_threads.d.ts" />
55 -/// <reference path="../zlib.d.ts" />
56 -
57 -// TypeScript 3.5-specific augmentations:
58 -/// <reference path="../globals.global.d.ts" />
59 -
60 -// TypeScript 3.5-specific augmentations:
61 -/// <reference path="../wasi.d.ts" />
1 -// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6.
2 -// This is required to enable typing assert in ts3.7 without causing errors
3 -// Typically type modifications should be made in base.d.ts instead of here
4 -
5 -/// <reference path="base.d.ts" />
6 -
7 -/// <reference path="assert.d.ts" />
1 -declare module 'tty' {
2 - import * as net from 'net';
3 -
4 - function isatty(fd: number): boolean;
5 - class ReadStream extends net.Socket {
6 - constructor(fd: number, options?: net.SocketConstructorOpts);
7 - isRaw: boolean;
8 - setRawMode(mode: boolean): this;
9 - isTTY: boolean;
10 - }
11 - /**
12 - * -1 - to the left from cursor
13 - * 0 - the entire line
14 - * 1 - to the right from cursor
15 - */
16 - type Direction = -1 | 0 | 1;
17 - class WriteStream extends net.Socket {
18 - constructor(fd: number);
19 - addListener(event: string, listener: (...args: any[]) => void): this;
20 - addListener(event: "resize", listener: () => void): this;
21 -
22 - emit(event: string | symbol, ...args: any[]): boolean;
23 - emit(event: "resize"): boolean;
24 -
25 - on(event: string, listener: (...args: any[]) => void): this;
26 - on(event: "resize", listener: () => void): this;
27 -
28 - once(event: string, listener: (...args: any[]) => void): this;
29 - once(event: "resize", listener: () => void): this;
30 -
31 - prependListener(event: string, listener: (...args: any[]) => void): this;
32 - prependListener(event: "resize", listener: () => void): this;
33 -
34 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
35 - prependOnceListener(event: "resize", listener: () => void): this;
36 -
37 - /**
38 - * Clears the current line of this WriteStream in a direction identified by `dir`.
39 - */
40 - clearLine(dir: Direction, callback?: () => void): boolean;
41 - /**
42 - * Clears this `WriteStream` from the current cursor down.
43 - */
44 - clearScreenDown(callback?: () => void): boolean;
45 - /**
46 - * Moves this WriteStream's cursor to the specified position.
47 - */
48 - cursorTo(x: number, y?: number, callback?: () => void): boolean;
49 - cursorTo(x: number, callback: () => void): boolean;
50 - /**
51 - * Moves this WriteStream's cursor relative to its current position.
52 - */
53 - moveCursor(dx: number, dy: number, callback?: () => void): boolean;
54 - /**
55 - * @default `process.env`
56 - */
57 - getColorDepth(env?: {}): number;
58 - hasColors(depth?: number): boolean;
59 - hasColors(env?: {}): boolean;
60 - hasColors(depth: number, env?: {}): boolean;
61 - getWindowSize(): [number, number];
62 - columns: number;
63 - rows: number;
64 - isTTY: boolean;
65 - }
66 -}
1 -declare module 'url' {
2 - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3 -
4 - // Input to `url.format`
5 - interface UrlObject {
6 - auth?: string | null;
7 - hash?: string | null;
8 - host?: string | null;
9 - hostname?: string | null;
10 - href?: string | null;
11 - pathname?: string | null;
12 - protocol?: string | null;
13 - search?: string | null;
14 - slashes?: boolean | null;
15 - port?: string | number | null;
16 - query?: string | null | ParsedUrlQueryInput;
17 - }
18 -
19 - // Output of `url.parse`
20 - interface Url {
21 - auth: string | null;
22 - hash: string | null;
23 - host: string | null;
24 - hostname: string | null;
25 - href: string;
26 - path: string | null;
27 - pathname: string | null;
28 - protocol: string | null;
29 - search: string | null;
30 - slashes: boolean | null;
31 - port: string | null;
32 - query: string | null | ParsedUrlQuery;
33 - }
34 -
35 - interface UrlWithParsedQuery extends Url {
36 - query: ParsedUrlQuery;
37 - }
38 -
39 - interface UrlWithStringQuery extends Url {
40 - query: string | null;
41 - }
42 -
43 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
44 - function parse(urlStr: string): UrlWithStringQuery;
45 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
46 - function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
47 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
48 - function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
49 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
50 - function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
51 -
52 - function format(URL: URL, options?: URLFormatOptions): string;
53 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
54 - function format(urlObject: UrlObject | string): string;
55 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
56 - function resolve(from: string, to: string): string;
57 -
58 - function domainToASCII(domain: string): string;
59 - function domainToUnicode(domain: string): string;
60 -
61 - /**
62 - * This function ensures the correct decodings of percent-encoded characters as
63 - * well as ensuring a cross-platform valid absolute path string.
64 - * @param url The file URL string or URL object to convert to a path.
65 - */
66 - function fileURLToPath(url: string | URL): string;
67 -
68 - /**
69 - * This function ensures that path is resolved absolutely, and that the URL
70 - * control characters are correctly encoded when converting into a File URL.
71 - * @param url The path to convert to a File URL.
72 - */
73 - function pathToFileURL(url: string): URL;
74 -
75 - interface URLFormatOptions {
76 - auth?: boolean;
77 - fragment?: boolean;
78 - search?: boolean;
79 - unicode?: boolean;
80 - }
81 -
82 - class URL {
83 - constructor(input: string, base?: string | URL);
84 - hash: string;
85 - host: string;
86 - hostname: string;
87 - href: string;
88 - readonly origin: string;
89 - password: string;
90 - pathname: string;
91 - port: string;
92 - protocol: string;
93 - search: string;
94 - readonly searchParams: URLSearchParams;
95 - username: string;
96 - toString(): string;
97 - toJSON(): string;
98 - }
99 -
100 - class URLSearchParams implements Iterable<[string, string]> {
101 - constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
102 - append(name: string, value: string): void;
103 - delete(name: string): void;
104 - entries(): IterableIterator<[string, string]>;
105 - forEach(callback: (value: string, name: string, searchParams: this) => void): void;
106 - get(name: string): string | null;
107 - getAll(name: string): string[];
108 - has(name: string): boolean;
109 - keys(): IterableIterator<string>;
110 - set(name: string, value: string): void;
111 - sort(): void;
112 - toString(): string;
113 - values(): IterableIterator<string>;
114 - [Symbol.iterator](): IterableIterator<[string, string]>;
115 - }
116 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.