plugin-data-source-mssql 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +6 -6
  3. package/dist/server/data-source/MssqlExternalDataSource.js +114 -30
  4. package/dist/server/data-source/MssqlIntrospector.js +109 -24
  5. package/package.json +1 -1
  6. package/dist/node_modules/tedious/245.index.js +0 -741
  7. package/dist/node_modules/tedious/LICENSE +0 -21
  8. package/dist/node_modules/tedious/appveyor.yml +0 -67
  9. package/dist/node_modules/tedious/benchmarks/bulk-load/iterable.js +0 -61
  10. package/dist/node_modules/tedious/benchmarks/common.js +0 -287
  11. package/dist/node_modules/tedious/benchmarks/connection/open.js +0 -26
  12. package/dist/node_modules/tedious/benchmarks/package-lock.json +0 -21173
  13. package/dist/node_modules/tedious/benchmarks/package.json +0 -11
  14. package/dist/node_modules/tedious/benchmarks/query/call-tvp.js +0 -105
  15. package/dist/node_modules/tedious/benchmarks/query/insert-varbinary.js +0 -46
  16. package/dist/node_modules/tedious/benchmarks/query/select-many-rows.js +0 -63
  17. package/dist/node_modules/tedious/benchmarks/query/select-nvarchar.js +0 -50
  18. package/dist/node_modules/tedious/benchmarks/query/select-varbinary.js +0 -50
  19. package/dist/node_modules/tedious/benchmarks/request/rpcrequest-payload-tvp.js +0 -45
  20. package/dist/node_modules/tedious/benchmarks/request/rpcrequest-payload-varbinary.js +0 -37
  21. package/dist/node_modules/tedious/benchmarks/token-parser/colmetadata-token.js +0 -27
  22. package/dist/node_modules/tedious/benchmarks/token-parser/done-token.js +0 -28
  23. package/dist/node_modules/tedious/benchmarks/token-parser/simple-tokens.js +0 -363
  24. package/dist/node_modules/tedious/lib/all-headers.d.ts +0 -2
  25. package/dist/node_modules/tedious/lib/all-headers.js +0 -24
  26. package/dist/node_modules/tedious/lib/always-encrypted/aead-aes-256-cbc-hmac-algorithm.js +0 -82
  27. package/dist/node_modules/tedious/lib/always-encrypted/aead-aes-256-cbc-hmac-encryption-key.js +0 -55
  28. package/dist/node_modules/tedious/lib/always-encrypted/cek-entry.d.ts +0 -11
  29. package/dist/node_modules/tedious/lib/always-encrypted/cek-entry.js +0 -42
  30. package/dist/node_modules/tedious/lib/always-encrypted/get-parameter-encryption-metadata.js +0 -90
  31. package/dist/node_modules/tedious/lib/always-encrypted/key-crypto.js +0 -94
  32. package/dist/node_modules/tedious/lib/always-encrypted/keystore-provider-azure-key-vault.d.ts +0 -21
  33. package/dist/node_modules/tedious/lib/always-encrypted/keystore-provider-azure-key-vault.js +0 -247
  34. package/dist/node_modules/tedious/lib/always-encrypted/symmetric-key-cache.js +0 -36
  35. package/dist/node_modules/tedious/lib/always-encrypted/symmetric-key.js +0 -25
  36. package/dist/node_modules/tedious/lib/always-encrypted/types.d.ts +0 -73
  37. package/dist/node_modules/tedious/lib/always-encrypted/types.js +0 -48
  38. package/dist/node_modules/tedious/lib/always-encrypted/utils.js +0 -23
  39. package/dist/node_modules/tedious/lib/bulk-load-payload.d.ts +0 -8
  40. package/dist/node_modules/tedious/lib/bulk-load-payload.js +0 -23
  41. package/dist/node_modules/tedious/lib/bulk-load.d.ts +0 -275
  42. package/dist/node_modules/tedious/lib/bulk-load.js +0 -516
  43. package/dist/node_modules/tedious/lib/collation.d.ts +0 -28
  44. package/dist/node_modules/tedious/lib/collation.js +0 -348
  45. package/dist/node_modules/tedious/lib/connection.d.ts +0 -1310
  46. package/dist/node_modules/tedious/lib/connection.js +0 -2730
  47. package/dist/node_modules/tedious/lib/connector.d.ts +0 -18
  48. package/dist/node_modules/tedious/lib/connector.js +0 -150
  49. package/dist/node_modules/tedious/lib/data-type.d.ts +0 -455
  50. package/dist/node_modules/tedious/lib/data-type.js +0 -428
  51. package/dist/node_modules/tedious/lib/data-types/bigint.d.ts +0 -3
  52. package/dist/node_modules/tedious/lib/data-types/bigint.js +0 -53
  53. package/dist/node_modules/tedious/lib/data-types/binary.d.ts +0 -5
  54. package/dist/node_modules/tedious/lib/data-types/binary.js +0 -67
  55. package/dist/node_modules/tedious/lib/data-types/bit.d.ts +0 -3
  56. package/dist/node_modules/tedious/lib/data-types/bit.js +0 -46
  57. package/dist/node_modules/tedious/lib/data-types/bitn.d.ts +0 -3
  58. package/dist/node_modules/tedious/lib/data-types/bitn.js +0 -29
  59. package/dist/node_modules/tedious/lib/data-types/char.d.ts +0 -5
  60. package/dist/node_modules/tedious/lib/data-types/char.js +0 -86
  61. package/dist/node_modules/tedious/lib/data-types/date.d.ts +0 -3
  62. package/dist/node_modules/tedious/lib/data-types/date.js +0 -72
  63. package/dist/node_modules/tedious/lib/data-types/datetime.d.ts +0 -3
  64. package/dist/node_modules/tedious/lib/data-types/datetime.js +0 -93
  65. package/dist/node_modules/tedious/lib/data-types/datetime2.d.ts +0 -5
  66. package/dist/node_modules/tedious/lib/data-types/datetime2.js +0 -118
  67. package/dist/node_modules/tedious/lib/data-types/datetimen.d.ts +0 -3
  68. package/dist/node_modules/tedious/lib/data-types/datetimen.js +0 -29
  69. package/dist/node_modules/tedious/lib/data-types/datetimeoffset.d.ts +0 -5
  70. package/dist/node_modules/tedious/lib/data-types/datetimeoffset.js +0 -111
  71. package/dist/node_modules/tedious/lib/data-types/decimal.d.ts +0 -6
  72. package/dist/node_modules/tedious/lib/data-types/decimal.js +0 -107
  73. package/dist/node_modules/tedious/lib/data-types/decimaln.d.ts +0 -3
  74. package/dist/node_modules/tedious/lib/data-types/decimaln.js +0 -29
  75. package/dist/node_modules/tedious/lib/data-types/float.d.ts +0 -3
  76. package/dist/node_modules/tedious/lib/data-types/float.js +0 -47
  77. package/dist/node_modules/tedious/lib/data-types/floatn.d.ts +0 -3
  78. package/dist/node_modules/tedious/lib/data-types/floatn.js +0 -29
  79. package/dist/node_modules/tedious/lib/data-types/image.d.ts +0 -3
  80. package/dist/node_modules/tedious/lib/data-types/image.js +0 -56
  81. package/dist/node_modules/tedious/lib/data-types/int.d.ts +0 -3
  82. package/dist/node_modules/tedious/lib/data-types/int.js +0 -53
  83. package/dist/node_modules/tedious/lib/data-types/intn.d.ts +0 -3
  84. package/dist/node_modules/tedious/lib/data-types/intn.js +0 -29
  85. package/dist/node_modules/tedious/lib/data-types/money.d.ts +0 -3
  86. package/dist/node_modules/tedious/lib/data-types/money.js +0 -59
  87. package/dist/node_modules/tedious/lib/data-types/moneyn.d.ts +0 -3
  88. package/dist/node_modules/tedious/lib/data-types/moneyn.js +0 -29
  89. package/dist/node_modules/tedious/lib/data-types/nchar.d.ts +0 -5
  90. package/dist/node_modules/tedious/lib/data-types/nchar.js +0 -100
  91. package/dist/node_modules/tedious/lib/data-types/ntext.d.ts +0 -3
  92. package/dist/node_modules/tedious/lib/data-types/ntext.js +0 -60
  93. package/dist/node_modules/tedious/lib/data-types/null.d.ts +0 -3
  94. package/dist/node_modules/tedious/lib/data-types/null.js +0 -29
  95. package/dist/node_modules/tedious/lib/data-types/numeric.d.ts +0 -6
  96. package/dist/node_modules/tedious/lib/data-types/numeric.js +0 -106
  97. package/dist/node_modules/tedious/lib/data-types/numericn.d.ts +0 -3
  98. package/dist/node_modules/tedious/lib/data-types/numericn.js +0 -29
  99. package/dist/node_modules/tedious/lib/data-types/nvarchar.d.ts +0 -5
  100. package/dist/node_modules/tedious/lib/data-types/nvarchar.js +0 -133
  101. package/dist/node_modules/tedious/lib/data-types/real.d.ts +0 -3
  102. package/dist/node_modules/tedious/lib/data-types/real.js +0 -48
  103. package/dist/node_modules/tedious/lib/data-types/smalldatetime.d.ts +0 -3
  104. package/dist/node_modules/tedious/lib/data-types/smalldatetime.js +0 -83
  105. package/dist/node_modules/tedious/lib/data-types/smallint.d.ts +0 -3
  106. package/dist/node_modules/tedious/lib/data-types/smallint.js +0 -53
  107. package/dist/node_modules/tedious/lib/data-types/smallmoney.d.ts +0 -3
  108. package/dist/node_modules/tedious/lib/data-types/smallmoney.js +0 -51
  109. package/dist/node_modules/tedious/lib/data-types/sql-variant.d.ts +0 -3
  110. package/dist/node_modules/tedious/lib/data-types/sql-variant.js +0 -29
  111. package/dist/node_modules/tedious/lib/data-types/text.d.ts +0 -3
  112. package/dist/node_modules/tedious/lib/data-types/text.js +0 -69
  113. package/dist/node_modules/tedious/lib/data-types/time.d.ts +0 -3
  114. package/dist/node_modules/tedious/lib/data-types/time.js +0 -96
  115. package/dist/node_modules/tedious/lib/data-types/tinyint.d.ts +0 -3
  116. package/dist/node_modules/tedious/lib/data-types/tinyint.js +0 -53
  117. package/dist/node_modules/tedious/lib/data-types/tvp.d.ts +0 -3
  118. package/dist/node_modules/tedious/lib/data-types/tvp.js +0 -117
  119. package/dist/node_modules/tedious/lib/data-types/udt.d.ts +0 -3
  120. package/dist/node_modules/tedious/lib/data-types/udt.js +0 -29
  121. package/dist/node_modules/tedious/lib/data-types/uniqueidentifier.d.ts +0 -3
  122. package/dist/node_modules/tedious/lib/data-types/uniqueidentifier.js +0 -50
  123. package/dist/node_modules/tedious/lib/data-types/varbinary.d.ts +0 -5
  124. package/dist/node_modules/tedious/lib/data-types/varbinary.js +0 -119
  125. package/dist/node_modules/tedious/lib/data-types/varchar.d.ts +0 -5
  126. package/dist/node_modules/tedious/lib/data-types/varchar.js +0 -112
  127. package/dist/node_modules/tedious/lib/data-types/xml.d.ts +0 -3
  128. package/dist/node_modules/tedious/lib/data-types/xml.js +0 -29
  129. package/dist/node_modules/tedious/lib/debug.d.ts +0 -25
  130. package/dist/node_modules/tedious/lib/debug.js +0 -67
  131. package/dist/node_modules/tedious/lib/errors/abort-error.d.ts +0 -4
  132. package/dist/node_modules/tedious/lib/errors/abort-error.js +0 -15
  133. package/dist/node_modules/tedious/lib/errors/timeout-error.d.ts +0 -4
  134. package/dist/node_modules/tedious/lib/errors/timeout-error.js +0 -15
  135. package/dist/node_modules/tedious/lib/errors.d.ts +0 -17
  136. package/dist/node_modules/tedious/lib/errors.js +0 -23
  137. package/dist/node_modules/tedious/lib/guid-parser.d.ts +0 -3
  138. package/dist/node_modules/tedious/lib/guid-parser.js +0 -30
  139. package/dist/node_modules/tedious/lib/incoming-message-stream.d.ts +0 -19
  140. package/dist/node_modules/tedious/lib/incoming-message-stream.js +0 -97
  141. package/dist/node_modules/tedious/lib/instance-lookup.d.ts +0 -13
  142. package/dist/node_modules/tedious/lib/instance-lookup.js +0 -96
  143. package/dist/node_modules/tedious/lib/library.d.ts +0 -1
  144. package/dist/node_modules/tedious/lib/library.js +0 -8
  145. package/dist/node_modules/tedious/lib/login7-payload.d.ts +0 -51
  146. package/dist/node_modules/tedious/lib/login7-payload.js +0 -402
  147. package/dist/node_modules/tedious/lib/message-io.d.ts +0 -28
  148. package/dist/node_modules/tedious/lib/message-io.js +0 -153
  149. package/dist/node_modules/tedious/lib/message.d.ts +0 -11
  150. package/dist/node_modules/tedious/lib/message.js +0 -21
  151. package/dist/node_modules/tedious/lib/metadata-parser.d.ts +0 -48
  152. package/dist/node_modules/tedious/lib/metadata-parser.js +0 -380
  153. package/dist/node_modules/tedious/lib/ntlm-payload.d.ts +0 -23
  154. package/dist/node_modules/tedious/lib/ntlm-payload.js +0 -136
  155. package/dist/node_modules/tedious/lib/ntlm.d.ts +0 -4
  156. package/dist/node_modules/tedious/lib/ntlm.js +0 -72
  157. package/dist/node_modules/tedious/lib/outgoing-message-stream.d.ts +0 -15
  158. package/dist/node_modules/tedious/lib/outgoing-message-stream.js +0 -81
  159. package/dist/node_modules/tedious/lib/packet.d.ts +0 -33
  160. package/dist/node_modules/tedious/lib/packet.js +0 -191
  161. package/dist/node_modules/tedious/lib/prelogin-payload.d.ts +0 -61
  162. package/dist/node_modules/tedious/lib/prelogin-payload.js +0 -209
  163. package/dist/node_modules/tedious/lib/request.d.ts +0 -370
  164. package/dist/node_modules/tedious/lib/request.js +0 -387
  165. package/dist/node_modules/tedious/lib/rpcrequest-payload.d.ts +0 -16
  166. package/dist/node_modules/tedious/lib/rpcrequest-payload.js +0 -109
  167. package/dist/node_modules/tedious/lib/sender.d.ts +0 -5
  168. package/dist/node_modules/tedious/lib/sender.js +0 -83
  169. package/dist/node_modules/tedious/lib/special-stored-procedure.d.ts +0 -18
  170. package/dist/node_modules/tedious/lib/special-stored-procedure.js +0 -26
  171. package/dist/node_modules/tedious/lib/sqlbatch-payload.d.ts +0 -13
  172. package/dist/node_modules/tedious/lib/sqlbatch-payload.js +0 -34
  173. package/dist/node_modules/tedious/lib/tds-versions.d.ts +0 -6
  174. package/dist/node_modules/tedious/lib/tds-versions.js +0 -19
  175. package/dist/node_modules/tedious/lib/tedious.d.ts +0 -13
  176. package/dist/node_modules/tedious/lib/tedious.js +0 -249
  177. package/dist/node_modules/tedious/lib/token/colmetadata-token-parser.d.ts +0 -12
  178. package/dist/node_modules/tedious/lib/token/colmetadata-token-parser.js +0 -124
  179. package/dist/node_modules/tedious/lib/token/done-token-parser.d.ts +0 -6
  180. package/dist/node_modules/tedious/lib/token/done-token-parser.js +0 -76
  181. package/dist/node_modules/tedious/lib/token/env-change-token-parser.d.ts +0 -5
  182. package/dist/node_modules/tedious/lib/token/env-change-token-parser.js +0 -190
  183. package/dist/node_modules/tedious/lib/token/feature-ext-ack-parser.d.ts +0 -5
  184. package/dist/node_modules/tedious/lib/token/feature-ext-ack-parser.js +0 -52
  185. package/dist/node_modules/tedious/lib/token/fedauth-info-parser.d.ts +0 -5
  186. package/dist/node_modules/tedious/lib/token/fedauth-info-parser.js +0 -62
  187. package/dist/node_modules/tedious/lib/token/handler.d.ts +0 -135
  188. package/dist/node_modules/tedious/lib/token/handler.js +0 -444
  189. package/dist/node_modules/tedious/lib/token/helpers.d.ts +0 -28
  190. package/dist/node_modules/tedious/lib/token/helpers.js +0 -205
  191. package/dist/node_modules/tedious/lib/token/infoerror-token-parser.d.ts +0 -5
  192. package/dist/node_modules/tedious/lib/token/infoerror-token-parser.js +0 -80
  193. package/dist/node_modules/tedious/lib/token/loginack-token-parser.d.ts +0 -5
  194. package/dist/node_modules/tedious/lib/token/loginack-token-parser.js +0 -75
  195. package/dist/node_modules/tedious/lib/token/nbcrow-token-parser.d.ts +0 -4
  196. package/dist/node_modules/tedious/lib/token/nbcrow-token-parser.js +0 -104
  197. package/dist/node_modules/tedious/lib/token/order-token-parser.d.ts +0 -5
  198. package/dist/node_modules/tedious/lib/token/order-token-parser.js +0 -34
  199. package/dist/node_modules/tedious/lib/token/returnstatus-token-parser.d.ts +0 -5
  200. package/dist/node_modules/tedious/lib/token/returnstatus-token-parser.js +0 -21
  201. package/dist/node_modules/tedious/lib/token/returnvalue-token-parser.d.ts +0 -4
  202. package/dist/node_modules/tedious/lib/token/returnvalue-token-parser.js +0 -94
  203. package/dist/node_modules/tedious/lib/token/row-token-parser.d.ts +0 -4
  204. package/dist/node_modules/tedious/lib/token/row-token-parser.js +0 -77
  205. package/dist/node_modules/tedious/lib/token/sspi-token-parser.d.ts +0 -5
  206. package/dist/node_modules/tedious/lib/token/sspi-token-parser.js +0 -42
  207. package/dist/node_modules/tedious/lib/token/stream-parser.d.ts +0 -34
  208. package/dist/node_modules/tedious/lib/token/stream-parser.js +0 -341
  209. package/dist/node_modules/tedious/lib/token/token-stream-parser.d.ts +0 -15
  210. package/dist/node_modules/tedious/lib/token/token-stream-parser.js +0 -36
  211. package/dist/node_modules/tedious/lib/token/token.d.ts +0 -312
  212. package/dist/node_modules/tedious/lib/token/token.js +0 -328
  213. package/dist/node_modules/tedious/lib/tracking-buffer/writable-tracking-buffer.d.ts +0 -47
  214. package/dist/node_modules/tedious/lib/tracking-buffer/writable-tracking-buffer.js +0 -249
  215. package/dist/node_modules/tedious/lib/transaction.d.ts +0 -39
  216. package/dist/node_modules/tedious/lib/transaction.js +0 -137
  217. package/dist/node_modules/tedious/lib/transient-error-lookup.d.ts +0 -3
  218. package/dist/node_modules/tedious/lib/transient-error-lookup.js +0 -19
  219. package/dist/node_modules/tedious/lib/utils/with-timeout.d.ts +0 -7
  220. package/dist/node_modules/tedious/lib/utils/with-timeout.js +0 -36
  221. package/dist/node_modules/tedious/lib/value-parser.d.ts +0 -7
  222. package/dist/node_modules/tedious/lib/value-parser.js +0 -813
  223. package/dist/node_modules/tedious/node_modules/@types/node/assert/strict.d.ts +0 -105
  224. package/dist/node_modules/tedious/node_modules/@types/node/assert.d.ts +0 -955
  225. package/dist/node_modules/tedious/node_modules/@types/node/async_hooks.d.ts +0 -623
  226. package/dist/node_modules/tedious/node_modules/@types/node/buffer.buffer.d.ts +0 -466
  227. package/dist/node_modules/tedious/node_modules/@types/node/buffer.d.ts +0 -1810
  228. package/dist/node_modules/tedious/node_modules/@types/node/child_process.d.ts +0 -1428
  229. package/dist/node_modules/tedious/node_modules/@types/node/cluster.d.ts +0 -486
  230. package/dist/node_modules/tedious/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  231. package/dist/node_modules/tedious/node_modules/@types/node/console.d.ts +0 -151
  232. package/dist/node_modules/tedious/node_modules/@types/node/constants.d.ts +0 -20
  233. package/dist/node_modules/tedious/node_modules/@types/node/crypto.d.ts +0 -4065
  234. package/dist/node_modules/tedious/node_modules/@types/node/dgram.d.ts +0 -564
  235. package/dist/node_modules/tedious/node_modules/@types/node/diagnostics_channel.d.ts +0 -576
  236. package/dist/node_modules/tedious/node_modules/@types/node/dns/promises.d.ts +0 -503
  237. package/dist/node_modules/tedious/node_modules/@types/node/dns.d.ts +0 -922
  238. package/dist/node_modules/tedious/node_modules/@types/node/domain.d.ts +0 -166
  239. package/dist/node_modules/tedious/node_modules/@types/node/events.d.ts +0 -1054
  240. package/dist/node_modules/tedious/node_modules/@types/node/fs/promises.d.ts +0 -1329
  241. package/dist/node_modules/tedious/node_modules/@types/node/fs.d.ts +0 -4676
  242. package/dist/node_modules/tedious/node_modules/@types/node/globals.d.ts +0 -150
  243. package/dist/node_modules/tedious/node_modules/@types/node/globals.typedarray.d.ts +0 -101
  244. package/dist/node_modules/tedious/node_modules/@types/node/http.d.ts +0 -2167
  245. package/dist/node_modules/tedious/node_modules/@types/node/http2.d.ts +0 -2480
  246. package/dist/node_modules/tedious/node_modules/@types/node/https.d.ts +0 -405
  247. package/dist/node_modules/tedious/node_modules/@types/node/index.d.ts +0 -115
  248. package/dist/node_modules/tedious/node_modules/@types/node/inspector/promises.d.ts +0 -41
  249. package/dist/node_modules/tedious/node_modules/@types/node/inspector.d.ts +0 -224
  250. package/dist/node_modules/tedious/node_modules/@types/node/inspector.generated.d.ts +0 -4226
  251. package/dist/node_modules/tedious/node_modules/@types/node/module.d.ts +0 -819
  252. package/dist/node_modules/tedious/node_modules/@types/node/net.d.ts +0 -933
  253. package/dist/node_modules/tedious/node_modules/@types/node/os.d.ts +0 -507
  254. package/dist/node_modules/tedious/node_modules/@types/node/package.json +0 -155
  255. package/dist/node_modules/tedious/node_modules/@types/node/path/posix.d.ts +0 -8
  256. package/dist/node_modules/tedious/node_modules/@types/node/path/win32.d.ts +0 -8
  257. package/dist/node_modules/tedious/node_modules/@types/node/path.d.ts +0 -187
  258. package/dist/node_modules/tedious/node_modules/@types/node/perf_hooks.d.ts +0 -643
  259. package/dist/node_modules/tedious/node_modules/@types/node/process.d.ts +0 -2161
  260. package/dist/node_modules/tedious/node_modules/@types/node/punycode.d.ts +0 -117
  261. package/dist/node_modules/tedious/node_modules/@types/node/querystring.d.ts +0 -152
  262. package/dist/node_modules/tedious/node_modules/@types/node/quic.d.ts +0 -910
  263. package/dist/node_modules/tedious/node_modules/@types/node/readline/promises.d.ts +0 -161
  264. package/dist/node_modules/tedious/node_modules/@types/node/readline.d.ts +0 -541
  265. package/dist/node_modules/tedious/node_modules/@types/node/repl.d.ts +0 -415
  266. package/dist/node_modules/tedious/node_modules/@types/node/sea.d.ts +0 -162
  267. package/dist/node_modules/tedious/node_modules/@types/node/sqlite.d.ts +0 -955
  268. package/dist/node_modules/tedious/node_modules/@types/node/stream/consumers.d.ts +0 -38
  269. package/dist/node_modules/tedious/node_modules/@types/node/stream/promises.d.ts +0 -211
  270. package/dist/node_modules/tedious/node_modules/@types/node/stream/web.d.ts +0 -296
  271. package/dist/node_modules/tedious/node_modules/@types/node/stream.d.ts +0 -1760
  272. package/dist/node_modules/tedious/node_modules/@types/node/string_decoder.d.ts +0 -67
  273. package/dist/node_modules/tedious/node_modules/@types/node/test/reporters.d.ts +0 -96
  274. package/dist/node_modules/tedious/node_modules/@types/node/test.d.ts +0 -2240
  275. package/dist/node_modules/tedious/node_modules/@types/node/timers/promises.d.ts +0 -108
  276. package/dist/node_modules/tedious/node_modules/@types/node/timers.d.ts +0 -159
  277. package/dist/node_modules/tedious/node_modules/@types/node/tls.d.ts +0 -1198
  278. package/dist/node_modules/tedious/node_modules/@types/node/trace_events.d.ts +0 -197
  279. package/dist/node_modules/tedious/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -462
  280. package/dist/node_modules/tedious/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  281. package/dist/node_modules/tedious/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -36
  282. package/dist/node_modules/tedious/node_modules/@types/node/ts5.6/index.d.ts +0 -117
  283. package/dist/node_modules/tedious/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  284. package/dist/node_modules/tedious/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  285. package/dist/node_modules/tedious/node_modules/@types/node/tty.d.ts +0 -250
  286. package/dist/node_modules/tedious/node_modules/@types/node/url.d.ts +0 -519
  287. package/dist/node_modules/tedious/node_modules/@types/node/util/types.d.ts +0 -558
  288. package/dist/node_modules/tedious/node_modules/@types/node/util.d.ts +0 -1662
  289. package/dist/node_modules/tedious/node_modules/@types/node/v8.d.ts +0 -983
  290. package/dist/node_modules/tedious/node_modules/@types/node/vm.d.ts +0 -1208
  291. package/dist/node_modules/tedious/node_modules/@types/node/wasi.d.ts +0 -202
  292. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -59
  293. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  294. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/console.d.ts +0 -9
  295. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  296. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  297. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  298. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/events.d.ts +0 -106
  299. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/fetch.d.ts +0 -69
  300. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  301. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  302. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/navigator.d.ts +0 -25
  303. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  304. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  305. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  306. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  307. package/dist/node_modules/tedious/node_modules/@types/node/web-globals/url.d.ts +0 -24
  308. package/dist/node_modules/tedious/node_modules/@types/node/worker_threads.d.ts +0 -717
  309. package/dist/node_modules/tedious/node_modules/@types/node/zlib.d.ts +0 -618
  310. package/dist/node_modules/tedious/node_modules/bl/.github/dependabot.yml +0 -16
  311. package/dist/node_modules/tedious/node_modules/bl/.github/workflows/test-and-release.yml +0 -61
  312. package/dist/node_modules/tedious/node_modules/bl/BufferList.d.ts +0 -431
  313. package/dist/node_modules/tedious/node_modules/bl/BufferList.js +0 -421
  314. package/dist/node_modules/tedious/node_modules/bl/bl.js +0 -84
  315. package/dist/node_modules/tedious/node_modules/bl/index.d.ts +0 -88
  316. package/dist/node_modules/tedious/node_modules/bl/package.json +0 -123
  317. package/dist/node_modules/tedious/node_modules/bl/test/convert.js +0 -21
  318. package/dist/node_modules/tedious/node_modules/bl/test/indexOf.js +0 -492
  319. package/dist/node_modules/tedious/node_modules/bl/test/isBufferList.js +0 -32
  320. package/dist/node_modules/tedious/node_modules/bl/test/test.js +0 -1032
  321. package/dist/node_modules/tedious/node_modules/buffer/index.d.ts +0 -194
  322. package/dist/node_modules/tedious/node_modules/buffer/index.js +0 -2106
  323. package/dist/node_modules/tedious/node_modules/buffer/package.json +0 -93
  324. package/dist/node_modules/tedious/node_modules/readable-stream/lib/_stream_duplex.js +0 -4
  325. package/dist/node_modules/tedious/node_modules/readable-stream/lib/_stream_passthrough.js +0 -4
  326. package/dist/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js +0 -4
  327. package/dist/node_modules/tedious/node_modules/readable-stream/lib/_stream_transform.js +0 -4
  328. package/dist/node_modules/tedious/node_modules/readable-stream/lib/_stream_writable.js +0 -4
  329. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +0 -52
  330. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -157
  331. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/compose.js +0 -194
  332. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -290
  333. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/duplex.js +0 -143
  334. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/duplexify.js +0 -378
  335. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -286
  336. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/from.js +0 -98
  337. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +0 -51
  338. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/legacy.js +0 -89
  339. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/operators.js +0 -457
  340. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/passthrough.js +0 -39
  341. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -471
  342. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/readable.js +0 -1290
  343. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/state.js +0 -39
  344. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/transform.js +0 -180
  345. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/utils.js +0 -327
  346. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/streams/writable.js +0 -819
  347. package/dist/node_modules/tedious/node_modules/readable-stream/lib/internal/validators.js +0 -530
  348. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/browser.js +0 -35
  349. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/errors.js +0 -343
  350. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/index.js +0 -65
  351. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/primordials.js +0 -124
  352. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/util/inspect.js +0 -55
  353. package/dist/node_modules/tedious/node_modules/readable-stream/lib/ours/util.js +0 -148
  354. package/dist/node_modules/tedious/node_modules/readable-stream/lib/stream/promises.js +0 -43
  355. package/dist/node_modules/tedious/node_modules/readable-stream/lib/stream.js +0 -143
  356. package/dist/node_modules/tedious/node_modules/readable-stream/package.json +0 -88
  357. package/dist/node_modules/tedious/node_modules/sprintf-js/dist/.gitattributes +0 -4
  358. package/dist/node_modules/tedious/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -3
  359. package/dist/node_modules/tedious/node_modules/sprintf-js/dist/sprintf.min.js +0 -3
  360. package/dist/node_modules/tedious/node_modules/sprintf-js/package.json +0 -35
  361. package/dist/node_modules/tedious/node_modules/sprintf-js/src/angular-sprintf.js +0 -24
  362. package/dist/node_modules/tedious/node_modules/sprintf-js/src/sprintf.js +0 -231
  363. package/dist/node_modules/tedious/node_modules/undici-types/agent.d.ts +0 -32
  364. package/dist/node_modules/tedious/node_modules/undici-types/api.d.ts +0 -43
  365. package/dist/node_modules/tedious/node_modules/undici-types/balanced-pool.d.ts +0 -29
  366. package/dist/node_modules/tedious/node_modules/undici-types/cache-interceptor.d.ts +0 -172
  367. package/dist/node_modules/tedious/node_modules/undici-types/cache.d.ts +0 -36
  368. package/dist/node_modules/tedious/node_modules/undici-types/client-stats.d.ts +0 -15
  369. package/dist/node_modules/tedious/node_modules/undici-types/client.d.ts +0 -108
  370. package/dist/node_modules/tedious/node_modules/undici-types/connector.d.ts +0 -34
  371. package/dist/node_modules/tedious/node_modules/undici-types/content-type.d.ts +0 -21
  372. package/dist/node_modules/tedious/node_modules/undici-types/cookies.d.ts +0 -30
  373. package/dist/node_modules/tedious/node_modules/undici-types/diagnostics-channel.d.ts +0 -74
  374. package/dist/node_modules/tedious/node_modules/undici-types/dispatcher.d.ts +0 -276
  375. package/dist/node_modules/tedious/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -22
  376. package/dist/node_modules/tedious/node_modules/undici-types/errors.d.ts +0 -161
  377. package/dist/node_modules/tedious/node_modules/undici-types/eventsource.d.ts +0 -66
  378. package/dist/node_modules/tedious/node_modules/undici-types/fetch.d.ts +0 -211
  379. package/dist/node_modules/tedious/node_modules/undici-types/formdata.d.ts +0 -108
  380. package/dist/node_modules/tedious/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  381. package/dist/node_modules/tedious/node_modules/undici-types/global-origin.d.ts +0 -7
  382. package/dist/node_modules/tedious/node_modules/undici-types/h2c-client.d.ts +0 -73
  383. package/dist/node_modules/tedious/node_modules/undici-types/handlers.d.ts +0 -15
  384. package/dist/node_modules/tedious/node_modules/undici-types/header.d.ts +0 -160
  385. package/dist/node_modules/tedious/node_modules/undici-types/index.d.ts +0 -80
  386. package/dist/node_modules/tedious/node_modules/undici-types/interceptors.d.ts +0 -39
  387. package/dist/node_modules/tedious/node_modules/undici-types/mock-agent.d.ts +0 -68
  388. package/dist/node_modules/tedious/node_modules/undici-types/mock-call-history.d.ts +0 -111
  389. package/dist/node_modules/tedious/node_modules/undici-types/mock-client.d.ts +0 -27
  390. package/dist/node_modules/tedious/node_modules/undici-types/mock-errors.d.ts +0 -12
  391. package/dist/node_modules/tedious/node_modules/undici-types/mock-interceptor.d.ts +0 -94
  392. package/dist/node_modules/tedious/node_modules/undici-types/mock-pool.d.ts +0 -27
  393. package/dist/node_modules/tedious/node_modules/undici-types/package.json +0 -55
  394. package/dist/node_modules/tedious/node_modules/undici-types/patch.d.ts +0 -29
  395. package/dist/node_modules/tedious/node_modules/undici-types/pool-stats.d.ts +0 -19
  396. package/dist/node_modules/tedious/node_modules/undici-types/pool.d.ts +0 -41
  397. package/dist/node_modules/tedious/node_modules/undici-types/proxy-agent.d.ts +0 -29
  398. package/dist/node_modules/tedious/node_modules/undici-types/readable.d.ts +0 -68
  399. package/dist/node_modules/tedious/node_modules/undici-types/retry-agent.d.ts +0 -8
  400. package/dist/node_modules/tedious/node_modules/undici-types/retry-handler.d.ts +0 -125
  401. package/dist/node_modules/tedious/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  402. package/dist/node_modules/tedious/node_modules/undici-types/util.d.ts +0 -18
  403. package/dist/node_modules/tedious/node_modules/undici-types/utility.d.ts +0 -7
  404. package/dist/node_modules/tedious/node_modules/undici-types/webidl.d.ts +0 -341
  405. package/dist/node_modules/tedious/node_modules/undici-types/websocket.d.ts +0 -186
  406. package/dist/node_modules/tedious/package.json +0 -1
  407. package/dist/node_modules/tedious/tsconfig.build-types.json +0 -15
  408. package/dist/node_modules/tedious/tsconfig.json +0 -29
  409. package/dist/node_modules/tedious/types/js-md4.d.ts +0 -7
  410. package/dist/node_modules/tedious/types/native-duplexpair.d.ts +0 -12
