tedious-fabric 1.0.0

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 (304) hide show
  1. package/CLAUDE.md +91 -0
  2. package/LICENSE +21 -0
  3. package/README.md +67 -0
  4. package/appveyor.yml +67 -0
  5. package/eslint.config.mjs +314 -0
  6. package/lib/all-headers.d.ts +2 -0
  7. package/lib/all-headers.js +24 -0
  8. package/lib/all-headers.js.map +1 -0
  9. package/lib/always-encrypted/aead-aes-256-cbc-hmac-algorithm.js +82 -0
  10. package/lib/always-encrypted/aead-aes-256-cbc-hmac-algorithm.js.map +1 -0
  11. package/lib/always-encrypted/aead-aes-256-cbc-hmac-encryption-key.js +55 -0
  12. package/lib/always-encrypted/aead-aes-256-cbc-hmac-encryption-key.js.map +1 -0
  13. package/lib/always-encrypted/cek-entry.d.ts +11 -0
  14. package/lib/always-encrypted/cek-entry.js +42 -0
  15. package/lib/always-encrypted/cek-entry.js.map +1 -0
  16. package/lib/always-encrypted/get-parameter-encryption-metadata.js +90 -0
  17. package/lib/always-encrypted/get-parameter-encryption-metadata.js.map +1 -0
  18. package/lib/always-encrypted/key-crypto.js +94 -0
  19. package/lib/always-encrypted/key-crypto.js.map +1 -0
  20. package/lib/always-encrypted/keystore-provider-azure-key-vault.d.ts +21 -0
  21. package/lib/always-encrypted/keystore-provider-azure-key-vault.js +247 -0
  22. package/lib/always-encrypted/keystore-provider-azure-key-vault.js.map +1 -0
  23. package/lib/always-encrypted/symmetric-key-cache.js +36 -0
  24. package/lib/always-encrypted/symmetric-key-cache.js.map +1 -0
  25. package/lib/always-encrypted/symmetric-key.js +25 -0
  26. package/lib/always-encrypted/symmetric-key.js.map +1 -0
  27. package/lib/always-encrypted/types.d.ts +73 -0
  28. package/lib/always-encrypted/types.js +61 -0
  29. package/lib/always-encrypted/types.js.map +1 -0
  30. package/lib/always-encrypted/utils.js +23 -0
  31. package/lib/always-encrypted/utils.js.map +1 -0
  32. package/lib/bulk-load-payload.d.ts +8 -0
  33. package/lib/bulk-load-payload.js +23 -0
  34. package/lib/bulk-load-payload.js.map +1 -0
  35. package/lib/bulk-load.d.ts +275 -0
  36. package/lib/bulk-load.js +515 -0
  37. package/lib/bulk-load.js.map +1 -0
  38. package/lib/collation.d.ts +28 -0
  39. package/lib/collation.js +348 -0
  40. package/lib/collation.js.map +1 -0
  41. package/lib/connection.d.ts +1309 -0
  42. package/lib/connection.js +2732 -0
  43. package/lib/connection.js.map +1 -0
  44. package/lib/connector.d.ts +18 -0
  45. package/lib/connector.js +142 -0
  46. package/lib/connector.js.map +1 -0
  47. package/lib/data-type.d.ts +554 -0
  48. package/lib/data-type.js +428 -0
  49. package/lib/data-type.js.map +1 -0
  50. package/lib/data-types/bigint.d.ts +3 -0
  51. package/lib/data-types/bigint.js +53 -0
  52. package/lib/data-types/bigint.js.map +1 -0
  53. package/lib/data-types/binary.d.ts +5 -0
  54. package/lib/data-types/binary.js +67 -0
  55. package/lib/data-types/binary.js.map +1 -0
  56. package/lib/data-types/bit.d.ts +3 -0
  57. package/lib/data-types/bit.js +46 -0
  58. package/lib/data-types/bit.js.map +1 -0
  59. package/lib/data-types/bitn.d.ts +3 -0
  60. package/lib/data-types/bitn.js +29 -0
  61. package/lib/data-types/bitn.js.map +1 -0
  62. package/lib/data-types/char.d.ts +5 -0
  63. package/lib/data-types/char.js +86 -0
  64. package/lib/data-types/char.js.map +1 -0
  65. package/lib/data-types/date.d.ts +3 -0
  66. package/lib/data-types/date.js +72 -0
  67. package/lib/data-types/date.js.map +1 -0
  68. package/lib/data-types/datetime.d.ts +3 -0
  69. package/lib/data-types/datetime.js +93 -0
  70. package/lib/data-types/datetime.js.map +1 -0
  71. package/lib/data-types/datetime2.d.ts +5 -0
  72. package/lib/data-types/datetime2.js +118 -0
  73. package/lib/data-types/datetime2.js.map +1 -0
  74. package/lib/data-types/datetimen.d.ts +3 -0
  75. package/lib/data-types/datetimen.js +29 -0
  76. package/lib/data-types/datetimen.js.map +1 -0
  77. package/lib/data-types/datetimeoffset.d.ts +5 -0
  78. package/lib/data-types/datetimeoffset.js +111 -0
  79. package/lib/data-types/datetimeoffset.js.map +1 -0
  80. package/lib/data-types/decimal.d.ts +6 -0
  81. package/lib/data-types/decimal.js +107 -0
  82. package/lib/data-types/decimal.js.map +1 -0
  83. package/lib/data-types/decimaln.d.ts +3 -0
  84. package/lib/data-types/decimaln.js +29 -0
  85. package/lib/data-types/decimaln.js.map +1 -0
  86. package/lib/data-types/float.d.ts +3 -0
  87. package/lib/data-types/float.js +47 -0
  88. package/lib/data-types/float.js.map +1 -0
  89. package/lib/data-types/floatn.d.ts +3 -0
  90. package/lib/data-types/floatn.js +29 -0
  91. package/lib/data-types/floatn.js.map +1 -0
  92. package/lib/data-types/image.d.ts +3 -0
  93. package/lib/data-types/image.js +56 -0
  94. package/lib/data-types/image.js.map +1 -0
  95. package/lib/data-types/int.d.ts +3 -0
  96. package/lib/data-types/int.js +53 -0
  97. package/lib/data-types/int.js.map +1 -0
  98. package/lib/data-types/intn.d.ts +3 -0
  99. package/lib/data-types/intn.js +29 -0
  100. package/lib/data-types/intn.js.map +1 -0
  101. package/lib/data-types/money.d.ts +3 -0
  102. package/lib/data-types/money.js +59 -0
  103. package/lib/data-types/money.js.map +1 -0
  104. package/lib/data-types/moneyn.d.ts +3 -0
  105. package/lib/data-types/moneyn.js +29 -0
  106. package/lib/data-types/moneyn.js.map +1 -0
  107. package/lib/data-types/nchar.d.ts +5 -0
  108. package/lib/data-types/nchar.js +100 -0
  109. package/lib/data-types/nchar.js.map +1 -0
  110. package/lib/data-types/ntext.d.ts +3 -0
  111. package/lib/data-types/ntext.js +60 -0
  112. package/lib/data-types/ntext.js.map +1 -0
  113. package/lib/data-types/null.d.ts +3 -0
  114. package/lib/data-types/null.js +29 -0
  115. package/lib/data-types/null.js.map +1 -0
  116. package/lib/data-types/numeric.d.ts +6 -0
  117. package/lib/data-types/numeric.js +106 -0
  118. package/lib/data-types/numeric.js.map +1 -0
  119. package/lib/data-types/numericn.d.ts +3 -0
  120. package/lib/data-types/numericn.js +29 -0
  121. package/lib/data-types/numericn.js.map +1 -0
  122. package/lib/data-types/nvarchar.d.ts +5 -0
  123. package/lib/data-types/nvarchar.js +133 -0
  124. package/lib/data-types/nvarchar.js.map +1 -0
  125. package/lib/data-types/real.d.ts +3 -0
  126. package/lib/data-types/real.js +48 -0
  127. package/lib/data-types/real.js.map +1 -0
  128. package/lib/data-types/smalldatetime.d.ts +3 -0
  129. package/lib/data-types/smalldatetime.js +83 -0
  130. package/lib/data-types/smalldatetime.js.map +1 -0
  131. package/lib/data-types/smallint.d.ts +3 -0
  132. package/lib/data-types/smallint.js +53 -0
  133. package/lib/data-types/smallint.js.map +1 -0
  134. package/lib/data-types/smallmoney.d.ts +3 -0
  135. package/lib/data-types/smallmoney.js +51 -0
  136. package/lib/data-types/smallmoney.js.map +1 -0
  137. package/lib/data-types/sql-variant.d.ts +3 -0
  138. package/lib/data-types/sql-variant.js +29 -0
  139. package/lib/data-types/sql-variant.js.map +1 -0
  140. package/lib/data-types/text.d.ts +3 -0
  141. package/lib/data-types/text.js +69 -0
  142. package/lib/data-types/text.js.map +1 -0
  143. package/lib/data-types/time.d.ts +3 -0
  144. package/lib/data-types/time.js +96 -0
  145. package/lib/data-types/time.js.map +1 -0
  146. package/lib/data-types/tinyint.d.ts +3 -0
  147. package/lib/data-types/tinyint.js +53 -0
  148. package/lib/data-types/tinyint.js.map +1 -0
  149. package/lib/data-types/tvp.d.ts +3 -0
  150. package/lib/data-types/tvp.js +117 -0
  151. package/lib/data-types/tvp.js.map +1 -0
  152. package/lib/data-types/udt.d.ts +3 -0
  153. package/lib/data-types/udt.js +29 -0
  154. package/lib/data-types/udt.js.map +1 -0
  155. package/lib/data-types/uniqueidentifier.d.ts +3 -0
  156. package/lib/data-types/uniqueidentifier.js +50 -0
  157. package/lib/data-types/uniqueidentifier.js.map +1 -0
  158. package/lib/data-types/varbinary.d.ts +5 -0
  159. package/lib/data-types/varbinary.js +119 -0
  160. package/lib/data-types/varbinary.js.map +1 -0
  161. package/lib/data-types/varchar.d.ts +5 -0
  162. package/lib/data-types/varchar.js +112 -0
  163. package/lib/data-types/varchar.js.map +1 -0
  164. package/lib/data-types/xml.d.ts +3 -0
  165. package/lib/data-types/xml.js +29 -0
  166. package/lib/data-types/xml.js.map +1 -0
  167. package/lib/debug.d.ts +25 -0
  168. package/lib/debug.js +66 -0
  169. package/lib/debug.js.map +1 -0
  170. package/lib/errors.d.ts +17 -0
  171. package/lib/errors.js +23 -0
  172. package/lib/errors.js.map +1 -0
  173. package/lib/guid-parser.d.ts +3 -0
  174. package/lib/guid-parser.js +30 -0
  175. package/lib/guid-parser.js.map +1 -0
  176. package/lib/incoming-message-stream.d.ts +19 -0
  177. package/lib/incoming-message-stream.js +97 -0
  178. package/lib/incoming-message-stream.js.map +1 -0
  179. package/lib/instance-lookup.d.ts +13 -0
  180. package/lib/instance-lookup.js +91 -0
  181. package/lib/instance-lookup.js.map +1 -0
  182. package/lib/library.d.ts +1 -0
  183. package/lib/library.js +8 -0
  184. package/lib/library.js.map +1 -0
  185. package/lib/login7-payload.d.ts +51 -0
  186. package/lib/login7-payload.js +408 -0
  187. package/lib/login7-payload.js.map +1 -0
  188. package/lib/message-io.d.ts +28 -0
  189. package/lib/message-io.js +152 -0
  190. package/lib/message-io.js.map +1 -0
  191. package/lib/message.d.ts +11 -0
  192. package/lib/message.js +21 -0
  193. package/lib/message.js.map +1 -0
  194. package/lib/metadata-parser.d.ts +48 -0
  195. package/lib/metadata-parser.js +380 -0
  196. package/lib/metadata-parser.js.map +1 -0
  197. package/lib/ntlm-payload.d.ts +23 -0
  198. package/lib/ntlm-payload.js +135 -0
  199. package/lib/ntlm-payload.js.map +1 -0
  200. package/lib/ntlm.d.ts +4 -0
  201. package/lib/ntlm.js +72 -0
  202. package/lib/ntlm.js.map +1 -0
  203. package/lib/outgoing-message-stream.d.ts +15 -0
  204. package/lib/outgoing-message-stream.js +81 -0
  205. package/lib/outgoing-message-stream.js.map +1 -0
  206. package/lib/packet.d.ts +33 -0
  207. package/lib/packet.js +191 -0
  208. package/lib/packet.js.map +1 -0
  209. package/lib/prelogin-payload.d.ts +67 -0
  210. package/lib/prelogin-payload.js +228 -0
  211. package/lib/prelogin-payload.js.map +1 -0
  212. package/lib/request.d.ts +370 -0
  213. package/lib/request.js +387 -0
  214. package/lib/request.js.map +1 -0
  215. package/lib/rpcrequest-payload.d.ts +16 -0
  216. package/lib/rpcrequest-payload.js +109 -0
  217. package/lib/rpcrequest-payload.js.map +1 -0
  218. package/lib/sender.d.ts +5 -0
  219. package/lib/sender.js +78 -0
  220. package/lib/sender.js.map +1 -0
  221. package/lib/special-stored-procedure.d.ts +18 -0
  222. package/lib/special-stored-procedure.js +26 -0
  223. package/lib/special-stored-procedure.js.map +1 -0
  224. package/lib/sqlbatch-payload.d.ts +13 -0
  225. package/lib/sqlbatch-payload.js +34 -0
  226. package/lib/sqlbatch-payload.js.map +1 -0
  227. package/lib/tds-versions.d.ts +6 -0
  228. package/lib/tds-versions.js +19 -0
  229. package/lib/tds-versions.js.map +1 -0
  230. package/lib/tedious.d.ts +13 -0
  231. package/lib/tedious.js +73 -0
  232. package/lib/tedious.js.map +1 -0
  233. package/lib/token/colmetadata-token-parser.d.ts +12 -0
  234. package/lib/token/colmetadata-token-parser.js +124 -0
  235. package/lib/token/colmetadata-token-parser.js.map +1 -0
  236. package/lib/token/done-token-parser.d.ts +6 -0
  237. package/lib/token/done-token-parser.js +76 -0
  238. package/lib/token/done-token-parser.js.map +1 -0
  239. package/lib/token/env-change-token-parser.d.ts +5 -0
  240. package/lib/token/env-change-token-parser.js +190 -0
  241. package/lib/token/env-change-token-parser.js.map +1 -0
  242. package/lib/token/feature-ext-ack-parser.d.ts +5 -0
  243. package/lib/token/feature-ext-ack-parser.js +52 -0
  244. package/lib/token/feature-ext-ack-parser.js.map +1 -0
  245. package/lib/token/fedauth-info-parser.d.ts +5 -0
  246. package/lib/token/fedauth-info-parser.js +62 -0
  247. package/lib/token/fedauth-info-parser.js.map +1 -0
  248. package/lib/token/handler.d.ts +136 -0
  249. package/lib/token/handler.js +445 -0
  250. package/lib/token/handler.js.map +1 -0
  251. package/lib/token/helpers.d.ts +28 -0
  252. package/lib/token/helpers.js +205 -0
  253. package/lib/token/helpers.js.map +1 -0
  254. package/lib/token/infoerror-token-parser.d.ts +5 -0
  255. package/lib/token/infoerror-token-parser.js +80 -0
  256. package/lib/token/infoerror-token-parser.js.map +1 -0
  257. package/lib/token/loginack-token-parser.d.ts +5 -0
  258. package/lib/token/loginack-token-parser.js +75 -0
  259. package/lib/token/loginack-token-parser.js.map +1 -0
  260. package/lib/token/nbcrow-token-parser.d.ts +4 -0
  261. package/lib/token/nbcrow-token-parser.js +103 -0
  262. package/lib/token/nbcrow-token-parser.js.map +1 -0
  263. package/lib/token/order-token-parser.d.ts +5 -0
  264. package/lib/token/order-token-parser.js +34 -0
  265. package/lib/token/order-token-parser.js.map +1 -0
  266. package/lib/token/returnstatus-token-parser.d.ts +5 -0
  267. package/lib/token/returnstatus-token-parser.js +21 -0
  268. package/lib/token/returnstatus-token-parser.js.map +1 -0
  269. package/lib/token/returnvalue-token-parser.d.ts +4 -0
  270. package/lib/token/returnvalue-token-parser.js +93 -0
  271. package/lib/token/returnvalue-token-parser.js.map +1 -0
  272. package/lib/token/row-token-parser.d.ts +4 -0
  273. package/lib/token/row-token-parser.js +76 -0
  274. package/lib/token/row-token-parser.js.map +1 -0
  275. package/lib/token/sspi-token-parser.d.ts +5 -0
  276. package/lib/token/sspi-token-parser.js +42 -0
  277. package/lib/token/sspi-token-parser.js.map +1 -0
  278. package/lib/token/stream-parser.d.ts +34 -0
  279. package/lib/token/stream-parser.js +341 -0
  280. package/lib/token/stream-parser.js.map +1 -0
  281. package/lib/token/token-stream-parser.d.ts +15 -0
  282. package/lib/token/token-stream-parser.js +36 -0
  283. package/lib/token/token-stream-parser.js.map +1 -0
  284. package/lib/token/token.d.ts +312 -0
  285. package/lib/token/token.js +328 -0
  286. package/lib/token/token.js.map +1 -0
  287. package/lib/tracking-buffer/writable-tracking-buffer.d.ts +47 -0
  288. package/lib/tracking-buffer/writable-tracking-buffer.js +249 -0
  289. package/lib/tracking-buffer/writable-tracking-buffer.js.map +1 -0
  290. package/lib/transaction.d.ts +39 -0
  291. package/lib/transaction.js +137 -0
  292. package/lib/transaction.js.map +1 -0
  293. package/lib/transient-error-lookup.d.ts +3 -0
  294. package/lib/transient-error-lookup.js +19 -0
  295. package/lib/transient-error-lookup.js.map +1 -0
  296. package/lib/value-parser.d.ts +7 -0
  297. package/lib/value-parser.js +813 -0
  298. package/lib/value-parser.js.map +1 -0
  299. package/package.json +145 -0
  300. package/pull_request_template.md +9 -0
  301. package/tsconfig.build-types.json +15 -0
  302. package/tsconfig.json +30 -0
  303. package/types/js-md4.d.ts +7 -0
  304. package/types/native-duplexpair.d.ts +12 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,91 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ Tedious is a pure-JavaScript/TypeScript implementation of the TDS (Tabular Data Stream) protocol for connecting to Microsoft SQL Server databases. It supports TDS versions 7.1-7.4 (SQL Server 2000-2022).