@@ -1,819 +0,0 @@
1
- // Copyright Joyent, Inc. and other Node contributors.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a
4
- // copy of this software and associated documentation files (the
5
- // "Software"), to deal in the Software without restriction, including
6
- // without limitation the rights to use, copy, modify, merge, publish,
7
- // distribute, sublicense, and/or sell copies of the Software, and to permit
8
- // persons to whom the Software is furnished to do so, subject to the
9
- // following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included
12
- // in all copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- // A bit simpler than readable streams.
23
- // Implement an async ._write(chunk, encoding, cb), and it'll handle all
24
- // the drain event emission and buffering.
25
-
26
- 'use strict'
27
-
28
- /* replacement start */
29
-
30
- const process = require('process/')
31
-
32
- /* replacement end */
33
-
34
- const {
35
- ArrayPrototypeSlice,
36
- Error,
37
- FunctionPrototypeSymbolHasInstance,
38
- ObjectDefineProperty,
39
- ObjectDefineProperties,
40
- ObjectSetPrototypeOf,
41
- StringPrototypeToLowerCase,
42
- Symbol,
43
- SymbolHasInstance
44
- } = require('../../ours/primordials')
45
- module.exports = Writable
46
- Writable.WritableState = WritableState
47
- const { EventEmitter: EE } = require('events')
48
- const Stream = require('./legacy').Stream
49
- const { Buffer } = require('buffer')
50
- const destroyImpl = require('./destroy')
51
- const { addAbortSignal } = require('./add-abort-signal')
52
- const { getHighWaterMark, getDefaultHighWaterMark } = require('./state')
53
- const {
54
- ERR_INVALID_ARG_TYPE,
55
- ERR_METHOD_NOT_IMPLEMENTED,
56
- ERR_MULTIPLE_CALLBACK,
57
- ERR_STREAM_CANNOT_PIPE,
58
- ERR_STREAM_DESTROYED,
59
- ERR_STREAM_ALREADY_FINISHED,
60
- ERR_STREAM_NULL_VALUES,
61
- ERR_STREAM_WRITE_AFTER_END,
62
- ERR_UNKNOWN_ENCODING
63
- } = require('../../ours/errors').codes
64
- const { errorOrDestroy } = destroyImpl
65
- ObjectSetPrototypeOf(Writable.prototype, Stream.prototype)
66
- ObjectSetPrototypeOf(Writable, Stream)
67
- function nop() {}
68
- const kOnFinished = Symbol('kOnFinished')
69
- function WritableState(options, stream, isDuplex) {
70
- // Duplex streams are both readable and writable, but share
71
- // the same options object.
72
- // However, some cases require setting options to different
73
- // values for the readable and the writable sides of the duplex stream,
74
- // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
75
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')
76
-
77
- // Object stream flag to indicate whether or not this stream
78
- // contains buffers or objects.
79
- this.objectMode = !!(options && options.objectMode)
80
- if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)
81
-
82
- // The point at which write() starts returning false
83
- // Note: 0 is a valid value, means that we always return false if
84
- // the entire buffer is not flushed immediately on write().
85
- this.highWaterMark = options
86
- ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)
87
- : getDefaultHighWaterMark(false)
88
-
89
- // if _final has been called.
90
- this.finalCalled = false
91
-
92
- // drain event flag.
93
- this.needDrain = false
94
- // At the start of calling end()
95
- this.ending = false
96
- // When end() has been called, and returned.
97
- this.ended = false
98
- // When 'finish' is emitted.
99
- this.finished = false
100
-
101
- // Has it been destroyed
102
- this.destroyed = false
103
-
104
- // Should we decode strings into buffers before passing to _write?
105
- // this is here so that some node-core streams can optimize string
106
- // handling at a lower level.
107
- const noDecode = !!(options && options.decodeStrings === false)
108
- this.decodeStrings = !noDecode
109
-
110
- // Crypto is kind of old and crusty. Historically, its default string
111
- // encoding is 'binary' so we have to make this configurable.
112
- // Everything else in the universe uses 'utf8', though.
113
- this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'
114
-
115
- // Not an actual buffer we keep track of, but a measurement
116
- // of how much we're waiting to get pushed to some underlying
117
- // socket or file.
118
- this.length = 0
119
-
120
- // A flag to see when we're in the middle of a write.
121
- this.writing = false
122
-
123
- // When true all writes will be buffered until .uncork() call.
124
- this.corked = 0
125
-
126
- // A flag to be able to tell if the onwrite cb is called immediately,
127
- // or on a later tick. We set this to true at first, because any
128
- // actions that shouldn't happen until "later" should generally also
129
- // not happen before the first write call.
130
- this.sync = true
131
-
132
- // A flag to know if we're processing previously buffered items, which
133
- // may call the _write() callback in the same tick, so that we don't
134
- // end up in an overlapped onwrite situation.
135
- this.bufferProcessing = false
136
-
137
- // The callback that's passed to _write(chunk, cb).
138
- this.onwrite = onwrite.bind(undefined, stream)
139
-
140
- // The callback that the user supplies to write(chunk, encoding, cb).
141
- this.writecb = null
142
-
143
- // The amount that is being written when _write is called.
144
- this.writelen = 0
145
-
146
- // Storage for data passed to the afterWrite() callback in case of
147
- // synchronous _write() completion.
148
- this.afterWriteTickInfo = null
149
- resetBuffer(this)
150
-
151
- // Number of pending user-supplied write callbacks
152
- // this must be 0 before 'finish' can be emitted.
153
- this.pendingcb = 0
154
-
155
- // Stream is still being constructed and cannot be
156
- // destroyed until construction finished or failed.
157
- // Async construction is opt in, therefore we start as
158
- // constructed.
159
- this.constructed = true
160
-
161
- // Emit prefinish if the only thing we're waiting for is _write cbs
162
- // This is relevant for synchronous Transform streams.
163
- this.prefinished = false
164
-
165
- // True if the error was already emitted and should not be thrown again.
166
- this.errorEmitted = false
167
-
168
- // Should close be emitted on destroy. Defaults to true.
169
- this.emitClose = !options || options.emitClose !== false
170
-
171
- // Should .destroy() be called after 'finish' (and potentially 'end').
172
- this.autoDestroy = !options || options.autoDestroy !== false
173
-
174
- // Indicates whether the stream has errored. When true all write() calls
175
- // should return false. This is needed since when autoDestroy
176
- // is disabled we need a way to tell whether the stream has failed.
177
- this.errored = null
178
-
179
- // Indicates whether the stream has finished destroying.
180
- this.closed = false
181
-
182
- // True if close has been emitted or would have been emitted
183
- // depending on emitClose.
184
- this.closeEmitted = false
185
- this[kOnFinished] = []
186
- }
187
- function resetBuffer(state) {
188
- state.buffered = []
189
- state.bufferedIndex = 0
190
- state.allBuffers = true
191
- state.allNoop = true
192
- }
193
- WritableState.prototype.getBuffer = function getBuffer() {
194
- return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)
195
- }
196
- ObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {
197
- __proto__: null,
198
- get() {
199
- return this.buffered.length - this.bufferedIndex
200
- }
201
- })
202
- function Writable(options) {
203
- // Writable ctor is applied to Duplexes, too.
204
- // `realHasInstance` is necessary because using plain `instanceof`
205
- // would return false, as no `_writableState` property is attached.
206
-
207
- // Trying to use the custom `instanceof` for Writable here will also break the
208
- // Node.js LazyTransform implementation, which has a non-trivial getter for
209
- // `_writableState` that would lead to infinite recursion.
210
-
211
- // Checking for a Stream.Duplex instance is faster here instead of inside
212
- // the WritableState constructor, at least with V8 6.5.
213
- const isDuplex = this instanceof require('./duplex')
214
- if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)
215
- this._writableState = new WritableState(options, this, isDuplex)
216
- if (options) {
217
- if (typeof options.write === 'function') this._write = options.write
218
- if (typeof options.writev === 'function') this._writev = options.writev
219
- if (typeof options.destroy === 'function') this._destroy = options.destroy
220
- if (typeof options.final === 'function') this._final = options.final
221
- if (typeof options.construct === 'function') this._construct = options.construct
222
- if (options.signal) addAbortSignal(options.signal, this)
223
- }
224
- Stream.call(this, options)
225
- destroyImpl.construct(this, () => {
226
- const state = this._writableState
227
- if (!state.writing) {
228
- clearBuffer(this, state)
229
- }
230
- finishMaybe(this, state)
231
- })
232
- }
233
- ObjectDefineProperty(Writable, SymbolHasInstance, {
234
- __proto__: null,
235
- value: function (object) {
236
- if (FunctionPrototypeSymbolHasInstance(this, object)) return true
237
- if (this !== Writable) return false
238
- return object && object._writableState instanceof WritableState
239
- }
240
- })
241
-
242
- // Otherwise people can pipe Writable streams, which is just wrong.
243
- Writable.prototype.pipe = function () {
244
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())
245
- }
246
- function _write(stream, chunk, encoding, cb) {
247
- const state = stream._writableState
248
- if (typeof encoding === 'function') {
249
- cb = encoding
250
- encoding = state.defaultEncoding
251
- } else {
252
- if (!encoding) encoding = state.defaultEncoding
253
- else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)
254
- if (typeof cb !== 'function') cb = nop
255
- }
256
- if (chunk === null) {
257
- throw new ERR_STREAM_NULL_VALUES()
258
- } else if (!state.objectMode) {
259
- if (typeof chunk === 'string') {
260
- if (state.decodeStrings !== false) {
261
- chunk = Buffer.from(chunk, encoding)
262
- encoding = 'buffer'
263
- }
264
- } else if (chunk instanceof Buffer) {
265
- encoding = 'buffer'
266
- } else if (Stream._isUint8Array(chunk)) {
267
- chunk = Stream._uint8ArrayToBuffer(chunk)
268
- encoding = 'buffer'
269
- } else {
270
- throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)
271
- }
272
- }
273
- let err
274
- if (state.ending) {
275
- err = new ERR_STREAM_WRITE_AFTER_END()
276
- } else if (state.destroyed) {
277
- err = new ERR_STREAM_DESTROYED('write')
278
- }
279
- if (err) {
280
- process.nextTick(cb, err)
281
- errorOrDestroy(stream, err, true)
282
- return err
283
- }
284
- state.pendingcb++
285
- return writeOrBuffer(stream, state, chunk, encoding, cb)
286
- }
287
- Writable.prototype.write = function (chunk, encoding, cb) {
288
- return _write(this, chunk, encoding, cb) === true
289
- }
290
- Writable.prototype.cork = function () {
291
- this._writableState.corked++
292
- }
293
- Writable.prototype.uncork = function () {
294
- const state = this._writableState
295
- if (state.corked) {
296
- state.corked--
297
- if (!state.writing) clearBuffer(this, state)
298
- }
299
- }
300
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
301
- // node::ParseEncoding() requires lower case.
302
- if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)
303
- if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)
304
- this._writableState.defaultEncoding = encoding
305
- return this
306
- }
307
-
308
- // If we're already writing something, then just put this
309
- // in the queue, and wait our turn. Otherwise, call _write
310
- // If we return false, then we need a drain event, so set that flag.
311
- function writeOrBuffer(stream, state, chunk, encoding, callback) {
312
- const len = state.objectMode ? 1 : chunk.length
313
- state.length += len
314
-
315
- // stream._write resets state.length
316
- const ret = state.length < state.highWaterMark
317
- // We must ensure that previous needDrain will not be reset to false.
318
- if (!ret) state.needDrain = true
319
- if (state.writing || state.corked || state.errored || !state.constructed) {
320
- state.buffered.push({
321
- chunk,
322
- encoding,
323
- callback
324
- })
325
- if (state.allBuffers && encoding !== 'buffer') {
326
- state.allBuffers = false
327
- }
328
- if (state.allNoop && callback !== nop) {
329
- state.allNoop = false
330
- }
331
- } else {
332
- state.writelen = len
333
- state.writecb = callback
334
- state.writing = true
335
- state.sync = true
336
- stream._write(chunk, encoding, state.onwrite)
337
- state.sync = false
338
- }
339
-
340
- // Return false if errored or destroyed in order to break
341
- // any synchronous while(stream.write(data)) loops.
342
- return ret && !state.errored && !state.destroyed
343
- }
344
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
345
- state.writelen = len
346
- state.writecb = cb
347
- state.writing = true
348
- state.sync = true
349
- if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))
350
- else if (writev) stream._writev(chunk, state.onwrite)
351
- else stream._write(chunk, encoding, state.onwrite)
352
- state.sync = false
353
- }
354
- function onwriteError(stream, state, er, cb) {
355
- --state.pendingcb
356
- cb(er)
357
- // Ensure callbacks are invoked even when autoDestroy is
358
- // not enabled. Passing `er` here doesn't make sense since
359
- // it's related to one specific write, not to the buffered
360
- // writes.
361
- errorBuffer(state)
362
- // This can emit error, but error must always follow cb.
363
- errorOrDestroy(stream, er)
364
- }
365
- function onwrite(stream, er) {
366
- const state = stream._writableState
367
- const sync = state.sync
368
- const cb = state.writecb
369
- if (typeof cb !== 'function') {
370
- errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())
371
- return
372
- }
373
- state.writing = false
374
- state.writecb = null
375
- state.length -= state.writelen
376
- state.writelen = 0
377
- if (er) {
378
- // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364
379
- er.stack // eslint-disable-line no-unused-expressions
380
-
381
- if (!state.errored) {
382
- state.errored = er
383
- }
384
-
385
- // In case of duplex streams we need to notify the readable side of the
386
- // error.
387
- if (stream._readableState && !stream._readableState.errored) {
388
- stream._readableState.errored = er
389
- }
390
- if (sync) {
391
- process.nextTick(onwriteError, stream, state, er, cb)
392
- } else {
393
- onwriteError(stream, state, er, cb)
394
- }
395
- } else {
396
- if (state.buffered.length > state.bufferedIndex) {
397
- clearBuffer(stream, state)
398
- }
399
- if (sync) {
400
- // It is a common case that the callback passed to .write() is always
401
- // the same. In that case, we do not schedule a new nextTick(), but
402
- // rather just increase a counter, to improve performance and avoid
403
- // memory allocations.
404
- if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {
405
- state.afterWriteTickInfo.count++
406
- } else {
407
- state.afterWriteTickInfo = {
408
- count: 1,
409
- cb,
410
- stream,
411
- state
412
- }
413
- process.nextTick(afterWriteTick, state.afterWriteTickInfo)
414
- }
415
- } else {
416
- afterWrite(stream, state, 1, cb)
417
- }
418
- }
419
- }
420
- function afterWriteTick({ stream, state, count, cb }) {
421
- state.afterWriteTickInfo = null
422
- return afterWrite(stream, state, count, cb)
423
- }
424
- function afterWrite(stream, state, count, cb) {
425
- const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain
426
- if (needDrain) {
427
- state.needDrain = false
428
- stream.emit('drain')
429
- }
430
- while (count-- > 0) {
431
- state.pendingcb--
432
- cb()
433
- }
434
- if (state.destroyed) {
435
- errorBuffer(state)
436
- }
437
- finishMaybe(stream, state)
438
- }
439
-
440
- // If there's something in the buffer waiting, then invoke callbacks.
441
- function errorBuffer(state) {
442
- if (state.writing) {
443
- return
444
- }
445
- for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {
446
- var _state$errored
447
- const { chunk, callback } = state.buffered[n]
448
- const len = state.objectMode ? 1 : chunk.length
449
- state.length -= len
450
- callback(
451
- (_state$errored = state.errored) !== null && _state$errored !== undefined
452
- ? _state$errored
453
- : new ERR_STREAM_DESTROYED('write')
454
- )
455
- }
456
- const onfinishCallbacks = state[kOnFinished].splice(0)
457
- for (let i = 0; i < onfinishCallbacks.length; i++) {
458
- var _state$errored2
459
- onfinishCallbacks[i](
460
- (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined
461
- ? _state$errored2
462
- : new ERR_STREAM_DESTROYED('end')
463
- )
464
- }
465
- resetBuffer(state)
466
- }
467
-
468
- // If there's something in the buffer waiting, then process it.
469
- function clearBuffer(stream, state) {
470
- if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {
471
- return
472
- }
473
- const { buffered, bufferedIndex, objectMode } = state
474
- const bufferedLength = buffered.length - bufferedIndex
475
- if (!bufferedLength) {
476
- return
477
- }
478
- let i = bufferedIndex
479
- state.bufferProcessing = true
480
- if (bufferedLength > 1 && stream._writev) {
481
- state.pendingcb -= bufferedLength - 1
482
- const callback = state.allNoop
483
- ? nop
484
- : (err) => {
485
- for (let n = i; n < buffered.length; ++n) {
486
- buffered[n].callback(err)
487
- }
488
- }
489
- // Make a copy of `buffered` if it's going to be used by `callback` above,
490
- // since `doWrite` will mutate the array.
491
- const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)
492
- chunks.allBuffers = state.allBuffers
493
- doWrite(stream, state, true, state.length, chunks, '', callback)
494
- resetBuffer(state)
495
- } else {
496
- do {
497
- const { chunk, encoding, callback } = buffered[i]
498
- buffered[i++] = null
499
- const len = objectMode ? 1 : chunk.length
500
- doWrite(stream, state, false, len, chunk, encoding, callback)
501
- } while (i < buffered.length && !state.writing)
502
- if (i === buffered.length) {
503
- resetBuffer(state)
504
- } else if (i > 256) {
505
- buffered.splice(0, i)
506
- state.bufferedIndex = 0
507
- } else {
508
- state.bufferedIndex = i
509
- }
510
- }
511
- state.bufferProcessing = false
512
- }
513
- Writable.prototype._write = function (chunk, encoding, cb) {
514
- if (this._writev) {
515
- this._writev(
516
- [
517
- {
518
- chunk,
519
- encoding
520
- }
521
- ],
522
- cb
523
- )
524
- } else {
525
- throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')
526
- }
527
- }
528
- Writable.prototype._writev = null
529
- Writable.prototype.end = function (chunk, encoding, cb) {
530
- const state = this._writableState
531
- if (typeof chunk === 'function') {
532
- cb = chunk
533
- chunk = null
534
- encoding = null
535
- } else if (typeof encoding === 'function') {
536
- cb = encoding
537
- encoding = null
538
- }
539
- let err
540
- if (chunk !== null && chunk !== undefined) {
541
- const ret = _write(this, chunk, encoding)
542
- if (ret instanceof Error) {
543
- err = ret
544
- }
545
- }
546
-
547
- // .end() fully uncorks.
548
- if (state.corked) {
549
- state.corked = 1
550
- this.uncork()
551
- }
552
- if (err) {
553
- // Do nothing...
554
- } else if (!state.errored && !state.ending) {
555
- // This is forgiving in terms of unnecessary calls to end() and can hide
556
- // logic errors. However, usually such errors are harmless and causing a
557
- // hard error can be disproportionately destructive. It is not always
558
- // trivial for the user to determine whether end() needs to be called
559
- // or not.
560
-
561
- state.ending = true
562
- finishMaybe(this, state, true)
563
- state.ended = true
564
- } else if (state.finished) {
565
- err = new ERR_STREAM_ALREADY_FINISHED('end')
566
- } else if (state.destroyed) {
567
- err = new ERR_STREAM_DESTROYED('end')
568
- }
569
- if (typeof cb === 'function') {
570
- if (err || state.finished) {
571
- process.nextTick(cb, err)
572
- } else {
573
- state[kOnFinished].push(cb)
574
- }
575
- }
576
- return this
577
- }
578
- function needFinish(state) {
579
- return (
580
- state.ending &&
581
- !state.destroyed &&
582
- state.constructed &&
583
- state.length === 0 &&
584
- !state.errored &&
585
- state.buffered.length === 0 &&
586
- !state.finished &&
587
- !state.writing &&
588
- !state.errorEmitted &&
589
- !state.closeEmitted
590
- )
591
- }
592
- function callFinal(stream, state) {
593
- let called = false
594
- function onFinish(err) {
595
- if (called) {
596
- errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())
597
- return
598
- }
599
- called = true
600
- state.pendingcb--
601
- if (err) {
602
- const onfinishCallbacks = state[kOnFinished].splice(0)
603
- for (let i = 0; i < onfinishCallbacks.length; i++) {
604
- onfinishCallbacks[i](err)
605
- }
606
- errorOrDestroy(stream, err, state.sync)
607
- } else if (needFinish(state)) {
608
- state.prefinished = true
609
- stream.emit('prefinish')
610
- // Backwards compat. Don't check state.sync here.
611
- // Some streams assume 'finish' will be emitted
612
- // asynchronously relative to _final callback.
613
- state.pendingcb++
614
- process.nextTick(finish, stream, state)
615
- }
616
- }
617
- state.sync = true
618
- state.pendingcb++
619
- try {
620
- stream._final(onFinish)
621
- } catch (err) {
622
- onFinish(err)
623
- }
624
- state.sync = false
625
- }
626
- function prefinish(stream, state) {
627
- if (!state.prefinished && !state.finalCalled) {
628
- if (typeof stream._final === 'function' && !state.destroyed) {
629
- state.finalCalled = true
630
- callFinal(stream, state)
631
- } else {
632
- state.prefinished = true
633
- stream.emit('prefinish')
634
- }
635
- }
636
- }
637
- function finishMaybe(stream, state, sync) {
638
- if (needFinish(state)) {
639
- prefinish(stream, state)
640
- if (state.pendingcb === 0) {
641
- if (sync) {
642
- state.pendingcb++
643
- process.nextTick(
644
- (stream, state) => {
645
- if (needFinish(state)) {
646
- finish(stream, state)
647
- } else {
648
- state.pendingcb--
649
- }
650
- },
651
- stream,
652
- state
653
- )
654
- } else if (needFinish(state)) {
655
- state.pendingcb++
656
- finish(stream, state)
657
- }
658
- }
659
- }
660
- }
661
- function finish(stream, state) {
662
- state.pendingcb--
663
- state.finished = true
664
- const onfinishCallbacks = state[kOnFinished].splice(0)
665
- for (let i = 0; i < onfinishCallbacks.length; i++) {
666
- onfinishCallbacks[i]()
667
- }
668
- stream.emit('finish')
669
- if (state.autoDestroy) {
670
- // In case of duplex streams we need a way to detect
671
- // if the readable side is ready for autoDestroy as well.
672
- const rState = stream._readableState
673
- const autoDestroy =
674
- !rState ||
675
- (rState.autoDestroy &&
676
- // We don't expect the readable to ever 'end'
677
- // if readable is explicitly set to false.
678
- (rState.endEmitted || rState.readable === false))
679
- if (autoDestroy) {
680
- stream.destroy()
681
- }
682
- }
683
- }
684
- ObjectDefineProperties(Writable.prototype, {
685
- closed: {
686
- __proto__: null,
687
- get() {
688
- return this._writableState ? this._writableState.closed : false
689
- }
690
- },
691
- destroyed: {
692
- __proto__: null,
693
- get() {
694
- return this._writableState ? this._writableState.destroyed : false
695
- },
696
- set(value) {
697
- // Backward compatibility, the user is explicitly managing destroyed.
698
- if (this._writableState) {
699
- this._writableState.destroyed = value
700
- }
701
- }
702
- },
703
- writable: {
704
- __proto__: null,
705
- get() {
706
- const w = this._writableState
707
- // w.writable === false means that this is part of a Duplex stream
708
- // where the writable side was disabled upon construction.
709
- // Compat. The user might manually disable writable side through
710
- // deprecated setter.
711
- return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended
712
- },
713
- set(val) {
714
- // Backwards compatible.
715
- if (this._writableState) {
716
- this._writableState.writable = !!val
717
- }
718
- }
719
- },
720
- writableFinished: {
721
- __proto__: null,
722
- get() {
723
- return this._writableState ? this._writableState.finished : false
724
- }
725
- },
726
- writableObjectMode: {
727
- __proto__: null,
728
- get() {
729
- return this._writableState ? this._writableState.objectMode : false
730
- }
731
- },
732
- writableBuffer: {
733
- __proto__: null,
734
- get() {
735
- return this._writableState && this._writableState.getBuffer()
736
- }
737
- },
738
- writableEnded: {
739
- __proto__: null,
740
- get() {
741
- return this._writableState ? this._writableState.ending : false
742
- }
743
- },
744
- writableNeedDrain: {
745
- __proto__: null,
746
- get() {
747
- const wState = this._writableState
748
- if (!wState) return false
749
- return !wState.destroyed && !wState.ending && wState.needDrain
750
- }
751
- },
752
- writableHighWaterMark: {
753
- __proto__: null,
754
- get() {
755
- return this._writableState && this._writableState.highWaterMark
756
- }
757
- },
758
- writableCorked: {
759
- __proto__: null,
760
- get() {
761
- return this._writableState ? this._writableState.corked : 0
762
- }
763
- },
764
- writableLength: {
765
- __proto__: null,
766
- get() {
767
- return this._writableState && this._writableState.length
768
- }
769
- },
770
- errored: {
771
- __proto__: null,
772
- enumerable: false,
773
- get() {
774
- return this._writableState ? this._writableState.errored : null
775
- }
776
- },
777
- writableAborted: {
778
- __proto__: null,
779
- enumerable: false,
780
- get: function () {
781
- return !!(
782
- this._writableState.writable !== false &&
783
- (this._writableState.destroyed || this._writableState.errored) &&
784
- !this._writableState.finished
785
- )
786
- }
787
- }
788
- })
789
- const destroy = destroyImpl.destroy
790
- Writable.prototype.destroy = function (err, cb) {
791
- const state = this._writableState
792
-
793
- // Invoke pending callbacks.
794
- if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {
795
- process.nextTick(errorBuffer, state)
796
- }
797
- destroy.call(this, err, cb)
798
- return this
799
- }
800
- Writable.prototype._undestroy = destroyImpl.undestroy
801
- Writable.prototype._destroy = function (err, cb) {
802
- cb(err)
803
- }
804
- Writable.prototype[EE.captureRejectionSymbol] = function (err) {
805
- this.destroy(err)
806
- }
807
- let webStreamsAdapters
808
-
809
- // Lazy to avoid circular references
810
- function lazyWebStreams() {
811
- if (webStreamsAdapters === undefined) webStreamsAdapters = {}
812
- return webStreamsAdapters
813
- }
814
- Writable.fromWeb = function (writableStream, options) {
815
- return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)
816
- }
817
- Writable.toWeb = function (streamWritable) {
818
- return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)
819
- }