8
+
9
+ ## Common Commands
10
+
11
+ ```bash
12
+ # Build (compiles TypeScript via Babel to lib/)
13
+ npm run build
14
+
15
+ # Lint and type check
16
+ npm run lint
17
+
18
+ # Run unit tests
19
+ npm run test
20
+
21
+ # Run a single test file
22
+ npx mocha test/unit/<test-file>.ts
23
+
24
+ # Run a single test by name
25
+ npx mocha test/unit/ --grep "test name pattern"
26
+
27
+ # Run integration tests (requires SQL Server)
28
+ npm run test-integration
29
+
30
+ # Run all tests
31
+ npm run test-all
32
+
33
+ # Generate documentation
34
+ npm run docs
35
+ ```
36
+
37
+ ## Integration Tests Setup
38
+
39
+ Integration tests require a SQL Server instance. Use the dev container or start SQL Server manually:
40
+
41
+ ```bash
42
+ # Using docker-compose (from .devcontainer/)
43
+ docker-compose -f .devcontainer/docker-compose.yml up -d mssql
44
+
45
+ # Default connection: server=mssql (or localhost), user=sa, password=yourStrong(!)Password
46
+ ```
47
+
48
+ Test configuration is in `test/config.ts`. CI uses `test/config.ci.ts`.
49
+
50
+ ## Architecture
51
+
52
+ ### Core Classes
53
+
54
+ - **`src/connection.ts`** - Main `Connection` class managing TDS protocol handshake, authentication, state machine, and request queuing. This is the primary entry point (~3,600 lines).
55
+ - **`src/request.ts`** - `Request` class representing SQL queries/commands with parameters and callbacks.
56
+ - **`src/bulk-load.ts`** - `BulkLoad` class for bulk data loading operations.
57
+
58
+ ### TDS Protocol Implementation
59
+
60
+ - **`src/message-io.ts`** - Message encoding/decoding for TDS protocol
61
+ - **`src/packet.ts`** - TDS packet structure and constants
62
+ - **`src/prelogin-payload.ts`** - Pre-login negotiation
63
+ - **`src/login7-payload.ts`** - SQL Server login mechanism
64
+ - **`src/sqlbatch-payload.ts`** - SQL batch execution
65
+ - **`src/rpcrequest-payload.ts`** - RPC/stored procedure calls
66
+
67
+ ### Token Parsers (`src/token/`)
68
+
69
+ ~20 parsers for TDS protocol response tokens (COLMETADATA, ROW, DONE, ERROR, INFO, LOGINACK, etc.). Each parser handles a specific token type from the server response stream.
70
+
71
+ ### Data Types (`src/data-types/`)
72
+
73
+ 41 SQL Server data type implementations (int, varchar, datetime, money, xml, etc.). Each file exports a `DataType` object with `name`, `id`, `declaration`, `generateTypeInfo`, `generateParameterLength`, `generateParameterData`, and `validate` methods.
74
+
75
+ ### Always Encrypted (`src/always-encrypted/`)
76
+
77
+ Column-level encryption support with Azure Key Vault integration for encrypted column data.
78
+
79
+ ## Key Patterns
80
+
81
+ - **Event-driven async**: Connection emits events (`connect`, `end`, `error`, `infoMessage`, `errorMessage`, `debug`)
82
+ - **State machine**: Connection maintains internal state for TDS protocol handshake
83
+ - **Streaming**: Token parsers process response streams incrementally
84
+ - **Buffer management**: `src/tracking-buffer/` handles binary data serialization
85
+
86
+ ## TypeScript Configuration
87
+
88
+ - Strict mode enabled with ES2022 target
89
+ - Babel transpiles to `lib/` directory
90
+ - Type declarations generated separately via `tsconfig.build-types.json`
91
+ - Node.js >=18.17 required
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2010-2018 Mike D Pilsbury
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
13
+ all 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
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Tedious (node implementation of TDS)
2
+ [![NPM version](https://badge.fury.io/js/tedious.svg)](http://badge.fury.io/js/tedious) [![Build Status](https://ci.appveyor.com/api/projects/status/ike3p58hljpyffrl?svg=true)](https://ci.appveyor.com/project/tediousjs/tedious) [![Code Coverage](https://codecov.io/gh/tediousjs/tedious/badge.svg)](https://codecov.io/gh/tediousjs/tedious)
3
+
4
+
5
+ Tedious is a pure-Javascript implementation of the [TDS protocol](http://msdn.microsoft.com/en-us/library/dd304523.aspx),
6
+ which is used to interact with instances of Microsoft's SQL Server. It is intended to be a fairly slim implementation of the protocol, with not too much additional functionality.
7
+
8
+ **NOTE: New columns are nullable by default as of version 1.11.0**
9
+
10
+ Previous behavior can be restored using `config.options.enableAnsiNullDefault = false`. See [pull request 230](https://github.com/tediousjs/tedious/pull/230).
11
+
12
+ **NOTE: Default login behavior has changed slightly as of version 1.2**
13
+
14
+ See the [changelog](https://github.com/tediousjs/tedious/releases) for version history.
15
+
16
+
17
+ ### Supported TDS versions
18
+
19
+ - TDS 7.4 (SQL Server 2012/2014/2016/2017/2019/2022)
20
+ - TDS 7.3.B (SQL Server 2008 R2)
21
+ - TDS 7.3.A (SQL Server 2008)
22
+ - TDS 7.2 (SQL Server 2005)
23
+ - TDS 7.1 (SQL Server 2000)
24
+
25
+ ## Installation
26
+
27
+ Node.js is a prerequisite for installing tedious. Once you have installed [Node.js](https://nodejs.org/), installing tedious is simple:
28
+
29
+ npm install tedious
30
+
31
+ ## Getting Started
32
+ - [Node.js + macOS](https://www.microsoft.com/en-us/sql-server/developer-get-started/node/mac/)
33
+ - [Node.js + Red Hat Enterprise Linux](https://www.microsoft.com/en-us/sql-server/developer-get-started/node/rhel/)
34
+ - [Node.js + SUSE Linux Enterprise Server](https://www.microsoft.com/en-us/sql-server/developer-get-started/node/sles/)
35
+ - [Node.js + Ubuntu](https://www.microsoft.com/en-us/sql-server/developer-get-started/node/ubuntu/)
36
+ - [Node.js + Windows](https://www.microsoft.com/en-us/sql-server/developer-get-started/node/windows/)
37
+
38
+ <a name="documentation"></a>
39
+ ## Documentation
40
+ More documentation and code samples are available at [tediousjs.github.io/tedious/](http://tediousjs.github.io/tedious/)
41
+
42
+ <a name="name"></a>
43
+ ## Name
44
+ _Tedious_ is simply derived from a fast, slightly garbled, pronunciation of the letters T, D and S.
45
+
46
+ ## Developer Survey
47
+
48
+ We'd like to learn more about how you use tedious:
49
+
50
+ <a href="https://aka.ms/mssqltedioussurvey"><img style="float: right;" height="67" width="156" src="https://sqlchoice.blob.core.windows.net/sqlchoice/static/images/survey.png"></a>
51
+
52
+ <a name="contributing"></a>
53
+ ## Contributing
54
+ We welcome contributions from the community. Feel free to checkout the code and submit pull requests.
55
+
56
+ <a name="license"></a>
57
+ ## License
58
+
59
+ Copyright (c) 2010-2021 Mike D Pilsbury
60
+
61
+ The MIT License
62
+
63
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66
+
67
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/appveyor.yml ADDED
@@ -0,0 +1,67 @@
1
+ version: "{build}"
2
+
3
+ environment:
4
+ matrix:
5
+ - nodejs_version: "18"
6
+ - nodejs_version: "20"
7
+ - nodejs_version: "21"
8
+
9
+ branches:
10
+ only:
11
+ - master
12
+ - /^maint\/.+/
13
+ - /v\d+\.\d+\.\d+/
14
+
15
+ install:
16
+ - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
17
+ - npm install
18
+
19
+ services:
20
+ - mssql2017
21
+
22
+ cache:
23
+ - node_modules
24
+
25
+ build: off
26
+
27
+ before_test:
28
+ - npm prune
29
+
30
+ - sc config sqlbrowser start= auto
31
+ - net start sqlbrowser
32
+
33
+ test_script:
34
+ - node --version
35
+ - npm --version
36
+
37
+ - pwsh: |-
38
+ $ErrorActionPreference = "Stop"
39
+
40
+ npm run-script test
41
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
42
+
43
+ Copy-Item -Force test/config.appveyor.ts test/config.ts
44
+
45
+ $env:NTLM_USERNAME = $env:USERNAME
46
+ $env:NTLM_PASSWORD = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", '')
47
+ $env:NTLM_DOMAIN = $env:COMPUTERNAME
48
+
49
+ $env:TEDIOUS_TDS_VERSION = '7_4'
50
+ npm run-script test-integration
51
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
52
+
53
+ $env:TEDIOUS_TDS_VERSION = '7_3_B'
54
+ npm run-script test-integration
55
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
56
+
57
+ $env:TEDIOUS_TDS_VERSION = '7_3_A'
58
+ npm run-script test-integration
59
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
60
+
61
+ $env:TEDIOUS_TDS_VERSION = '7_2'
62
+ npm run-script test-integration
63
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
64
+
65
+ $env:TEDIOUS_TDS_VERSION = '7_1'
66
+ npm run-script test-integration
67
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
@@ -0,0 +1,314 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config';
2
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
3
+ import stylistic from '@stylistic/eslint-plugin';
4
+ import globals from 'globals';
5
+ import tsParser from '@typescript-eslint/parser';
6
+ import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+ import js from '@eslint/js';
9
+ import { FlatCompat } from '@eslint/eslintrc';
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+ const compat = new FlatCompat({
14
+ baseDirectory: __dirname,
15
+ recommendedConfig: js.configs.recommended,
16
+ allConfig: js.configs.all
17
+ });
18
+
19
+ export default defineConfig([
20
+ globalIgnores(['src/**/*.d.ts']),
21
+ {
22
+ extends: compat.extends('plugin:@typescript-eslint/eslint-recommended'),
23
+
24
+ plugins: {
25
+ '@typescript-eslint': typescriptEslint,
26
+ '@stylelistic': stylistic,
27
+ },
28
+
29
+ languageOptions: {
30
+ globals: {
31
+ ...globals.node,
32
+ },
33
+
34
+ parser: tsParser,
35
+ ecmaVersion: 5,
36
+ sourceType: 'module',
37
+
38
+ parserOptions: {
39
+ project: './tsconfig.json',
40
+ },
41
+ },
42
+
43
+ rules: {
44
+ 'accessor-pairs': 'error',
45
+ 'array-callback-return': 'error',
46
+ 'arrow-parens': ['error', 'always'],
47
+
48
+ 'arrow-spacing': ['error', {
49
+ before: true,
50
+ after: true,
51
+ }],
52
+
53
+ 'block-spacing': 'error',
54
+
55
+ 'brace-style': ['error', '1tbs', {
56
+ allowSingleLine: true,
57
+ }],
58
+
59
+ 'comma-dangle': ['error', 'only-multiline'],
60
+ 'comma-spacing': 'error',
61
+ 'comma-style': 'error',
62
+ 'computed-property-spacing': 'error',
63
+ 'constructor-super': 'error',
64
+ 'dot-location': ['error', 'property'],
65
+ 'dot-notation': 'error',
66
+ 'eol-last': 'error',
67
+ 'eqeqeq': ['error', 'smart'],
68
+ 'for-direction': 'error',
69
+ 'func-call-spacing': 'error',
70
+ 'func-name-matching': 'error',
71
+
72
+ 'func-style': ['error', 'declaration', {
73
+ allowArrowFunctions: true,
74
+ }],
75
+
76
+ 'indent': ['error', 2, {
77
+ ArrayExpression: 'first',
78
+
79
+ CallExpression: {
80
+ arguments: 'first',
81
+ },
82
+
83
+ FunctionDeclaration: {
84
+ parameters: 'first',
85
+ },
86
+
87
+ FunctionExpression: {
88
+ parameters: 'first',
89
+ },
90
+
91
+ MemberExpression: 'off',
92
+ ObjectExpression: 'first',
93
+ SwitchCase: 1,
94
+ }],
95
+
96
+ 'key-spacing': ['error', {
97
+ mode: 'strict',
98
+ }],
99
+
100
+ 'keyword-spacing': 'error',
101
+ 'linebreak-style': ['error', 'unix'],
102
+ 'new-parens': 'error',
103
+ 'no-class-assign': 'error',
104
+ 'no-confusing-arrow': 'error',
105
+ 'no-const-assign': 'error',
106
+ 'no-control-regex': 'error',
107
+ 'no-debugger': 'error',
108
+ 'no-delete-var': 'error',
109
+ 'no-dupe-args': 'error',
110
+ 'no-dupe-keys': 'error',
111
+ 'no-duplicate-case': 'error',
112
+ 'no-duplicate-imports': 'error',
113
+ 'no-empty-character-class': 'error',
114
+ 'no-ex-assign': 'error',
115
+ 'no-extra-boolean-cast': 'error',
116
+ 'no-extra-parens': ['error', 'functions'],
117
+ 'no-extra-semi': 'error',
118
+ 'no-fallthrough': 'error',
119
+ 'no-func-assign': 'error',
120
+ 'no-global-assign': 'error',
121
+ 'no-invalid-regexp': 'error',
122
+ 'no-irregular-whitespace': 'error',
123
+ 'no-lonely-if': 'error',
124
+ 'no-misleading-character-class': 'error',
125
+ 'no-mixed-requires': 'error',
126
+ 'no-mixed-spaces-and-tabs': 'error',
127
+
128
+ 'no-multi-spaces': ['error', {
129
+ ignoreEOLComments: true,
130
+ }],
131
+
132
+ 'no-multiple-empty-lines': ['error', {
133
+ max: 2,
134
+ maxEOF: 0,
135
+ maxBOF: 0,
136
+ }],
137
+
138
+ 'no-negated-in-lhs': 'error',
139
+ 'no-new-require': 'error',
140
+ 'no-new-symbol': 'error',
141
+ 'no-obj-calls': 'error',
142
+ 'no-octal': 'error',
143
+ 'no-path-concat': 'error',
144
+ 'no-proto': 'error',
145
+ 'no-redeclare': 'error',
146
+ 'no-restricted-modules': ['error', 'sys'],
147
+
148
+ 'no-restricted-syntax': ['error', {
149
+ selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
150
+ message: '`setTimeout()` must be invoked with at least two arguments.',
151
+ }, {
152
+ selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
153
+ message: '`setInterval()` must be invoked with at least two arguments.',
154
+ }, {
155
+ selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]',
156
+ message: 'Use `new` keyword when throwing an `Error`.',
157
+ }],
158
+
159
+ 'no-return-await': 'off',
160
+ 'no-self-assign': 'error',
161
+ 'no-self-compare': 'error',
162
+ 'no-tabs': 'error',
163
+ 'no-template-curly-in-string': 'error',
164
+ 'no-this-before-super': 'error',
165
+ 'no-throw-literal': 'error',
166
+ 'no-trailing-spaces': 2,
167
+ 'no-undef-init': 'error',
168
+ 'no-unexpected-multiline': 2,
169
+ 'no-unreachable': 'error',
170
+ 'no-unsafe-finally': 'error',
171
+ 'no-unsafe-negation': 'error',
172
+ 'no-unused-labels': 'error',
173
+
174
+ 'no-unused-vars': ['error', {
175
+ args: 'none',
176
+ caughtErrors: 'all',
177
+ }],
178
+
179
+ 'no-use-before-define': ['error', {
180
+ classes: true,
181
+ functions: false,
182
+ variables: false,
183
+ }],
184
+
185
+ 'no-useless-call': 'error',
186
+ 'no-useless-catch': 'error',
187
+ 'no-useless-concat': 'error',
188
+ 'no-useless-constructor': 'error',
189
+ 'no-useless-escape': 'error',
190
+ 'no-useless-return': 'error',
191
+ 'no-void': 'error',
192
+ 'no-whitespace-before-property': 'error',
193
+ 'no-with': 'error',
194
+ 'object-curly-spacing': ['error', 'always'],
195
+
196
+ 'one-var': ['error', {
197
+ initialized: 'never',
198
+ }],
199
+
200
+ 'one-var-declaration-per-line': 'error',
201
+ 'operator-linebreak': ['error', 'after'],
202
+
203
+ 'prefer-const': ['error', {
204
+ ignoreReadBeforeAssign: true,
205
+ }],
206
+
207
+ 'quotes': ['error', 'single', {
208
+ avoidEscape: true,
209
+ }],
210
+
211
+ 'quote-props': ['error', 'consistent'],
212
+ 'rest-spread-spacing': 'error',
213
+ 'semi': 'error',
214
+ 'semi-spacing': 'error',
215
+ 'space-before-blocks': ['error', 'always'],
216
+
217
+ 'space-before-function-paren': ['error', {
218
+ anonymous: 'never',
219
+ named: 'never',
220
+ asyncArrow: 'always',
221
+ }],
222
+
223
+ 'space-in-parens': ['error', 'never'],
224
+ 'space-infix-ops': 'error',
225
+ 'space-unary-ops': 'error',
226
+
227
+ 'spaced-comment': ['error', 'always', {
228
+ block: {
229
+ balanced: true,
230
+ },
231
+
232
+ exceptions: ['-'],
233
+ }],
234
+
235
+ 'symbol-description': 'error',
236
+ 'template-curly-spacing': 'error',
237
+ 'unicode-bom': 'error',
238
+ 'use-isnan': 'error',
239
+ 'valid-typeof': 'error',
240
+ },
241
+ },
242
+ {
243
+ files: ['**/*.ts'],
244
+
245
+ rules: {
246
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
247
+ '@typescript-eslint/ban-ts-comment': 'error',
248
+
249
+ '@typescript-eslint/no-empty-object-type': 'error',
250
+ '@typescript-eslint/no-unsafe-function-type': 'error',
251
+ '@typescript-eslint/no-wrapper-object-types': 'error',
252
+
253
+ '@typescript-eslint/consistent-type-assertions': 'error',
254
+
255
+ '@stylelistic/member-delimiter-style': ['error', {
256
+ multiline: {
257
+ delimiter: 'semi',
258
+ requireLast: true,
259
+ },
260
+
261
+ singleline: {
262
+ delimiter: 'comma',
263
+ requireLast: false,
264
+ },
265
+ }],
266
+
267
+ 'no-array-constructor': 'off',
268
+ '@typescript-eslint/no-array-constructor': 'error',
269
+ '@typescript-eslint/no-empty-interface': 'error',
270
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
271
+ '@typescript-eslint/no-inferrable-types': 'error',
272
+ '@typescript-eslint/no-misused-new': 'error',
273
+ '@typescript-eslint/no-namespace': 'error',
274
+
275
+ '@typescript-eslint/no-this-alias': ['error', {
276
+ allowDestructuring: true,
277
+ allowedNames: ['self'],
278
+ }],
279
+
280
+ 'no-unused-vars': 'off',
281
+
282
+ '@typescript-eslint/no-unused-vars': ['error', {
283
+ args: 'none',
284
+ caughtErrors: 'all',
285
+ }],
286
+
287
+ 'no-use-before-define': 'off',
288
+
289
+ '@typescript-eslint/no-use-before-define': ['error', {
290
+ classes: true,
291
+ functions: false,
292
+ variables: false,
293
+ }],
294
+
295
+ '@typescript-eslint/no-var-requires': 'error',
296
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
297
+ '@typescript-eslint/triple-slash-reference': 'error',
298
+ '@stylelistic/type-annotation-spacing': 'error',
299
+ '@typescript-eslint/return-await': ['error', 'always'],
300
+ 'no-var': 'error',
301
+ 'prefer-const': 'error',
302
+ 'prefer-rest-params': 'error',
303
+ 'prefer-spread': 'error',
304
+ },
305
+ },
306
+ {
307
+ files: ['test/**/*'],
308
+ languageOptions: {
309
+ globals: {
310
+ ...globals.mocha,
311
+ },
312
+ },
313
+ }
314
+ ]);
@@ -0,0 +1,2 @@
1
+ import WritableTrackingBuffer from './tracking-buffer/writable-tracking-buffer';
2
+ export declare function writeToTrackingBuffer(buffer: WritableTrackingBuffer, txnDescriptor: Buffer, outstandingRequestCount: number): WritableTrackingBuffer;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.writeToTrackingBuffer = writeToTrackingBuffer;
7
+ const TYPE = {
8
+ QUERY_NOTIFICATIONS: 1,
9
+ TXN_DESCRIPTOR: 2,
10
+ TRACE_ACTIVITY: 3
11
+ };
12
+ const TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8;
13
+ const TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN;
14
+ function writeToTrackingBuffer(buffer, txnDescriptor, outstandingRequestCount) {
15
+ buffer.writeUInt32LE(0);
16
+ buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN);
17
+ buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR);
18
+ buffer.writeBuffer(txnDescriptor);
19
+ buffer.writeUInt32LE(outstandingRequestCount);
20
+ const data = buffer.data;
21
+ data.writeUInt32LE(data.length, 0);
22
+ return buffer;
23
+ }
24
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJUWVBFIiwiUVVFUllfTk9USUZJQ0FUSU9OUyIsIlRYTl9ERVNDUklQVE9SIiwiVFJBQ0VfQUNUSVZJVFkiLCJUWE5ERVNDUklQVE9SX0hFQURFUl9EQVRBX0xFTiIsIlRYTkRFU0NSSVBUT1JfSEVBREVSX0xFTiIsIndyaXRlVG9UcmFja2luZ0J1ZmZlciIsImJ1ZmZlciIsInR4bkRlc2NyaXB0b3IiLCJvdXRzdGFuZGluZ1JlcXVlc3RDb3VudCIsIndyaXRlVUludDMyTEUiLCJ3cml0ZVVJbnQxNkxFIiwid3JpdGVCdWZmZXIiLCJkYXRhIiwibGVuZ3RoIl0sInNvdXJjZXMiOlsiLi4vc3JjL2FsbC1oZWFkZXJzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBXcml0YWJsZVRyYWNraW5nQnVmZmVyIGZyb20gJy4vdHJhY2tpbmctYnVmZmVyL3dyaXRhYmxlLXRyYWNraW5nLWJ1ZmZlcic7XG5cbmNvbnN0IFRZUEUgPSB7XG4gIFFVRVJZX05PVElGSUNBVElPTlM6IDEsXG4gIFRYTl9ERVNDUklQVE9SOiAyLFxuICBUUkFDRV9BQ1RJVklUWTogM1xufTtcblxuY29uc3QgVFhOREVTQ1JJUFRPUl9IRUFERVJfREFUQV9MRU4gPSA0ICsgODtcblxuY29uc3QgVFhOREVTQ1JJUFRPUl9IRUFERVJfTEVOID0gNCArIDIgKyBUWE5ERVNDUklQVE9SX0hFQURFUl9EQVRBX0xFTjtcblxuZXhwb3J0IGZ1bmN0aW9uIHdyaXRlVG9UcmFja2luZ0J1ZmZlcihidWZmZXI6IFdyaXRhYmxlVHJhY2tpbmdCdWZmZXIsIHR4bkRlc2NyaXB0b3I6IEJ1ZmZlciwgb3V0c3RhbmRpbmdSZXF1ZXN0Q291bnQ6IG51bWJlcikge1xuICBidWZmZXIud3JpdGVVSW50MzJMRSgwKTtcbiAgYnVmZmVyLndyaXRlVUludDMyTEUoVFhOREVTQ1JJUFRPUl9IRUFERVJfTEVOKTtcbiAgYnVmZmVyLndyaXRlVUludDE2TEUoVFlQRS5UWE5fREVTQ1JJUFRPUik7XG4gIGJ1ZmZlci53cml0ZUJ1ZmZlcih0eG5EZXNjcmlwdG9yKTtcbiAgYnVmZmVyLndyaXRlVUludDMyTEUob3V0c3RhbmRpbmdSZXF1ZXN0Q291bnQpO1xuXG4gIGNvbnN0IGRhdGEgPSBidWZmZXIuZGF0YTtcbiAgZGF0YS53cml0ZVVJbnQzMkxFKGRhdGEubGVuZ3RoLCAwKTtcbiAgcmV0dXJuIGJ1ZmZlcjtcbn1cbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRUEsTUFBTUEsSUFBSSxHQUFHO0VBQ1hDLG1CQUFtQixFQUFFLENBQUM7RUFDdEJDLGNBQWMsRUFBRSxDQUFDO0VBQ2pCQyxjQUFjLEVBQUU7QUFDbEIsQ0FBQztBQUVELE1BQU1DLDZCQUE2QixHQUFHLENBQUMsR0FBRyxDQUFDO0FBRTNDLE1BQU1DLHdCQUF3QixHQUFHLENBQUMsR0FBRyxDQUFDLEdBQUdELDZCQUE2QjtBQUUvRCxTQUFTRSxxQkFBcUJBLENBQUNDLE1BQThCLEVBQUVDLGFBQXFCLEVBQUVDLHVCQUErQixFQUFFO0VBQzVIRixNQUFNLENBQUNHLGFBQWEsQ0FBQyxDQUFDLENBQUM7RUFDdkJILE1BQU0sQ0FBQ0csYUFBYSxDQUFDTCx3QkFBd0IsQ0FBQztFQUM5Q0UsTUFBTSxDQUFDSSxhQUFhLENBQUNYLElBQUksQ0FBQ0UsY0FBYyxDQUFDO0VBQ3pDSyxNQUFNLENBQUNLLFdBQVcsQ0FBQ0osYUFBYSxDQUFDO0VBQ2pDRCxNQUFNLENBQUNHLGFBQWEsQ0FBQ0QsdUJBQXVCLENBQUM7RUFFN0MsTUFBTUksSUFBSSxHQUFHTixNQUFNLENBQUNNLElBQUk7RUFDeEJBLElBQUksQ0FBQ0gsYUFBYSxDQUFDRyxJQUFJLENBQUNDLE1BQU0sRUFBRSxDQUFDLENBQUM7RUFDbEMsT0FBT1AsTUFBTTtBQUNmIiwiaWdub3JlTGlzdCI6W119
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-headers.js","names":["TYPE","QUERY_NOTIFICATIONS","TXN_DESCRIPTOR","TRACE_ACTIVITY","TXNDESCRIPTOR_HEADER_DATA_LEN","TXNDESCRIPTOR_HEADER_LEN","writeToTrackingBuffer","buffer","txnDescriptor","outstandingRequestCount","writeUInt32LE","writeUInt16LE","writeBuffer","data","length"],"sources":["../src/all-headers.ts"],"sourcesContent":["import WritableTrackingBuffer from './tracking-buffer/writable-tracking-buffer';\n\nconst TYPE = {\n QUERY_NOTIFICATIONS: 1,\n TXN_DESCRIPTOR: 2,\n TRACE_ACTIVITY: 3\n};\n\nconst TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8;\n\nconst TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN;\n\nexport function writeToTrackingBuffer(buffer: WritableTrackingBuffer, txnDescriptor: Buffer, outstandingRequestCount: number) {\n buffer.writeUInt32LE(0);\n buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN);\n buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR);\n buffer.writeBuffer(txnDescriptor);\n buffer.writeUInt32LE(outstandingRequestCount);\n\n const data = buffer.data;\n data.writeUInt32LE(data.length, 0);\n return buffer;\n}\n"],"mappings":";;;;;;AAEA,MAAMA,IAAI,GAAG;EACXC,mBAAmB,EAAE,CAAC;EACtBC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE;AAClB,CAAC;AAED,MAAMC,6BAA6B,GAAG,CAAC,GAAG,CAAC;AAE3C,MAAMC,wBAAwB,GAAG,CAAC,GAAG,CAAC,GAAGD,6BAA6B;AAE/D,SAASE,qBAAqBA,CAACC,MAA8B,EAAEC,aAAqB,EAAEC,uBAA+B,EAAE;EAC5HF,MAAM,CAACG,aAAa,CAAC,CAAC,CAAC;EACvBH,MAAM,CAACG,aAAa,CAACL,wBAAwB,CAAC;EAC9CE,MAAM,CAACI,aAAa,CAACX,IAAI,CAACE,cAAc,CAAC;EACzCK,MAAM,CAACK,WAAW,CAACJ,aAAa,CAAC;EACjCD,MAAM,CAACG,aAAa,CAACD,uBAAuB,CAAC;EAE7C,MAAMI,IAAI,GAAGN,MAAM,CAACM,IAAI;EACxBA,IAAI,CAACH,aAAa,CAACG,IAAI,CAACC,MAAM,EAAE,CAAC,CAAC;EAClC,OAAOP,MAAM;AACf","ignoreList":[]}