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.
- package/CLAUDE.md +91 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/appveyor.yml +67 -0
- package/eslint.config.mjs +314 -0
- package/lib/all-headers.d.ts +2 -0
- package/lib/all-headers.js +24 -0
- package/lib/all-headers.js.map +1 -0
- package/lib/always-encrypted/aead-aes-256-cbc-hmac-algorithm.js +82 -0
- package/lib/always-encrypted/aead-aes-256-cbc-hmac-algorithm.js.map +1 -0
- package/lib/always-encrypted/aead-aes-256-cbc-hmac-encryption-key.js +55 -0
- package/lib/always-encrypted/aead-aes-256-cbc-hmac-encryption-key.js.map +1 -0
- package/lib/always-encrypted/cek-entry.d.ts +11 -0
- package/lib/always-encrypted/cek-entry.js +42 -0
- package/lib/always-encrypted/cek-entry.js.map +1 -0
- package/lib/always-encrypted/get-parameter-encryption-metadata.js +90 -0
- package/lib/always-encrypted/get-parameter-encryption-metadata.js.map +1 -0
- package/lib/always-encrypted/key-crypto.js +94 -0
- package/lib/always-encrypted/key-crypto.js.map +1 -0
- package/lib/always-encrypted/keystore-provider-azure-key-vault.d.ts +21 -0
- package/lib/always-encrypted/keystore-provider-azure-key-vault.js +247 -0
- package/lib/always-encrypted/keystore-provider-azure-key-vault.js.map +1 -0
- package/lib/always-encrypted/symmetric-key-cache.js +36 -0
- package/lib/always-encrypted/symmetric-key-cache.js.map +1 -0
- package/lib/always-encrypted/symmetric-key.js +25 -0
- package/lib/always-encrypted/symmetric-key.js.map +1 -0
- package/lib/always-encrypted/types.d.ts +73 -0
- package/lib/always-encrypted/types.js +61 -0
- package/lib/always-encrypted/types.js.map +1 -0
- package/lib/always-encrypted/utils.js +23 -0
- package/lib/always-encrypted/utils.js.map +1 -0
- package/lib/bulk-load-payload.d.ts +8 -0
- package/lib/bulk-load-payload.js +23 -0
- package/lib/bulk-load-payload.js.map +1 -0
- package/lib/bulk-load.d.ts +275 -0
- package/lib/bulk-load.js +515 -0
- package/lib/bulk-load.js.map +1 -0
- package/lib/collation.d.ts +28 -0
- package/lib/collation.js +348 -0
- package/lib/collation.js.map +1 -0
- package/lib/connection.d.ts +1309 -0
- package/lib/connection.js +2732 -0
- package/lib/connection.js.map +1 -0
- package/lib/connector.d.ts +18 -0
- package/lib/connector.js +142 -0
- package/lib/connector.js.map +1 -0
- package/lib/data-type.d.ts +554 -0
- package/lib/data-type.js +428 -0
- package/lib/data-type.js.map +1 -0
- package/lib/data-types/bigint.d.ts +3 -0
- package/lib/data-types/bigint.js +53 -0
- package/lib/data-types/bigint.js.map +1 -0
- package/lib/data-types/binary.d.ts +5 -0
- package/lib/data-types/binary.js +67 -0
- package/lib/data-types/binary.js.map +1 -0
- package/lib/data-types/bit.d.ts +3 -0
- package/lib/data-types/bit.js +46 -0
- package/lib/data-types/bit.js.map +1 -0
- package/lib/data-types/bitn.d.ts +3 -0
- package/lib/data-types/bitn.js +29 -0
- package/lib/data-types/bitn.js.map +1 -0
- package/lib/data-types/char.d.ts +5 -0
- package/lib/data-types/char.js +86 -0
- package/lib/data-types/char.js.map +1 -0
- package/lib/data-types/date.d.ts +3 -0
- package/lib/data-types/date.js +72 -0
- package/lib/data-types/date.js.map +1 -0
- package/lib/data-types/datetime.d.ts +3 -0
- package/lib/data-types/datetime.js +93 -0
- package/lib/data-types/datetime.js.map +1 -0
- package/lib/data-types/datetime2.d.ts +5 -0
- package/lib/data-types/datetime2.js +118 -0
- package/lib/data-types/datetime2.js.map +1 -0
- package/lib/data-types/datetimen.d.ts +3 -0
- package/lib/data-types/datetimen.js +29 -0
- package/lib/data-types/datetimen.js.map +1 -0
- package/lib/data-types/datetimeoffset.d.ts +5 -0
- package/lib/data-types/datetimeoffset.js +111 -0
- package/lib/data-types/datetimeoffset.js.map +1 -0
- package/lib/data-types/decimal.d.ts +6 -0
- package/lib/data-types/decimal.js +107 -0
- package/lib/data-types/decimal.js.map +1 -0
- package/lib/data-types/decimaln.d.ts +3 -0
- package/lib/data-types/decimaln.js +29 -0
- package/lib/data-types/decimaln.js.map +1 -0
- package/lib/data-types/float.d.ts +3 -0
- package/lib/data-types/float.js +47 -0
- package/lib/data-types/float.js.map +1 -0
- package/lib/data-types/floatn.d.ts +3 -0
- package/lib/data-types/floatn.js +29 -0
- package/lib/data-types/floatn.js.map +1 -0
- package/lib/data-types/image.d.ts +3 -0
- package/lib/data-types/image.js +56 -0
- package/lib/data-types/image.js.map +1 -0
- package/lib/data-types/int.d.ts +3 -0
- package/lib/data-types/int.js +53 -0
- package/lib/data-types/int.js.map +1 -0
- package/lib/data-types/intn.d.ts +3 -0
- package/lib/data-types/intn.js +29 -0
- package/lib/data-types/intn.js.map +1 -0
- package/lib/data-types/money.d.ts +3 -0
- package/lib/data-types/money.js +59 -0
- package/lib/data-types/money.js.map +1 -0
- package/lib/data-types/moneyn.d.ts +3 -0
- package/lib/data-types/moneyn.js +29 -0
- package/lib/data-types/moneyn.js.map +1 -0
- package/lib/data-types/nchar.d.ts +5 -0
- package/lib/data-types/nchar.js +100 -0
- package/lib/data-types/nchar.js.map +1 -0
- package/lib/data-types/ntext.d.ts +3 -0
- package/lib/data-types/ntext.js +60 -0
- package/lib/data-types/ntext.js.map +1 -0
- package/lib/data-types/null.d.ts +3 -0
- package/lib/data-types/null.js +29 -0
- package/lib/data-types/null.js.map +1 -0
- package/lib/data-types/numeric.d.ts +6 -0
- package/lib/data-types/numeric.js +106 -0
- package/lib/data-types/numeric.js.map +1 -0
- package/lib/data-types/numericn.d.ts +3 -0
- package/lib/data-types/numericn.js +29 -0
- package/lib/data-types/numericn.js.map +1 -0
- package/lib/data-types/nvarchar.d.ts +5 -0
- package/lib/data-types/nvarchar.js +133 -0
- package/lib/data-types/nvarchar.js.map +1 -0
- package/lib/data-types/real.d.ts +3 -0
- package/lib/data-types/real.js +48 -0
- package/lib/data-types/real.js.map +1 -0
- package/lib/data-types/smalldatetime.d.ts +3 -0
- package/lib/data-types/smalldatetime.js +83 -0
- package/lib/data-types/smalldatetime.js.map +1 -0
- package/lib/data-types/smallint.d.ts +3 -0
- package/lib/data-types/smallint.js +53 -0
- package/lib/data-types/smallint.js.map +1 -0
- package/lib/data-types/smallmoney.d.ts +3 -0
- package/lib/data-types/smallmoney.js +51 -0
- package/lib/data-types/smallmoney.js.map +1 -0
- package/lib/data-types/sql-variant.d.ts +3 -0
- package/lib/data-types/sql-variant.js +29 -0
- package/lib/data-types/sql-variant.js.map +1 -0
- package/lib/data-types/text.d.ts +3 -0
- package/lib/data-types/text.js +69 -0
- package/lib/data-types/text.js.map +1 -0
- package/lib/data-types/time.d.ts +3 -0
- package/lib/data-types/time.js +96 -0
- package/lib/data-types/time.js.map +1 -0
- package/lib/data-types/tinyint.d.ts +3 -0
- package/lib/data-types/tinyint.js +53 -0
- package/lib/data-types/tinyint.js.map +1 -0
- package/lib/data-types/tvp.d.ts +3 -0
- package/lib/data-types/tvp.js +117 -0
- package/lib/data-types/tvp.js.map +1 -0
- package/lib/data-types/udt.d.ts +3 -0
- package/lib/data-types/udt.js +29 -0
- package/lib/data-types/udt.js.map +1 -0
- package/lib/data-types/uniqueidentifier.d.ts +3 -0
- package/lib/data-types/uniqueidentifier.js +50 -0
- package/lib/data-types/uniqueidentifier.js.map +1 -0
- package/lib/data-types/varbinary.d.ts +5 -0
- package/lib/data-types/varbinary.js +119 -0
- package/lib/data-types/varbinary.js.map +1 -0
- package/lib/data-types/varchar.d.ts +5 -0
- package/lib/data-types/varchar.js +112 -0
- package/lib/data-types/varchar.js.map +1 -0
- package/lib/data-types/xml.d.ts +3 -0
- package/lib/data-types/xml.js +29 -0
- package/lib/data-types/xml.js.map +1 -0
- package/lib/debug.d.ts +25 -0
- package/lib/debug.js +66 -0
- package/lib/debug.js.map +1 -0
- package/lib/errors.d.ts +17 -0
- package/lib/errors.js +23 -0
- package/lib/errors.js.map +1 -0
- package/lib/guid-parser.d.ts +3 -0
- package/lib/guid-parser.js +30 -0
- package/lib/guid-parser.js.map +1 -0
- package/lib/incoming-message-stream.d.ts +19 -0
- package/lib/incoming-message-stream.js +97 -0
- package/lib/incoming-message-stream.js.map +1 -0
- package/lib/instance-lookup.d.ts +13 -0
- package/lib/instance-lookup.js +91 -0
- package/lib/instance-lookup.js.map +1 -0
- package/lib/library.d.ts +1 -0
- package/lib/library.js +8 -0
- package/lib/library.js.map +1 -0
- package/lib/login7-payload.d.ts +51 -0
- package/lib/login7-payload.js +408 -0
- package/lib/login7-payload.js.map +1 -0
- package/lib/message-io.d.ts +28 -0
- package/lib/message-io.js +152 -0
- package/lib/message-io.js.map +1 -0
- package/lib/message.d.ts +11 -0
- package/lib/message.js +21 -0
- package/lib/message.js.map +1 -0
- package/lib/metadata-parser.d.ts +48 -0
- package/lib/metadata-parser.js +380 -0
- package/lib/metadata-parser.js.map +1 -0
- package/lib/ntlm-payload.d.ts +23 -0
- package/lib/ntlm-payload.js +135 -0
- package/lib/ntlm-payload.js.map +1 -0
- package/lib/ntlm.d.ts +4 -0
- package/lib/ntlm.js +72 -0
- package/lib/ntlm.js.map +1 -0
- package/lib/outgoing-message-stream.d.ts +15 -0
- package/lib/outgoing-message-stream.js +81 -0
- package/lib/outgoing-message-stream.js.map +1 -0
- package/lib/packet.d.ts +33 -0
- package/lib/packet.js +191 -0
- package/lib/packet.js.map +1 -0
- package/lib/prelogin-payload.d.ts +67 -0
- package/lib/prelogin-payload.js +228 -0
- package/lib/prelogin-payload.js.map +1 -0
- package/lib/request.d.ts +370 -0
- package/lib/request.js +387 -0
- package/lib/request.js.map +1 -0
- package/lib/rpcrequest-payload.d.ts +16 -0
- package/lib/rpcrequest-payload.js +109 -0
- package/lib/rpcrequest-payload.js.map +1 -0
- package/lib/sender.d.ts +5 -0
- package/lib/sender.js +78 -0
- package/lib/sender.js.map +1 -0
- package/lib/special-stored-procedure.d.ts +18 -0
- package/lib/special-stored-procedure.js +26 -0
- package/lib/special-stored-procedure.js.map +1 -0
- package/lib/sqlbatch-payload.d.ts +13 -0
- package/lib/sqlbatch-payload.js +34 -0
- package/lib/sqlbatch-payload.js.map +1 -0
- package/lib/tds-versions.d.ts +6 -0
- package/lib/tds-versions.js +19 -0
- package/lib/tds-versions.js.map +1 -0
- package/lib/tedious.d.ts +13 -0
- package/lib/tedious.js +73 -0
- package/lib/tedious.js.map +1 -0
- package/lib/token/colmetadata-token-parser.d.ts +12 -0
- package/lib/token/colmetadata-token-parser.js +124 -0
- package/lib/token/colmetadata-token-parser.js.map +1 -0
- package/lib/token/done-token-parser.d.ts +6 -0
- package/lib/token/done-token-parser.js +76 -0
- package/lib/token/done-token-parser.js.map +1 -0
- package/lib/token/env-change-token-parser.d.ts +5 -0
- package/lib/token/env-change-token-parser.js +190 -0
- package/lib/token/env-change-token-parser.js.map +1 -0
- package/lib/token/feature-ext-ack-parser.d.ts +5 -0
- package/lib/token/feature-ext-ack-parser.js +52 -0
- package/lib/token/feature-ext-ack-parser.js.map +1 -0
- package/lib/token/fedauth-info-parser.d.ts +5 -0
- package/lib/token/fedauth-info-parser.js +62 -0
- package/lib/token/fedauth-info-parser.js.map +1 -0
- package/lib/token/handler.d.ts +136 -0
- package/lib/token/handler.js +445 -0
- package/lib/token/handler.js.map +1 -0
- package/lib/token/helpers.d.ts +28 -0
- package/lib/token/helpers.js +205 -0
- package/lib/token/helpers.js.map +1 -0
- package/lib/token/infoerror-token-parser.d.ts +5 -0
- package/lib/token/infoerror-token-parser.js +80 -0
- package/lib/token/infoerror-token-parser.js.map +1 -0
- package/lib/token/loginack-token-parser.d.ts +5 -0
- package/lib/token/loginack-token-parser.js +75 -0
- package/lib/token/loginack-token-parser.js.map +1 -0
- package/lib/token/nbcrow-token-parser.d.ts +4 -0
- package/lib/token/nbcrow-token-parser.js +103 -0
- package/lib/token/nbcrow-token-parser.js.map +1 -0
- package/lib/token/order-token-parser.d.ts +5 -0
- package/lib/token/order-token-parser.js +34 -0
- package/lib/token/order-token-parser.js.map +1 -0
- package/lib/token/returnstatus-token-parser.d.ts +5 -0
- package/lib/token/returnstatus-token-parser.js +21 -0
- package/lib/token/returnstatus-token-parser.js.map +1 -0
- package/lib/token/returnvalue-token-parser.d.ts +4 -0
- package/lib/token/returnvalue-token-parser.js +93 -0
- package/lib/token/returnvalue-token-parser.js.map +1 -0
- package/lib/token/row-token-parser.d.ts +4 -0
- package/lib/token/row-token-parser.js +76 -0
- package/lib/token/row-token-parser.js.map +1 -0
- package/lib/token/sspi-token-parser.d.ts +5 -0
- package/lib/token/sspi-token-parser.js +42 -0
- package/lib/token/sspi-token-parser.js.map +1 -0
- package/lib/token/stream-parser.d.ts +34 -0
- package/lib/token/stream-parser.js +341 -0
- package/lib/token/stream-parser.js.map +1 -0
- package/lib/token/token-stream-parser.d.ts +15 -0
- package/lib/token/token-stream-parser.js +36 -0
- package/lib/token/token-stream-parser.js.map +1 -0
- package/lib/token/token.d.ts +312 -0
- package/lib/token/token.js +328 -0
- package/lib/token/token.js.map +1 -0
- package/lib/tracking-buffer/writable-tracking-buffer.d.ts +47 -0
- package/lib/tracking-buffer/writable-tracking-buffer.js +249 -0
- package/lib/tracking-buffer/writable-tracking-buffer.js.map +1 -0
- package/lib/transaction.d.ts +39 -0
- package/lib/transaction.js +137 -0
- package/lib/transaction.js.map +1 -0
- package/lib/transient-error-lookup.d.ts +3 -0
- package/lib/transient-error-lookup.js +19 -0
- package/lib/transient-error-lookup.js.map +1 -0
- package/lib/value-parser.d.ts +7 -0
- package/lib/value-parser.js +813 -0
- package/lib/value-parser.js.map +1 -0
- package/package.json +145 -0
- package/pull_request_template.md +9 -0
- package/tsconfig.build-types.json +15 -0
- package/tsconfig.json +30 -0
- package/types/js-md4.d.ts +7 -0
- package/types/native-duplexpair.d.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","names":["_crypto","_interopRequireDefault","require","_os","tls","_interopRequireWildcard","net","_dns","_constants","_stream","_identity","_coreAuth","_bulkLoad","_debug","_events","_instanceLookup","_transientErrorLookup","_packet","_preloginPayload","_login7Payload","_ntlmPayload","_request","_rpcrequestPayload","_sqlbatchPayload","_messageIo","_tokenStreamParser","_transaction","_errors","_connector","_library","_tdsVersions","_message","_ntlm","_dataType","_bulkLoadPayload","_specialStoredProcedure","_package","_url","_handler","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KEEP_ALIVE_INITIAL_DELAY","DEFAULT_CONNECT_TIMEOUT","DEFAULT_CLIENT_REQUEST_TIMEOUT","DEFAULT_CANCEL_TIMEOUT","DEFAULT_CONNECT_RETRY_INTERVAL","DEFAULT_PACKET_SIZE","DEFAULT_TEXTSIZE","DEFAULT_DATEFIRST","DEFAULT_PORT","DEFAULT_TDS_VERSION","DEFAULT_LANGUAGE","DEFAULT_DATEFORMAT","withResolvers","resolve","reject","promise","Promise","res","rej","Connection","EventEmitter","constructor","config","TypeError","server","fedAuthRequired","authentication","undefined","type","options","domain","userName","password","toUpperCase","isTokenCredential","credential","clientId","tenantId","token","clientSecret","abortTransactionOnError","appName","camelCaseColumns","cancelTimeout","columnEncryptionKeyCacheTTL","columnEncryptionSetting","columnNameReplacer","connectionRetryInterval","connectTimeout","connector","connectionIsolationLevel","ISOLATION_LEVEL","READ_COMMITTED","cryptoCredentialsDetails","database","datefirst","dateFormat","debug","data","packet","payload","enableAnsiNull","enableAnsiNullDefault","enableAnsiPadding","enableAnsiWarnings","enableArithAbort","enableConcatNullYieldsNull","enableCursorCloseOnCommit","enableImplicitTransactions","enableNumericRoundabort","enableQuotedIdentifier","encrypt","fallbackToDefaultDb","encryptionKeyStoreProviders","instanceName","isolationLevel","language","localAddress","maxRetriesOnTransientErrors","multiSubnetFailover","packetSize","port","readOnlyIntent","requestTimeout","rowCollectionOnDone","rowCollectionOnRequestCompletion","serverName","serverSupportsColumnEncryption","tdsVersion","textsize","trustedServerNameAE","trustServerCertificate","useColumnNames","useUTC","workstationId","lowerCaseGuids","Error","assertValidIsolationLevel","RangeError","secureContextOptions","secureOptions","create","value","constants","SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS","createDebug","inTransaction","transactionDescriptors","Buffer","from","transactionDepth","isSqlBatch","closed","messageBuffer","alloc","curTransientRetryCount","transientErrorLookup","TransientErrorLookup","state","STATE","INITIALIZED","_cancelAfterRequestSent","messageIo","sendMessage","TYPE","ATTENTION","createCancelTimer","_onSocketClose","socketClose","_onSocketEnd","socketEnd","_onSocketError","error","dispatchEvent","process","nextTick","emit","wrapSocketError","connect","connectListener","ConnectionError","name","onConnect","err","removeListener","onError","once","transitionTo","CONNECTING","initialiseConnection","then","FINAL","on","event","listener","args","close","cleanupConnection","timeoutController","AbortController","connectTimer","setTimeout","hostPostfix","routingData","routingMessage","message","log","abort","signal","instanceLookup","timeout","throwIfAborted","cause","socket","connectOnPort","controller","onClose","onEnd","code","AbortSignal","any","setKeepAlive","MessageIO","cleartext","sendPreLogin","SENT_PRELOGIN","preloginResponse","readPreloginResponse","performTlsNegotiation","sendLogin7Packet","SENT_LOGIN7_WITH_FEDAUTH","performSentLogin7WithFedAuth","SENT_LOGIN7_WITH_NTLM","performSentLogin7WithNTLMLogin","SENT_LOGIN7_WITH_STANDARD_LOGIN","performSentLogin7WithStandardLogin","isTransientError","TRANSIENT_FAILURE_RETRY","performTransientFailureRetry","REROUTING","performReRouting","LOGGED_IN_SENDING_INITIAL_SQL","performLoggedInSendingInitialSql","destroy","LOGGED_IN","clearTimeout","clearRequestTimer","closeConnection","request","RequestError","callback","Debug","createTokenStreamParser","handler","TokenStreamParser","wrapWithTls","secureContext","createSecureContext","isIP","encryptOptions","host","ALPNProtocols","servername","encryptsocket","onAbort","reason","addEventListener","removeEventListener","customConnector","connectOpts","connectInParallel","connectInSequence","dns","lookup","end","clearCancelTimer","cancelTimer","createRequestTimer","requestTimer","cancel","newState","exit","enter","apply","getEventHandler","eventName","events","SENT_TLSSSLNEGOTIATION","major","minor","build","exec","version","PreloginPayload","Number","subbuild","PRELOGIN","toString","Login7Payload","versions","clientProgVer","clientPid","pid","connectionId","clientTimeZone","Date","getTimezoneOffset","clientLcid","fedAuth","echo","workflow","fedAuthToken","sspi","createNTLMRequest","hostname","os","instance","libraryName","initDbFatal","LOGIN7","toBuffer","sendFedAuthTokenMessage","accessTokenLen","byteLength","offset","writeUInt32LE","write","FEDAUTH_TOKEN","sendInitialSql","SqlBatchPayload","getInitialSql","currentTransactionDescriptor","Message","SQL_BATCH","outgoingMessageStream","Readable","pipe","push","getIsolationLevelText","join","execSqlBatch","makeRequest","sqlTextOrProcedure","execSql","validateParameters","databaseCollation","parameters","TYPES","NVarChar","output","length","precision","scale","makeParamsParameter","RPC_REQUEST","RpcRequestPayload","Procedures","Sp_ExecuteSql","newBulkLoad","table","callbackOrOptions","BulkLoad","execBulkLoad","bulkLoad","rows","executionStarted","streamingMode","firstRowWritten","rowStream","rowToPacketTransform","onCancel","BulkLoadPayload","Request","getBulkInsertSql","BULK_LOAD","prepare","Int","preparing","handle","Sp_Prepare","unprepare","Sp_Unprepare","execute","executeParameters","len","parameter","validate","Sp_Execute","callProcedure","beginTransaction","transaction","Transaction","isolationLevelToTSQL","TRANSACTION_MANAGER","beginPayload","commitTransaction","commitPayload","rollbackTransaction","rollbackPayload","saveTransaction","savePayload","cb","useSavepoint","crypto","randomBytes","txDone","done","txErr","packetType","canceled","connection","rowCount","rst","payloadStream","unpipe","ignore","paused","resume","resetConnection","resetConnectionOnNextRequest","SENT_CLIENT_REQUEST","reset","READ_UNCOMMITTED","REPEATABLE_READ","SERIALIZABLE","SNAPSHOT","preloginPayload","signalAborted","encryptionString","race","startTls","catch","readMessage","iterator","Symbol","asyncIterator","next","concat","return","Login7TokenHandler","tokenStreamParser","loginAckReceived","loginError","ntlmpacket","NTLMResponsePayload","NTLMAUTH_PKT","fedAuthInfoToken","stsurl","spn","tokenScope","URL","credentials","UsernamePasswordCredential","msiArgs","ManagedIdentityCredential","managedIdentityClientId","DefaultAzureCredential","ClientSecretCredential","tokenResponse","getToken","AggregateError","InitialSqlTokenHandler","errors","isTransient","_default","exports","module","prototype","socketError","RequestTokenHandler","SENT_ATTENTION","onResume","onPause","pause","onEndOfMessage","sqlRequest","nextState","AttentionTokenHandler","attentionReceived"],"sources":["../src/connection.ts"],"sourcesContent":["import crypto from 'crypto';\nimport os from 'os';\nimport * as tls from 'tls';\nimport * as net from 'net';\nimport dns from 'dns';\n\nimport constants from 'constants';\nimport { type SecureContextOptions } from 'tls';\n\nimport { Readable } from 'stream';\n\nimport {\n ClientSecretCredential,\n DefaultAzureCredential,\n ManagedIdentityCredential,\n UsernamePasswordCredential\n} from '@azure/identity';\nimport { type AccessToken, type TokenCredential, isTokenCredential } from '@azure/core-auth';\n\nimport BulkLoad, { type Options as BulkLoadOptions, type Callback as BulkLoadCallback } from './bulk-load';\nimport Debug from './debug';\nimport { EventEmitter, once } from 'events';\nimport { instanceLookup } from './instance-lookup';\nimport { TransientErrorLookup } from './transient-error-lookup';\nimport { TYPE } from './packet';\nimport PreloginPayload from './prelogin-payload';\nimport Login7Payload from './login7-payload';\nimport NTLMResponsePayload from './ntlm-payload';\nimport Request from './request';\nimport RpcRequestPayload from './rpcrequest-payload';\nimport SqlBatchPayload from './sqlbatch-payload';\nimport MessageIO from './message-io';\nimport { Parser as TokenStreamParser } from './token/token-stream-parser';\nimport { Transaction, ISOLATION_LEVEL, assertValidIsolationLevel } from './transaction';\nimport { ConnectionError, RequestError } from './errors';\nimport { connectInParallel, connectInSequence } from './connector';\nimport { name as libraryName } from './library';\nimport { versions } from './tds-versions';\nimport Message from './message';\nimport { type Metadata } from './metadata-parser';\nimport { createNTLMRequest } from './ntlm';\nimport { ColumnEncryptionAzureKeyVaultProvider } from './always-encrypted/keystore-provider-azure-key-vault';\n\nimport { type Parameter, TYPES } from './data-type';\nimport { BulkLoadPayload } from './bulk-load-payload';\nimport { Collation } from './collation';\nimport Procedures from './special-stored-procedure';\n\nimport { version } from '../package.json';\nimport { URL } from 'url';\nimport { AttentionTokenHandler, InitialSqlTokenHandler, Login7TokenHandler, RequestTokenHandler, TokenHandler } from './token/handler';\n\ntype BeginTransactionCallback =\n /**\n * The callback is called when the request to start the transaction has completed,\n * either successfully or with an error.\n * If an error occurred then `err` will describe the error.\n *\n * As only one request at a time may be executed on a connection, another request should not\n * be initiated until this callback is called.\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n * @param transactionDescriptor A Buffer that describe the transaction\n */\n (err: Error | null | undefined, transactionDescriptor?: Buffer) => void\n\ntype SaveTransactionCallback =\n /**\n * The callback is called when the request to set a savepoint within the\n * transaction has completed, either successfully or with an error.\n * If an error occurred then `err` will describe the error.\n *\n * As only one request at a time may be executed on a connection, another request should not\n * be initiated until this callback is called.\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n */\n (err: Error | null | undefined) => void;\n\ntype CommitTransactionCallback =\n /**\n * The callback is called when the request to commit the transaction has completed,\n * either successfully or with an error.\n * If an error occurred then `err` will describe the error.\n *\n * As only one request at a time may be executed on a connection, another request should not\n * be initiated until this callback is called.\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n */\n (err: Error | null | undefined) => void;\n\ntype RollbackTransactionCallback =\n /**\n * The callback is called when the request to rollback the transaction has\n * completed, either successfully or with an error.\n * If an error occurred then err will describe the error.\n *\n * As only one request at a time may be executed on a connection, another request should not\n * be initiated until this callback is called.\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n */\n (err: Error | null | undefined) => void;\n\ntype ResetCallback =\n /**\n * The callback is called when the connection reset has completed,\n * either successfully or with an error.\n *\n * If an error occurred then `err` will describe the error.\n *\n * As only one request at a time may be executed on a connection, another\n * request should not be initiated until this callback is called\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n */\n (err: Error | null | undefined) => void;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype TransactionCallback<T extends (err: Error | null | undefined, ...args: any[]) => void> =\n /**\n * The callback is called when the request to start a transaction (or create a savepoint, in\n * the case of a nested transaction) has completed, either successfully or with an error.\n * If an error occurred, then `err` will describe the error.\n * If no error occurred, the callback should perform its work and eventually call\n * `done` with an error or null (to trigger a transaction rollback or a\n * transaction commit) and an additional completion callback that will be called when the request\n * to rollback or commit the current transaction has completed, either successfully or with an error.\n * Additional arguments given to `done` will be passed through to this callback.\n *\n * As only one request at a time may be executed on a connection, another request should not\n * be initiated until the completion callback is called.\n *\n * @param err If an error occurred, an [[Error]] object with details of the error.\n * @param txDone If no error occurred, a function to be called to commit or rollback the transaction.\n */\n (err: Error | null | undefined, txDone?: TransactionDone<T>) => void;\n\ntype TransactionDoneCallback = (err: Error | null | undefined, ...args: any[]) => void;\ntype CallbackParameters<T extends (err: Error | null | undefined, ...args: any[]) => any> = T extends (err: Error | null | undefined, ...args: infer P) => any ? P : never;\n\ntype TransactionDone<T extends (err: Error | null | undefined, ...args: any[]) => void> =\n /**\n * If no error occurred, a function to be called to commit or rollback the transaction.\n *\n * @param err If an err occurred, a string with details of the error.\n */\n (err: Error | null | undefined, done: T, ...args: CallbackParameters<T>) => void;\n\n/**\n * @private\n */\nconst KEEP_ALIVE_INITIAL_DELAY = 30 * 1000;\n/**\n * @private\n */\nconst DEFAULT_CONNECT_TIMEOUT = 15 * 1000;\n/**\n * @private\n */\nconst DEFAULT_CLIENT_REQUEST_TIMEOUT = 15 * 1000;\n/**\n * @private\n */\nconst DEFAULT_CANCEL_TIMEOUT = 5 * 1000;\n/**\n * @private\n */\nconst DEFAULT_CONNECT_RETRY_INTERVAL = 500;\n/**\n * @private\n */\nconst DEFAULT_PACKET_SIZE = 4 * 1024;\n/**\n * @private\n */\nconst DEFAULT_TEXTSIZE = 2147483647;\n/**\n * @private\n */\nconst DEFAULT_DATEFIRST = 7;\n/**\n * @private\n */\nconst DEFAULT_PORT = 1433;\n/**\n * @private\n */\nconst DEFAULT_TDS_VERSION = '7_4';\n/**\n * @private\n */\nconst DEFAULT_LANGUAGE = 'us_english';\n/**\n * @private\n */\nconst DEFAULT_DATEFORMAT = 'mdy';\n\ninterface AzureActiveDirectoryMsiAppServiceAuthentication {\n type: 'azure-active-directory-msi-app-service';\n options: {\n /**\n * If you user want to connect to an Azure app service using a specific client account\n * they need to provide `clientId` associate to their created identity.\n *\n * This is optional for retrieve token from azure web app service\n */\n clientId?: string;\n };\n}\n\ninterface AzureActiveDirectoryMsiVmAuthentication {\n type: 'azure-active-directory-msi-vm';\n options: {\n /**\n * If you want to connect using a specific client account\n * they need to provide `clientId` associated to their created identity.\n *\n * This is optional for retrieve a token\n */\n clientId?: string;\n };\n}\n\ninterface AzureActiveDirectoryDefaultAuthentication {\n type: 'azure-active-directory-default';\n options: {\n /**\n * If you want to connect using a specific client account\n * they need to provide `clientId` associated to their created identity.\n *\n * This is optional for retrieving a token\n */\n clientId?: string;\n };\n}\n\n\ninterface AzureActiveDirectoryAccessTokenAuthentication {\n type: 'azure-active-directory-access-token';\n options: {\n /**\n * A user need to provide `token` which they retrieved else where\n * to forming the connection.\n */\n token: string;\n };\n}\n\ninterface AzureActiveDirectoryPasswordAuthentication {\n type: 'azure-active-directory-password';\n options: {\n /**\n * A user need to provide `userName` associate to their account.\n */\n userName: string;\n\n /**\n * A user need to provide `password` associate to their account.\n */\n password: string;\n\n /**\n * A client id to use.\n */\n clientId: string;\n\n /**\n * Optional parameter for specific Azure tenant ID\n */\n tenantId: string;\n };\n}\n\ninterface AzureActiveDirectoryServicePrincipalSecret {\n type: 'azure-active-directory-service-principal-secret';\n options: {\n /**\n * Application (`client`) ID from your registered Azure application\n */\n clientId: string;\n /**\n * The created `client secret` for this registered Azure application\n */\n clientSecret: string;\n /**\n * Directory (`tenant`) ID from your registered Azure application\n */\n tenantId: string;\n };\n}\n\n/** Structure that defines the options that are necessary to authenticate the Tedious.JS instance with an `@azure/identity` token credential. */\ninterface TokenCredentialAuthentication {\n /** Unique designator for the type of authentication to be used. */\n type: 'token-credential';\n /** Set of configurations that are required or allowed with this authentication type. */\n options: {\n /** Credential object used to authenticate to the resource. */\n credential: TokenCredential;\n };\n}\n\ninterface NtlmAuthentication {\n type: 'ntlm';\n options: {\n /**\n * User name from your windows account.\n */\n userName: string;\n /**\n * Password from your windows account.\n */\n password: string;\n /**\n * Once you set domain for ntlm authentication type, driver will connect to SQL Server using domain login.\n *\n * This is necessary for forming a connection using ntlm type\n */\n domain: string;\n };\n}\n\ninterface DefaultAuthentication {\n type: 'default';\n options: {\n /**\n * User name to use for sql server login.\n */\n userName?: string | undefined;\n /**\n * Password to use for sql server login.\n */\n password?: string | undefined;\n };\n}\n\ninterface ErrorWithCode extends Error {\n code?: string;\n}\n\nexport type ConnectionAuthentication = DefaultAuthentication | NtlmAuthentication | TokenCredentialAuthentication | AzureActiveDirectoryPasswordAuthentication | AzureActiveDirectoryMsiAppServiceAuthentication | AzureActiveDirectoryMsiVmAuthentication | AzureActiveDirectoryAccessTokenAuthentication | AzureActiveDirectoryServicePrincipalSecret | AzureActiveDirectoryDefaultAuthentication;\n\ninterface InternalConnectionConfig {\n server: string;\n authentication: ConnectionAuthentication;\n options: InternalConnectionOptions;\n}\n\nexport interface InternalConnectionOptions {\n abortTransactionOnError: boolean;\n appName: undefined | string;\n camelCaseColumns: boolean;\n cancelTimeout: number;\n columnEncryptionKeyCacheTTL: number;\n columnEncryptionSetting: boolean;\n columnNameReplacer: undefined | ((colName: string, index: number, metadata: Metadata) => string);\n connectionRetryInterval: number;\n connector: undefined | (() => Promise<net.Socket>);\n connectTimeout: number;\n connectionIsolationLevel: typeof ISOLATION_LEVEL[keyof typeof ISOLATION_LEVEL];\n cryptoCredentialsDetails: SecureContextOptions;\n database: undefined | string;\n datefirst: number;\n dateFormat: string;\n debug: {\n data: boolean;\n packet: boolean;\n payload: boolean;\n token: boolean;\n };\n enableAnsiNull: null | boolean;\n enableAnsiNullDefault: null | boolean;\n enableAnsiPadding: null | boolean;\n enableAnsiWarnings: null | boolean;\n enableArithAbort: null | boolean;\n enableConcatNullYieldsNull: null | boolean;\n enableCursorCloseOnCommit: null | boolean;\n enableImplicitTransactions: null | boolean;\n enableNumericRoundabort: null | boolean;\n enableQuotedIdentifier: null | boolean;\n encrypt: string | boolean;\n encryptionKeyStoreProviders: KeyStoreProviderMap | undefined;\n fallbackToDefaultDb: boolean;\n instanceName: undefined | string;\n isolationLevel: typeof ISOLATION_LEVEL[keyof typeof ISOLATION_LEVEL];\n language: string;\n localAddress: undefined | string;\n maxRetriesOnTransientErrors: number;\n multiSubnetFailover: boolean;\n packetSize: number;\n port: undefined | number;\n readOnlyIntent: boolean;\n requestTimeout: number;\n rowCollectionOnDone: boolean;\n rowCollectionOnRequestCompletion: boolean;\n serverName: undefined | string;\n serverSupportsColumnEncryption: boolean;\n tdsVersion: string;\n textsize: number;\n trustedServerNameAE: string | undefined;\n trustServerCertificate: boolean;\n useColumnNames: boolean;\n useUTC: boolean;\n workstationId: undefined | string;\n lowerCaseGuids: boolean;\n}\n\ninterface KeyStoreProviderMap {\n [key: string]: ColumnEncryptionAzureKeyVaultProvider;\n}\n\n/**\n * @private\n */\ninterface State {\n name: string;\n enter?(this: Connection): void;\n exit?(this: Connection, newState: State): void;\n events: {\n socketError?(this: Connection, err: Error): void;\n message?(this: Connection, message: Message): void;\n };\n}\n\ntype Authentication = DefaultAuthentication |\n NtlmAuthentication |\n TokenCredentialAuthentication |\n AzureActiveDirectoryPasswordAuthentication |\n AzureActiveDirectoryMsiAppServiceAuthentication |\n AzureActiveDirectoryMsiVmAuthentication |\n AzureActiveDirectoryAccessTokenAuthentication |\n AzureActiveDirectoryServicePrincipalSecret |\n AzureActiveDirectoryDefaultAuthentication;\n\ntype AuthenticationType = Authentication['type'];\n\nexport interface ConnectionConfiguration {\n /**\n * Hostname to connect to.\n */\n server: string;\n /**\n * Configuration options for forming the connection.\n */\n options?: ConnectionOptions;\n /**\n * Authentication related options for connection.\n */\n authentication?: AuthenticationOptions;\n}\n\ninterface DebugOptions {\n /**\n * A boolean, controlling whether [[debug]] events will be emitted with text describing packet data details\n *\n * (default: `false`)\n */\n data: boolean;\n /**\n * A boolean, controlling whether [[debug]] events will be emitted with text describing packet details\n *\n * (default: `false`)\n */\n packet: boolean;\n /**\n * A boolean, controlling whether [[debug]] events will be emitted with text describing packet payload details\n *\n * (default: `false`)\n */\n payload: boolean;\n /**\n * A boolean, controlling whether [[debug]] events will be emitted with text describing token stream tokens\n *\n * (default: `false`)\n */\n token: boolean;\n}\n\ninterface AuthenticationOptions {\n /**\n * Type of the authentication method, valid types are `default`, `ntlm`,\n * `azure-active-directory-password`, `azure-active-directory-access-token`,\n * `azure-active-directory-msi-vm`, `azure-active-directory-msi-app-service`,\n * `azure-active-directory-default`\n * or `azure-active-directory-service-principal-secret`\n */\n type?: AuthenticationType;\n /**\n * Different options for authentication types:\n *\n * * `default`: [[DefaultAuthentication.options]]\n * * `ntlm` :[[NtlmAuthentication]]\n * * `token-credential`: [[CredentialChainAuthentication.options]]\n * * `azure-active-directory-password` : [[AzureActiveDirectoryPasswordAuthentication.options]]\n * * `azure-active-directory-access-token` : [[AzureActiveDirectoryAccessTokenAuthentication.options]]\n * * `azure-active-directory-msi-vm` : [[AzureActiveDirectoryMsiVmAuthentication.options]]\n * * `azure-active-directory-msi-app-service` : [[AzureActiveDirectoryMsiAppServiceAuthentication.options]]\n * * `azure-active-directory-service-principal-secret` : [[AzureActiveDirectoryServicePrincipalSecret.options]]\n * * `azure-active-directory-default` : [[AzureActiveDirectoryDefaultAuthentication.options]]\n */\n options?: any;\n}\n\nexport interface ConnectionOptions {\n /**\n * A boolean determining whether to rollback a transaction automatically if any error is encountered\n * during the given transaction's execution. This sets the value for `SET XACT_ABORT` during the\n * initial SQL phase of a connection [documentation](https://docs.microsoft.com/en-us/sql/t-sql/statements/set-xact-abort-transact-sql).\n */\n abortTransactionOnError?: boolean | undefined;\n\n /**\n * Application name used for identifying a specific application in profiling, logging or tracing tools of SQLServer.\n *\n * (default: `Tedious`)\n */\n appName?: string | undefined;\n\n /**\n * A boolean, controlling whether the column names returned will have the first letter converted to lower case\n * (`true`) or not. This value is ignored if you provide a [[columnNameReplacer]].\n *\n * (default: `false`).\n */\n camelCaseColumns?: boolean;\n\n /**\n * The number of milliseconds before the [[Request.cancel]] (abort) of a request is considered failed\n *\n * (default: `5000`).\n */\n cancelTimeout?: number;\n\n /**\n * A function with parameters `(columnName, index, columnMetaData)` and returning a string. If provided,\n * this will be called once per column per result-set. The returned value will be used instead of the SQL-provided\n * column name on row and meta data objects. This allows you to dynamically convert between naming conventions.\n *\n * (default: `null`)\n */\n columnNameReplacer?: (colName: string, index: number, metadata: Metadata) => string;\n\n /**\n * Number of milliseconds before retrying to establish connection, in case of transient failure.\n *\n * (default:`500`)\n */\n connectionRetryInterval?: number;\n\n /**\n * Custom connector factory method.\n *\n * (default: `undefined`)\n */\n connector?: () => Promise<net.Socket>;\n\n /**\n * The number of milliseconds before the attempt to connect is considered failed\n *\n * (default: `15000`).\n */\n connectTimeout?: number;\n\n /**\n * The default isolation level for new connections. All out-of-transaction queries are executed with this setting.\n *\n * The isolation levels are available from `require('tedious').ISOLATION_LEVEL`.\n * * `READ_UNCOMMITTED`\n * * `READ_COMMITTED`\n * * `REPEATABLE_READ`\n * * `SERIALIZABLE`\n * * `SNAPSHOT`\n *\n * (default: `READ_COMMITED`).\n */\n connectionIsolationLevel?: number;\n\n /**\n * When encryption is used, an object may be supplied that will be used\n * for the first argument when calling [`tls.createSecurePair`](http://nodejs.org/docs/latest/api/tls.html#tls_tls_createsecurepair_credentials_isserver_requestcert_rejectunauthorized)\n *\n * (default: `{}`)\n */\n cryptoCredentialsDetails?: SecureContextOptions;\n\n /**\n * Database to connect to (default: dependent on server configuration).\n */\n database?: string | undefined;\n\n /**\n * Sets the first day of the week to a number from 1 through 7.\n */\n datefirst?: number;\n\n /**\n * A string representing position of month, day and year in temporal datatypes.\n *\n * (default: `mdy`)\n */\n dateFormat?: string;\n\n debug?: DebugOptions;\n\n /**\n * A boolean, controls the way null values should be used during comparison operation.\n *\n * (default: `true`)\n */\n enableAnsiNull?: boolean;\n\n /**\n * If true, `SET ANSI_NULL_DFLT_ON ON` will be set in the initial sql. This means new columns will be\n * nullable by default. See the [T-SQL documentation](https://msdn.microsoft.com/en-us/library/ms187375.aspx)\n *\n * (default: `true`).\n */\n enableAnsiNullDefault?: boolean;\n\n /**\n * A boolean, controls if padding should be applied for values shorter than the size of defined column.\n *\n * (default: `true`)\n */\n enableAnsiPadding?: boolean;\n\n /**\n * If true, SQL Server will follow ISO standard behavior during various error conditions. For details,\n * see [documentation](https://docs.microsoft.com/en-us/sql/t-sql/statements/set-ansi-warnings-transact-sql)\n *\n * (default: `true`)\n */\n enableAnsiWarnings?: boolean;\n\n /**\n * Ends a query when an overflow or divide-by-zero error occurs during query execution.\n * See [documentation](https://docs.microsoft.com/en-us/sql/t-sql/statements/set-arithabort-transact-sql?view=sql-server-2017)\n * for more details.\n *\n * (default: `true`)\n */\n enableArithAbort?: boolean;\n\n /**\n * A boolean, determines if concatenation with NULL should result in NULL or empty string value, more details in\n * [documentation](https://docs.microsoft.com/en-us/sql/t-sql/statements/set-concat-null-yields-null-transact-sql)\n *\n * (default: `true`)\n */\n enableConcatNullYieldsNull?: boolean;\n\n /**\n * A boolean, controls whether cursor should be closed, if the transaction opening it gets committed or rolled\n * back.\n *\n * (default: `null`)\n */\n enableCursorCloseOnCommit?: boolean | null;\n\n /**\n * A boolean, sets the connection to either implicit or autocommit transaction mode.\n *\n * (default: `false`)\n */\n enableImplicitTransactions?: boolean;\n\n /**\n * If false, error is not generated during loss of precession.\n *\n * (default: `false`)\n */\n enableNumericRoundabort?: boolean;\n\n /**\n * If true, characters enclosed in single quotes are treated as literals and those enclosed double quotes are treated as identifiers.\n *\n * (default: `true`)\n */\n enableQuotedIdentifier?: boolean;\n\n /**\n * A string value that can be only set to 'strict', which indicates the usage TDS 8.0 protocol. Otherwise,\n * a boolean determining whether or not the connection will be encrypted.\n *\n * (default: `true`)\n */\n encrypt?: string | boolean;\n\n /**\n * By default, if the database requested by [[database]] cannot be accessed,\n * the connection will fail with an error. However, if [[fallbackToDefaultDb]] is\n * set to `true`, then the user's default database will be used instead\n *\n * (default: `false`)\n */\n fallbackToDefaultDb?: boolean;\n\n /**\n * The instance name to connect to.\n * The SQL Server Browser service must be running on the database server,\n * and UDP port 1434 on the database server must be reachable.\n *\n * (no default)\n *\n * Mutually exclusive with [[port]].\n */\n instanceName?: string | undefined;\n\n /**\n * The default isolation level that transactions will be run with.\n *\n * The isolation levels are available from `require('tedious').ISOLATION_LEVEL`.\n * * `READ_UNCOMMITTED`\n * * `READ_COMMITTED`\n * * `REPEATABLE_READ`\n * * `SERIALIZABLE`\n * * `SNAPSHOT`\n *\n * (default: `READ_COMMITED`).\n */\n isolationLevel?: number;\n\n /**\n * Specifies the language environment for the session. The session language determines the datetime formats and system messages.\n *\n * (default: `us_english`).\n */\n language?: string;\n\n /**\n * A string indicating which network interface (ip address) to use when connecting to SQL Server.\n */\n localAddress?: string | undefined;\n\n /**\n * A boolean determining whether to parse unique identifier type with lowercase case characters.\n *\n * (default: `false`).\n */\n lowerCaseGuids?: boolean;\n\n /**\n * The maximum number of connection retries for transient errors.、\n *\n * (default: `3`).\n */\n maxRetriesOnTransientErrors?: number;\n\n /**\n * Sets the MultiSubnetFailover = True parameter, which can help minimize the client recovery latency when failovers occur.\n *\n * (default: `false`).\n */\n multiSubnetFailover?: boolean;\n\n /**\n * The size of TDS packets (subject to negotiation with the server).\n * Should be a power of 2.\n *\n * (default: `4096`).\n */\n packetSize?: number;\n\n /**\n * Port to connect to (default: `1433`).\n *\n * Mutually exclusive with [[instanceName]]\n */\n port?: number | undefined;\n\n /**\n * A boolean, determining whether the connection will request read only access from a SQL Server Availability\n * Group. For more information, see [here](http://msdn.microsoft.com/en-us/library/hh710054.aspx \"Microsoft: Configure Read-Only Routing for an Availability Group (SQL Server)\")\n *\n * (default: `false`).\n */\n readOnlyIntent?: boolean;\n\n /**\n * The number of milliseconds before a request is considered failed, or `0` for no timeout.\n *\n * As soon as a response is received, the timeout is cleared. This means that queries that immediately return a response have ability to run longer than this timeout.\n *\n * (default: `15000`).\n */\n requestTimeout?: number;\n\n /**\n * A boolean, that when true will expose received rows in Requests done related events:\n * * [[Request.Event_doneInProc]]\n * * [[Request.Event_doneProc]]\n * * [[Request.Event_done]]\n *\n * (default: `false`)\n *\n * Caution: If many row are received, enabling this option could result in\n * excessive memory usage.\n */\n rowCollectionOnDone?: boolean;\n\n /**\n * A boolean, that when true will expose received rows in Requests' completion callback.See [[Request.constructor]].\n *\n * (default: `false`)\n *\n * Caution: If many row are received, enabling this option could result in\n * excessive memory usage.\n */\n rowCollectionOnRequestCompletion?: boolean;\n\n /**\n * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.\n *\n * The versions are available from `require('tedious').TDS_VERSION`.\n * * `7_1`\n * * `7_2`\n * * `7_3_A`\n * * `7_3_B`\n * * `7_4`\n *\n * (default: `7_4`)\n */\n tdsVersion?: string | undefined;\n\n /**\n * Specifies the size of varchar(max), nvarchar(max), varbinary(max), text, ntext, and image data returned by a SELECT statement.\n *\n * (default: `2147483647`)\n */\n textsize?: number;\n\n /**\n * If \"true\", the SQL Server SSL certificate is automatically trusted when the communication layer is encrypted using SSL.\n *\n * If \"false\", the SQL Server validates the server SSL certificate. If the server certificate validation fails,\n * the driver raises an error and terminates the connection. Make sure the value passed to serverName exactly\n * matches the Common Name (CN) or DNS name in the Subject Alternate Name in the server certificate for an SSL connection to succeed.\n *\n * (default: `true`)\n */\n trustServerCertificate?: boolean;\n\n /**\n *\n */\n serverName?: string;\n /**\n * A boolean determining whether to return rows as arrays or key-value collections.\n *\n * (default: `false`).\n */\n useColumnNames?: boolean;\n\n /**\n * A boolean determining whether to pass time values in UTC or local time.\n *\n * (default: `true`).\n */\n useUTC?: boolean;\n\n /**\n * The workstation ID (WSID) of the client, default os.hostname().\n * Used for identifying a specific client in profiling, logging or\n * tracing client activity in SQLServer.\n *\n * The value is reported by the TSQL function HOST_NAME().\n */\n workstationId?: string | undefined;\n}\n\ninterface RoutingData {\n server: string;\n port: number;\n instance: string;\n}\n\n/**\n * Helper function, equivalent to `Promise.withResolvers()`.\n *\n * @returns An object with the properties `promise`, `resolve`, and `reject`.\n */\nfunction withResolvers<T>() {\n let resolve: (value: T | PromiseLike<T>) => void;\n let reject: (reason?: any) => void;\n\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { promise, resolve: resolve!, reject: reject! };\n}\n\n/**\n * A [[Connection]] instance represents a single connection to a database server.\n *\n * ```js\n * var Connection = require('tedious').Connection;\n * var config = {\n * \"authentication\": {\n * ...,\n * \"options\": {...}\n * },\n * \"options\": {...}\n * };\n * var connection = new Connection(config);\n * ```\n *\n * Only one request at a time may be executed on a connection. Once a [[Request]]\n * has been initiated (with [[Connection.callProcedure]], [[Connection.execSql]],\n * or [[Connection.execSqlBatch]]), another should not be initiated until the\n * [[Request]]'s completion callback is called.\n */\nclass Connection extends EventEmitter {\n /**\n * @private\n */\n declare fedAuthRequired: boolean;\n /**\n * @private\n */\n declare config: InternalConnectionConfig;\n /**\n * @private\n */\n declare secureContextOptions: SecureContextOptions;\n /**\n * @private\n */\n declare inTransaction: boolean;\n /**\n * @private\n */\n declare transactionDescriptors: Buffer[];\n /**\n * @private\n */\n declare transactionDepth: number;\n /**\n * @private\n */\n declare isSqlBatch: boolean;\n /**\n * @private\n */\n declare curTransientRetryCount: number;\n /**\n * @private\n */\n declare transientErrorLookup: TransientErrorLookup;\n /**\n * @private\n */\n declare closed: boolean;\n /**\n * @private\n */\n declare loginError: undefined | AggregateError | ConnectionError;\n /**\n * @private\n */\n declare debug: Debug;\n /**\n * @private\n */\n declare ntlmpacket: undefined | any;\n /**\n * @private\n */\n declare ntlmpacketBuffer: undefined | Buffer;\n\n /**\n * @private\n */\n declare STATE: {\n INITIALIZED: State;\n CONNECTING: State;\n SENT_PRELOGIN: State;\n REROUTING: State;\n TRANSIENT_FAILURE_RETRY: State;\n SENT_TLSSSLNEGOTIATION: State;\n SENT_LOGIN7_WITH_STANDARD_LOGIN: State;\n SENT_LOGIN7_WITH_NTLM: State;\n SENT_LOGIN7_WITH_FEDAUTH: State;\n LOGGED_IN_SENDING_INITIAL_SQL: State;\n LOGGED_IN: State;\n SENT_CLIENT_REQUEST: State;\n SENT_ATTENTION: State;\n FINAL: State;\n };\n\n /**\n * @private\n */\n declare routingData: undefined | RoutingData;\n\n /**\n * @private\n */\n declare messageIo: MessageIO;\n /**\n * @private\n */\n declare state: State;\n /**\n * @private\n */\n declare resetConnectionOnNextRequest: undefined | boolean;\n\n /**\n * @private\n */\n declare request: undefined | Request | BulkLoad;\n /**\n * @private\n */\n declare procReturnStatusValue: undefined | any;\n /**\n * @private\n */\n declare socket: undefined | net.Socket;\n /**\n * @private\n */\n declare messageBuffer: Buffer;\n\n /**\n * @private\n */\n declare cancelTimer: undefined | NodeJS.Timeout;\n /**\n * @private\n */\n declare requestTimer: undefined | NodeJS.Timeout;\n\n /**\n * @private\n */\n declare _cancelAfterRequestSent: () => void;\n\n /**\n * @private\n */\n declare databaseCollation: Collation | undefined;\n\n /**\n * @private\n */\n declare _onSocketClose: (hadError: boolean) => void;\n\n /**\n * @private\n */\n declare _onSocketError: (err: Error) => void;\n\n /**\n * @private\n */\n declare _onSocketEnd: () => void;\n\n /**\n * Note: be aware of the different options field:\n * 1. config.authentication.options\n * 2. config.options\n *\n * ```js\n * const { Connection } = require('tedious');\n *\n * const config = {\n * \"authentication\": {\n * ...,\n * \"options\": {...}\n * },\n * \"options\": {...}\n * };\n *\n * const connection = new Connection(config);\n * ```\n *\n * @param config\n */\n constructor(config: ConnectionConfiguration) {\n super();\n\n if (typeof config !== 'object' || config === null) {\n throw new TypeError('The \"config\" argument is required and must be of type Object.');\n }\n\n if (typeof config.server !== 'string') {\n throw new TypeError('The \"config.server\" property is required and must be of type string.');\n }\n\n this.fedAuthRequired = false;\n\n let authentication: ConnectionAuthentication;\n if (config.authentication !== undefined) {\n if (typeof config.authentication !== 'object' || config.authentication === null) {\n throw new TypeError('The \"config.authentication\" property must be of type Object.');\n }\n\n const type = config.authentication.type;\n const options = config.authentication.options === undefined ? {} : config.authentication.options;\n\n if (typeof type !== 'string') {\n throw new TypeError('The \"config.authentication.type\" property must be of type string.');\n }\n\n if (type !== 'default' && type !== 'ntlm' && type !== 'token-credential' && type !== 'azure-active-directory-password' && type !== 'azure-active-directory-access-token' && type !== 'azure-active-directory-msi-vm' && type !== 'azure-active-directory-msi-app-service' && type !== 'azure-active-directory-service-principal-secret' && type !== 'azure-active-directory-default') {\n throw new TypeError('The \"type\" property must one of \"default\", \"ntlm\", \"token-credential\", \"azure-active-directory-password\", \"azure-active-directory-access-token\", \"azure-active-directory-default\", \"azure-active-directory-msi-vm\" or \"azure-active-directory-msi-app-service\" or \"azure-active-directory-service-principal-secret\".');\n }\n\n if (typeof options !== 'object' || options === null) {\n throw new TypeError('The \"config.authentication.options\" property must be of type object.');\n }\n\n if (type === 'ntlm') {\n if (typeof options.domain !== 'string') {\n throw new TypeError('The \"config.authentication.options.domain\" property must be of type string.');\n }\n\n if (options.userName !== undefined && typeof options.userName !== 'string') {\n throw new TypeError('The \"config.authentication.options.userName\" property must be of type string.');\n }\n\n if (options.password !== undefined && typeof options.password !== 'string') {\n throw new TypeError('The \"config.authentication.options.password\" property must be of type string.');\n }\n\n authentication = {\n type: 'ntlm',\n options: {\n userName: options.userName,\n password: options.password,\n domain: options.domain && options.domain.toUpperCase()\n }\n };\n } else if (type === 'token-credential') {\n if (!isTokenCredential(options.credential)) {\n throw new TypeError('The \"config.authentication.options.credential\" property must be an instance of the token credential class.');\n }\n\n authentication = {\n type: 'token-credential',\n options: {\n credential: options.credential\n }\n };\n } else if (type === 'azure-active-directory-password') {\n if (typeof options.clientId !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientId\" property must be of type string.');\n }\n\n if (options.userName !== undefined && typeof options.userName !== 'string') {\n throw new TypeError('The \"config.authentication.options.userName\" property must be of type string.');\n }\n\n if (options.password !== undefined && typeof options.password !== 'string') {\n throw new TypeError('The \"config.authentication.options.password\" property must be of type string.');\n }\n\n if (options.tenantId !== undefined && typeof options.tenantId !== 'string') {\n throw new TypeError('The \"config.authentication.options.tenantId\" property must be of type string.');\n }\n\n authentication = {\n type: 'azure-active-directory-password',\n options: {\n userName: options.userName,\n password: options.password,\n tenantId: options.tenantId,\n clientId: options.clientId\n }\n };\n } else if (type === 'azure-active-directory-access-token') {\n if (typeof options.token !== 'string') {\n throw new TypeError('The \"config.authentication.options.token\" property must be of type string.');\n }\n\n authentication = {\n type: 'azure-active-directory-access-token',\n options: {\n token: options.token\n }\n };\n } else if (type === 'azure-active-directory-msi-vm') {\n if (options.clientId !== undefined && typeof options.clientId !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientId\" property must be of type string.');\n }\n\n authentication = {\n type: 'azure-active-directory-msi-vm',\n options: {\n clientId: options.clientId\n }\n };\n } else if (type === 'azure-active-directory-default') {\n if (options.clientId !== undefined && typeof options.clientId !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientId\" property must be of type string.');\n }\n authentication = {\n type: 'azure-active-directory-default',\n options: {\n clientId: options.clientId\n }\n };\n } else if (type === 'azure-active-directory-msi-app-service') {\n if (options.clientId !== undefined && typeof options.clientId !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientId\" property must be of type string.');\n }\n\n authentication = {\n type: 'azure-active-directory-msi-app-service',\n options: {\n clientId: options.clientId\n }\n };\n } else if (type === 'azure-active-directory-service-principal-secret') {\n if (typeof options.clientId !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientId\" property must be of type string.');\n }\n\n if (typeof options.clientSecret !== 'string') {\n throw new TypeError('The \"config.authentication.options.clientSecret\" property must be of type string.');\n }\n\n if (typeof options.tenantId !== 'string') {\n throw new TypeError('The \"config.authentication.options.tenantId\" property must be of type string.');\n }\n\n authentication = {\n type: 'azure-active-directory-service-principal-secret',\n options: {\n clientId: options.clientId,\n clientSecret: options.clientSecret,\n tenantId: options.tenantId\n }\n };\n } else {\n if (options.userName !== undefined && typeof options.userName !== 'string') {\n throw new TypeError('The \"config.authentication.options.userName\" property must be of type string.');\n }\n\n if (options.password !== undefined && typeof options.password !== 'string') {\n throw new TypeError('The \"config.authentication.options.password\" property must be of type string.');\n }\n\n authentication = {\n type: 'default',\n options: {\n userName: options.userName,\n password: options.password\n }\n };\n }\n } else {\n authentication = {\n type: 'default',\n options: {\n userName: undefined,\n password: undefined\n }\n };\n }\n\n this.config = {\n server: config.server,\n authentication: authentication,\n options: {\n abortTransactionOnError: false,\n appName: undefined,\n camelCaseColumns: false,\n cancelTimeout: DEFAULT_CANCEL_TIMEOUT,\n columnEncryptionKeyCacheTTL: 2 * 60 * 60 * 1000, // Units: milliseconds\n columnEncryptionSetting: false,\n columnNameReplacer: undefined,\n connectionRetryInterval: DEFAULT_CONNECT_RETRY_INTERVAL,\n connectTimeout: DEFAULT_CONNECT_TIMEOUT,\n connector: undefined,\n connectionIsolationLevel: ISOLATION_LEVEL.READ_COMMITTED,\n cryptoCredentialsDetails: {},\n database: undefined,\n datefirst: DEFAULT_DATEFIRST,\n dateFormat: DEFAULT_DATEFORMAT,\n debug: {\n data: false,\n packet: false,\n payload: false,\n token: false\n },\n enableAnsiNull: true,\n enableAnsiNullDefault: true,\n enableAnsiPadding: true,\n enableAnsiWarnings: true,\n enableArithAbort: true,\n enableConcatNullYieldsNull: true,\n enableCursorCloseOnCommit: null,\n enableImplicitTransactions: false,\n enableNumericRoundabort: false,\n enableQuotedIdentifier: true,\n encrypt: true,\n fallbackToDefaultDb: false,\n encryptionKeyStoreProviders: undefined,\n instanceName: undefined,\n isolationLevel: ISOLATION_LEVEL.READ_COMMITTED,\n language: DEFAULT_LANGUAGE,\n localAddress: undefined,\n maxRetriesOnTransientErrors: 3,\n multiSubnetFailover: false,\n packetSize: DEFAULT_PACKET_SIZE,\n port: DEFAULT_PORT,\n readOnlyIntent: false,\n requestTimeout: DEFAULT_CLIENT_REQUEST_TIMEOUT,\n rowCollectionOnDone: false,\n rowCollectionOnRequestCompletion: false,\n serverName: undefined,\n serverSupportsColumnEncryption: false,\n tdsVersion: DEFAULT_TDS_VERSION,\n textsize: DEFAULT_TEXTSIZE,\n trustedServerNameAE: undefined,\n trustServerCertificate: false,\n useColumnNames: false,\n useUTC: true,\n workstationId: undefined,\n lowerCaseGuids: false\n }\n };\n\n if (config.options) {\n if (config.options.port && config.options.instanceName) {\n throw new Error('Port and instanceName are mutually exclusive, but ' + config.options.port + ' and ' + config.options.instanceName + ' provided');\n }\n\n if (config.options.abortTransactionOnError !== undefined) {\n if (typeof config.options.abortTransactionOnError !== 'boolean' && config.options.abortTransactionOnError !== null) {\n throw new TypeError('The \"config.options.abortTransactionOnError\" property must be of type string or null.');\n }\n\n this.config.options.abortTransactionOnError = config.options.abortTransactionOnError;\n }\n\n if (config.options.appName !== undefined) {\n if (typeof config.options.appName !== 'string') {\n throw new TypeError('The \"config.options.appName\" property must be of type string.');\n }\n\n this.config.options.appName = config.options.appName;\n }\n\n if (config.options.camelCaseColumns !== undefined) {\n if (typeof config.options.camelCaseColumns !== 'boolean') {\n throw new TypeError('The \"config.options.camelCaseColumns\" property must be of type boolean.');\n }\n\n this.config.options.camelCaseColumns = config.options.camelCaseColumns;\n }\n\n if (config.options.cancelTimeout !== undefined) {\n if (typeof config.options.cancelTimeout !== 'number') {\n throw new TypeError('The \"config.options.cancelTimeout\" property must be of type number.');\n }\n\n this.config.options.cancelTimeout = config.options.cancelTimeout;\n }\n\n if (config.options.columnNameReplacer) {\n if (typeof config.options.columnNameReplacer !== 'function') {\n throw new TypeError('The \"config.options.cancelTimeout\" property must be of type function.');\n }\n\n this.config.options.columnNameReplacer = config.options.columnNameReplacer;\n }\n\n if (config.options.connectionIsolationLevel !== undefined) {\n assertValidIsolationLevel(config.options.connectionIsolationLevel, 'config.options.connectionIsolationLevel');\n\n this.config.options.connectionIsolationLevel = config.options.connectionIsolationLevel;\n }\n\n if (config.options.connectTimeout !== undefined) {\n if (typeof config.options.connectTimeout !== 'number') {\n throw new TypeError('The \"config.options.connectTimeout\" property must be of type number.');\n }\n\n this.config.options.connectTimeout = config.options.connectTimeout;\n }\n\n if (config.options.connector !== undefined) {\n if (typeof config.options.connector !== 'function') {\n throw new TypeError('The \"config.options.connector\" property must be a function.');\n }\n\n this.config.options.connector = config.options.connector;\n }\n\n if (config.options.cryptoCredentialsDetails !== undefined) {\n if (typeof config.options.cryptoCredentialsDetails !== 'object' || config.options.cryptoCredentialsDetails === null) {\n throw new TypeError('The \"config.options.cryptoCredentialsDetails\" property must be of type Object.');\n }\n\n this.config.options.cryptoCredentialsDetails = config.options.cryptoCredentialsDetails;\n }\n\n if (config.options.database !== undefined) {\n if (typeof config.options.database !== 'string') {\n throw new TypeError('The \"config.options.database\" property must be of type string.');\n }\n\n this.config.options.database = config.options.database;\n }\n\n if (config.options.datefirst !== undefined) {\n if (typeof config.options.datefirst !== 'number' && config.options.datefirst !== null) {\n throw new TypeError('The \"config.options.datefirst\" property must be of type number.');\n }\n\n if (config.options.datefirst !== null && (config.options.datefirst < 1 || config.options.datefirst > 7)) {\n throw new RangeError('The \"config.options.datefirst\" property must be >= 1 and <= 7');\n }\n\n this.config.options.datefirst = config.options.datefirst;\n }\n\n if (config.options.dateFormat !== undefined) {\n if (typeof config.options.dateFormat !== 'string' && config.options.dateFormat !== null) {\n throw new TypeError('The \"config.options.dateFormat\" property must be of type string or null.');\n }\n\n this.config.options.dateFormat = config.options.dateFormat;\n }\n\n if (config.options.debug) {\n if (config.options.debug.data !== undefined) {\n if (typeof config.options.debug.data !== 'boolean') {\n throw new TypeError('The \"config.options.debug.data\" property must be of type boolean.');\n }\n\n this.config.options.debug.data = config.options.debug.data;\n }\n\n if (config.options.debug.packet !== undefined) {\n if (typeof config.options.debug.packet !== 'boolean') {\n throw new TypeError('The \"config.options.debug.packet\" property must be of type boolean.');\n }\n\n this.config.options.debug.packet = config.options.debug.packet;\n }\n\n if (config.options.debug.payload !== undefined) {\n if (typeof config.options.debug.payload !== 'boolean') {\n throw new TypeError('The \"config.options.debug.payload\" property must be of type boolean.');\n }\n\n this.config.options.debug.payload = config.options.debug.payload;\n }\n\n if (config.options.debug.token !== undefined) {\n if (typeof config.options.debug.token !== 'boolean') {\n throw new TypeError('The \"config.options.debug.token\" property must be of type boolean.');\n }\n\n this.config.options.debug.token = config.options.debug.token;\n }\n }\n\n if (config.options.enableAnsiNull !== undefined) {\n if (typeof config.options.enableAnsiNull !== 'boolean' && config.options.enableAnsiNull !== null) {\n throw new TypeError('The \"config.options.enableAnsiNull\" property must be of type boolean or null.');\n }\n\n this.config.options.enableAnsiNull = config.options.enableAnsiNull;\n }\n\n if (config.options.enableAnsiNullDefault !== undefined) {\n if (typeof config.options.enableAnsiNullDefault !== 'boolean' && config.options.enableAnsiNullDefault !== null) {\n throw new TypeError('The \"config.options.enableAnsiNullDefault\" property must be of type boolean or null.');\n }\n\n this.config.options.enableAnsiNullDefault = config.options.enableAnsiNullDefault;\n }\n\n if (config.options.enableAnsiPadding !== undefined) {\n if (typeof config.options.enableAnsiPadding !== 'boolean' && config.options.enableAnsiPadding !== null) {\n throw new TypeError('The \"config.options.enableAnsiPadding\" property must be of type boolean or null.');\n }\n\n this.config.options.enableAnsiPadding = config.options.enableAnsiPadding;\n }\n\n if (config.options.enableAnsiWarnings !== undefined) {\n if (typeof config.options.enableAnsiWarnings !== 'boolean' && config.options.enableAnsiWarnings !== null) {\n throw new TypeError('The \"config.options.enableAnsiWarnings\" property must be of type boolean or null.');\n }\n\n this.config.options.enableAnsiWarnings = config.options.enableAnsiWarnings;\n }\n\n if (config.options.enableArithAbort !== undefined) {\n if (typeof config.options.enableArithAbort !== 'boolean' && config.options.enableArithAbort !== null) {\n throw new TypeError('The \"config.options.enableArithAbort\" property must be of type boolean or null.');\n }\n\n this.config.options.enableArithAbort = config.options.enableArithAbort;\n }\n\n if (config.options.enableConcatNullYieldsNull !== undefined) {\n if (typeof config.options.enableConcatNullYieldsNull !== 'boolean' && config.options.enableConcatNullYieldsNull !== null) {\n throw new TypeError('The \"config.options.enableConcatNullYieldsNull\" property must be of type boolean or null.');\n }\n\n this.config.options.enableConcatNullYieldsNull = config.options.enableConcatNullYieldsNull;\n }\n\n if (config.options.enableCursorCloseOnCommit !== undefined) {\n if (typeof config.options.enableCursorCloseOnCommit !== 'boolean' && config.options.enableCursorCloseOnCommit !== null) {\n throw new TypeError('The \"config.options.enableCursorCloseOnCommit\" property must be of type boolean or null.');\n }\n\n this.config.options.enableCursorCloseOnCommit = config.options.enableCursorCloseOnCommit;\n }\n\n if (config.options.enableImplicitTransactions !== undefined) {\n if (typeof config.options.enableImplicitTransactions !== 'boolean' && config.options.enableImplicitTransactions !== null) {\n throw new TypeError('The \"config.options.enableImplicitTransactions\" property must be of type boolean or null.');\n }\n\n this.config.options.enableImplicitTransactions = config.options.enableImplicitTransactions;\n }\n\n if (config.options.enableNumericRoundabort !== undefined) {\n if (typeof config.options.enableNumericRoundabort !== 'boolean' && config.options.enableNumericRoundabort !== null) {\n throw new TypeError('The \"config.options.enableNumericRoundabort\" property must be of type boolean or null.');\n }\n\n this.config.options.enableNumericRoundabort = config.options.enableNumericRoundabort;\n }\n\n if (config.options.enableQuotedIdentifier !== undefined) {\n if (typeof config.options.enableQuotedIdentifier !== 'boolean' && config.options.enableQuotedIdentifier !== null) {\n throw new TypeError('The \"config.options.enableQuotedIdentifier\" property must be of type boolean or null.');\n }\n\n this.config.options.enableQuotedIdentifier = config.options.enableQuotedIdentifier;\n }\n if (config.options.encrypt !== undefined) {\n if (typeof config.options.encrypt !== 'boolean') {\n if (config.options.encrypt !== 'strict') {\n throw new TypeError('The \"encrypt\" property must be set to \"strict\", or of type boolean.');\n }\n }\n\n this.config.options.encrypt = config.options.encrypt;\n }\n\n if (config.options.fallbackToDefaultDb !== undefined) {\n if (typeof config.options.fallbackToDefaultDb !== 'boolean') {\n throw new TypeError('The \"config.options.fallbackToDefaultDb\" property must be of type boolean.');\n }\n\n this.config.options.fallbackToDefaultDb = config.options.fallbackToDefaultDb;\n }\n\n if (config.options.instanceName !== undefined) {\n if (typeof config.options.instanceName !== 'string') {\n throw new TypeError('The \"config.options.instanceName\" property must be of type string.');\n }\n\n this.config.options.instanceName = config.options.instanceName;\n this.config.options.port = undefined;\n }\n\n if (config.options.isolationLevel !== undefined) {\n assertValidIsolationLevel(config.options.isolationLevel, 'config.options.isolationLevel');\n\n this.config.options.isolationLevel = config.options.isolationLevel;\n }\n\n if (config.options.language !== undefined) {\n if (typeof config.options.language !== 'string' && config.options.language !== null) {\n throw new TypeError('The \"config.options.language\" property must be of type string or null.');\n }\n\n this.config.options.language = config.options.language;\n }\n\n if (config.options.localAddress !== undefined) {\n if (typeof config.options.localAddress !== 'string') {\n throw new TypeError('The \"config.options.localAddress\" property must be of type string.');\n }\n\n this.config.options.localAddress = config.options.localAddress;\n }\n\n if (config.options.multiSubnetFailover !== undefined) {\n if (typeof config.options.multiSubnetFailover !== 'boolean') {\n throw new TypeError('The \"config.options.multiSubnetFailover\" property must be of type boolean.');\n }\n\n this.config.options.multiSubnetFailover = config.options.multiSubnetFailover;\n }\n\n if (config.options.packetSize !== undefined) {\n if (typeof config.options.packetSize !== 'number') {\n throw new TypeError('The \"config.options.packetSize\" property must be of type number.');\n }\n\n this.config.options.packetSize = config.options.packetSize;\n }\n\n if (config.options.port !== undefined) {\n if (typeof config.options.port !== 'number') {\n throw new TypeError('The \"config.options.port\" property must be of type number.');\n }\n\n if (config.options.port <= 0 || config.options.port >= 65536) {\n throw new RangeError('The \"config.options.port\" property must be > 0 and < 65536');\n }\n\n this.config.options.port = config.options.port;\n this.config.options.instanceName = undefined;\n }\n\n if (config.options.readOnlyIntent !== undefined) {\n if (typeof config.options.readOnlyIntent !== 'boolean') {\n throw new TypeError('The \"config.options.readOnlyIntent\" property must be of type boolean.');\n }\n\n this.config.options.readOnlyIntent = config.options.readOnlyIntent;\n }\n\n if (config.options.requestTimeout !== undefined) {\n if (typeof config.options.requestTimeout !== 'number') {\n throw new TypeError('The \"config.options.requestTimeout\" property must be of type number.');\n }\n\n this.config.options.requestTimeout = config.options.requestTimeout;\n }\n\n if (config.options.maxRetriesOnTransientErrors !== undefined) {\n if (typeof config.options.maxRetriesOnTransientErrors !== 'number') {\n throw new TypeError('The \"config.options.maxRetriesOnTransientErrors\" property must be of type number.');\n }\n\n if (config.options.maxRetriesOnTransientErrors < 0) {\n throw new TypeError('The \"config.options.maxRetriesOnTransientErrors\" property must be equal or greater than 0.');\n }\n\n this.config.options.maxRetriesOnTransientErrors = config.options.maxRetriesOnTransientErrors;\n }\n\n if (config.options.connectionRetryInterval !== undefined) {\n if (typeof config.options.connectionRetryInterval !== 'number') {\n throw new TypeError('The \"config.options.connectionRetryInterval\" property must be of type number.');\n }\n\n if (config.options.connectionRetryInterval <= 0) {\n throw new TypeError('The \"config.options.connectionRetryInterval\" property must be greater than 0.');\n }\n\n this.config.options.connectionRetryInterval = config.options.connectionRetryInterval;\n }\n\n if (config.options.rowCollectionOnDone !== undefined) {\n if (typeof config.options.rowCollectionOnDone !== 'boolean') {\n throw new TypeError('The \"config.options.rowCollectionOnDone\" property must be of type boolean.');\n }\n\n this.config.options.rowCollectionOnDone = config.options.rowCollectionOnDone;\n }\n\n if (config.options.rowCollectionOnRequestCompletion !== undefined) {\n if (typeof config.options.rowCollectionOnRequestCompletion !== 'boolean') {\n throw new TypeError('The \"config.options.rowCollectionOnRequestCompletion\" property must be of type boolean.');\n }\n\n this.config.options.rowCollectionOnRequestCompletion = config.options.rowCollectionOnRequestCompletion;\n }\n\n if (config.options.tdsVersion !== undefined) {\n if (typeof config.options.tdsVersion !== 'string') {\n throw new TypeError('The \"config.options.tdsVersion\" property must be of type string.');\n }\n\n this.config.options.tdsVersion = config.options.tdsVersion;\n }\n\n if (config.options.textsize !== undefined) {\n if (typeof config.options.textsize !== 'number' && config.options.textsize !== null) {\n throw new TypeError('The \"config.options.textsize\" property must be of type number or null.');\n }\n\n if (config.options.textsize > 2147483647) {\n throw new TypeError('The \"config.options.textsize\" can\\'t be greater than 2147483647.');\n } else if (config.options.textsize < -1) {\n throw new TypeError('The \"config.options.textsize\" can\\'t be smaller than -1.');\n }\n\n this.config.options.textsize = config.options.textsize | 0;\n }\n\n if (config.options.trustServerCertificate !== undefined) {\n if (typeof config.options.trustServerCertificate !== 'boolean') {\n throw new TypeError('The \"config.options.trustServerCertificate\" property must be of type boolean.');\n }\n\n this.config.options.trustServerCertificate = config.options.trustServerCertificate;\n }\n\n if (config.options.serverName !== undefined) {\n if (typeof config.options.serverName !== 'string') {\n throw new TypeError('The \"config.options.serverName\" property must be of type string.');\n }\n this.config.options.serverName = config.options.serverName;\n }\n\n if (config.options.useColumnNames !== undefined) {\n if (typeof config.options.useColumnNames !== 'boolean') {\n throw new TypeError('The \"config.options.useColumnNames\" property must be of type boolean.');\n }\n\n this.config.options.useColumnNames = config.options.useColumnNames;\n }\n\n if (config.options.useUTC !== undefined) {\n if (typeof config.options.useUTC !== 'boolean') {\n throw new TypeError('The \"config.options.useUTC\" property must be of type boolean.');\n }\n\n this.config.options.useUTC = config.options.useUTC;\n }\n\n if (config.options.workstationId !== undefined) {\n if (typeof config.options.workstationId !== 'string') {\n throw new TypeError('The \"config.options.workstationId\" property must be of type string.');\n }\n\n this.config.options.workstationId = config.options.workstationId;\n }\n\n if (config.options.lowerCaseGuids !== undefined) {\n if (typeof config.options.lowerCaseGuids !== 'boolean') {\n throw new TypeError('The \"config.options.lowerCaseGuids\" property must be of type boolean.');\n }\n\n this.config.options.lowerCaseGuids = config.options.lowerCaseGuids;\n }\n }\n\n this.secureContextOptions = this.config.options.cryptoCredentialsDetails;\n if (this.secureContextOptions.secureOptions === undefined) {\n // If the caller has not specified their own `secureOptions`,\n // we set `SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS` here.\n // Older SQL Server instances running on older Windows versions have\n // trouble with the BEAST workaround in OpenSSL.\n // As BEAST is a browser specific exploit, we can just disable this option here.\n this.secureContextOptions = Object.create(this.secureContextOptions, {\n secureOptions: {\n value: constants.SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS\n }\n });\n }\n\n this.debug = this.createDebug();\n this.inTransaction = false;\n this.transactionDescriptors = [Buffer.from([0, 0, 0, 0, 0, 0, 0, 0])];\n\n // 'beginTransaction', 'commitTransaction' and 'rollbackTransaction'\n // events are utilized to maintain inTransaction property state which in\n // turn is used in managing transactions. These events are only fired for\n // TDS version 7.2 and beyond. The properties below are used to emulate\n // equivalent behavior for TDS versions before 7.2.\n this.transactionDepth = 0;\n this.isSqlBatch = false;\n this.closed = false;\n this.messageBuffer = Buffer.alloc(0);\n\n this.curTransientRetryCount = 0;\n this.transientErrorLookup = new TransientErrorLookup();\n\n this.state = this.STATE.INITIALIZED;\n\n this._cancelAfterRequestSent = () => {\n this.messageIo.sendMessage(TYPE.ATTENTION);\n this.createCancelTimer();\n };\n\n this._onSocketClose = () => {\n this.socketClose();\n };\n\n this._onSocketEnd = () => {\n this.socketEnd();\n };\n\n this._onSocketError = (error) => {\n this.dispatchEvent('socketError', error);\n process.nextTick(() => {\n this.emit('error', this.wrapSocketError(error));\n });\n };\n }\n\n connect(connectListener?: (err?: Error) => void) {\n if (this.state !== this.STATE.INITIALIZED) {\n throw new ConnectionError('`.connect` can not be called on a Connection in `' + this.state.name + '` state.');\n }\n\n if (connectListener) {\n const onConnect = (err?: Error) => {\n this.removeListener('error', onError);\n connectListener(err);\n };\n\n const onError = (err: Error) => {\n this.removeListener('connect', onConnect);\n connectListener(err);\n };\n\n this.once('connect', onConnect);\n this.once('error', onError);\n }\n\n this.transitionTo(this.STATE.CONNECTING);\n this.initialiseConnection().then(() => {\n process.nextTick(() => {\n this.emit('connect');\n });\n }, (err) => {\n this.transitionTo(this.STATE.FINAL);\n this.closed = true;\n\n process.nextTick(() => {\n this.emit('connect', err);\n });\n process.nextTick(() => {\n this.emit('end');\n });\n });\n }\n\n /**\n * The server has reported that the charset has changed.\n */\n on(event: 'charsetChange', listener: (charset: string) => void): this\n\n /**\n * The attempt to connect and validate has completed.\n */\n on(\n event: 'connect',\n /**\n * @param err If successfully connected, will be falsey. If there was a\n * problem (with either connecting or validation), will be an [[Error]] object.\n */\n listener: (err: Error | undefined) => void\n ): this\n\n /**\n * The server has reported that the active database has changed.\n * This may be as a result of a successful login, or a `use` statement.\n */\n on(event: 'databaseChange', listener: (databaseName: string) => void): this\n\n /**\n * A debug message is available. It may be logged or ignored.\n */\n on(event: 'debug', listener: (messageText: string) => void): this\n\n /**\n * Internal error occurs.\n */\n on(event: 'error', listener: (err: Error) => void): this\n\n /**\n * The server has issued an error message.\n */\n on(event: 'errorMessage', listener: (message: import('./token/token').ErrorMessageToken) => void): this\n\n /**\n * The connection has ended.\n *\n * This may be as a result of the client calling [[close]], the server\n * closing the connection, or a network error.\n */\n on(event: 'end', listener: () => void): this\n\n /**\n * The server has issued an information message.\n */\n on(event: 'infoMessage', listener: (message: import('./token/token').InfoMessageToken) => void): this\n\n /**\n * The server has reported that the language has changed.\n */\n on(event: 'languageChange', listener: (languageName: string) => void): this\n\n /**\n * The connection was reset.\n */\n on(event: 'resetConnection', listener: () => void): this\n\n /**\n * A secure connection has been established.\n */\n on(event: 'secure', listener: (cleartext: import('tls').TLSSocket) => void): this\n\n on(event: string | symbol, listener: (...args: any[]) => void) {\n return super.on(event, listener);\n }\n\n /**\n * @private\n */\n emit(event: 'charsetChange', charset: string): boolean\n /**\n * @private\n */\n emit(event: 'connect', error?: Error): boolean\n /**\n * @private\n */\n emit(event: 'databaseChange', databaseName: string): boolean\n /**\n * @private\n */\n emit(event: 'databaseMirroringPartner', partnerInstanceName: string): boolean\n /**\n * @private\n */\n emit(event: 'debug', messageText: string): boolean\n /**\n * @private\n */\n emit(event: 'error', error: Error): boolean\n /**\n * @private\n */\n emit(event: 'errorMessage', message: import('./token/token').ErrorMessageToken): boolean\n /**\n * @private\n */\n emit(event: 'end'): boolean\n /**\n * @private\n */\n emit(event: 'infoMessage', message: import('./token/token').InfoMessageToken): boolean\n /**\n * @private\n */\n emit(event: 'languageChange', languageName: string): boolean\n /**\n * @private\n */\n emit(event: 'secure', cleartext: import('tls').TLSSocket): boolean\n /**\n * @private\n */\n emit(event: 'rerouting'): boolean\n /**\n * @private\n */\n emit(event: 'resetConnection'): boolean\n /**\n * @private\n */\n emit(event: 'retry'): boolean\n /**\n * @private\n */\n emit(event: 'rollbackTransaction'): boolean\n\n emit(event: string | symbol, ...args: any[]) {\n return super.emit(event, ...args);\n }\n\n /**\n * Closes the connection to the database.\n *\n * The [[Event_end]] will be emitted once the connection has been closed.\n */\n close() {\n this.transitionTo(this.STATE.FINAL);\n this.cleanupConnection();\n }\n\n /**\n * @private\n */\n async initialiseConnection() {\n const timeoutController = new AbortController();\n\n const connectTimer = setTimeout(() => {\n const hostPostfix = this.config.options.port ? `:${this.config.options.port}` : `\\\\${this.config.options.instanceName}`;\n // If we have routing data stored, this connection has been redirected\n const server = this.routingData ? this.routingData.server : this.config.server;\n const port = this.routingData ? `:${this.routingData.port}` : hostPostfix;\n // Grab the target host from the connection configuration, and from a redirect message\n // otherwise, leave the message empty.\n const routingMessage = this.routingData ? ` (redirected from ${this.config.server}${hostPostfix})` : '';\n const message = `Failed to connect to ${server}${port}${routingMessage} in ${this.config.options.connectTimeout}ms`;\n this.debug.log(message);\n\n timeoutController.abort(new ConnectionError(message, 'ETIMEOUT'));\n }, this.config.options.connectTimeout);\n\n try {\n let signal = timeoutController.signal;\n\n let port = this.config.options.port;\n\n if (!port) {\n try {\n port = await instanceLookup({\n server: this.config.server,\n instanceName: this.config.options.instanceName!,\n timeout: this.config.options.connectTimeout,\n signal: signal\n });\n } catch (err: any) {\n signal.throwIfAborted();\n\n throw new ConnectionError(err.message, 'EINSTLOOKUP', { cause: err });\n }\n }\n\n let socket;\n try {\n socket = await this.connectOnPort(port, this.config.options.multiSubnetFailover, signal, this.config.options.connector);\n } catch (err: any) {\n signal.throwIfAborted();\n\n throw this.wrapSocketError(err);\n }\n\n try {\n const controller = new AbortController();\n const onError = (err: Error) => {\n controller.abort(this.wrapSocketError(err));\n };\n const onClose = () => {\n this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed');\n };\n const onEnd = () => {\n this.debug.log('socket ended');\n\n const error: ErrorWithCode = new Error('socket hang up');\n error.code = 'ECONNRESET';\n controller.abort(this.wrapSocketError(error));\n };\n\n socket.once('error', onError);\n socket.once('close', onClose);\n socket.once('end', onEnd);\n\n try {\n signal = AbortSignal.any([signal, controller.signal]);\n\n socket.setKeepAlive(true, KEEP_ALIVE_INITIAL_DELAY);\n\n this.messageIo = new MessageIO(socket, this.config.options.packetSize, this.debug);\n this.messageIo.on('secure', (cleartext) => { this.emit('secure', cleartext); });\n\n this.socket = socket;\n\n this.closed = false;\n this.debug.log('connected to ' + this.config.server + ':' + this.config.options.port);\n\n this.sendPreLogin();\n\n this.transitionTo(this.STATE.SENT_PRELOGIN);\n const preloginResponse = await this.readPreloginResponse(signal);\n await this.performTlsNegotiation(preloginResponse, signal);\n\n this.sendLogin7Packet();\n\n try {\n const { authentication } = this.config;\n switch (authentication.type) {\n case 'token-credential':\n case 'azure-active-directory-password':\n case 'azure-active-directory-msi-vm':\n case 'azure-active-directory-msi-app-service':\n case 'azure-active-directory-service-principal-secret':\n case 'azure-active-directory-default':\n this.transitionTo(this.STATE.SENT_LOGIN7_WITH_FEDAUTH);\n this.routingData = await this.performSentLogin7WithFedAuth(signal);\n break;\n case 'ntlm':\n this.transitionTo(this.STATE.SENT_LOGIN7_WITH_NTLM);\n this.routingData = await this.performSentLogin7WithNTLMLogin(signal);\n break;\n default:\n this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN);\n this.routingData = await this.performSentLogin7WithStandardLogin(signal);\n break;\n }\n } catch (err: any) {\n if (isTransientError(err)) {\n this.debug.log('Initiating retry on transient error');\n this.transitionTo(this.STATE.TRANSIENT_FAILURE_RETRY);\n return await this.performTransientFailureRetry();\n }\n\n throw err;\n }\n\n // If routing data is present, we need to re-route the connection\n if (this.routingData) {\n this.transitionTo(this.STATE.REROUTING);\n return await this.performReRouting();\n }\n\n this.transitionTo(this.STATE.LOGGED_IN_SENDING_INITIAL_SQL);\n await this.performLoggedInSendingInitialSql(signal);\n } finally {\n socket.removeListener('error', onError);\n socket.removeListener('close', onClose);\n socket.removeListener('end', onEnd);\n }\n } catch (err) {\n socket.destroy();\n\n throw err;\n }\n\n socket.on('error', this._onSocketError);\n socket.on('close', this._onSocketClose);\n socket.on('end', this._onSocketEnd);\n\n this.transitionTo(this.STATE.LOGGED_IN);\n } finally {\n clearTimeout(connectTimer);\n }\n }\n\n /**\n * @private\n */\n cleanupConnection() {\n if (!this.closed) {\n this.clearRequestTimer();\n this.closeConnection();\n\n process.nextTick(() => {\n this.emit('end');\n });\n\n const request = this.request;\n if (request) {\n const err = new RequestError('Connection closed before request completed.', 'ECLOSE');\n request.callback(err);\n this.request = undefined;\n }\n\n this.closed = true;\n }\n }\n\n /**\n * @private\n */\n createDebug() {\n const debug = new Debug(this.config.options.debug);\n debug.on('debug', (message) => {\n this.emit('debug', message);\n });\n return debug;\n }\n\n /**\n * @private\n */\n createTokenStreamParser(message: Message, handler: TokenHandler) {\n return new TokenStreamParser(message, this.debug, handler, this.config.options);\n }\n\n async wrapWithTls(socket: net.Socket, signal: AbortSignal): Promise<tls.TLSSocket> {\n signal.throwIfAborted();\n\n const secureContext = tls.createSecureContext(this.secureContextOptions);\n // If connect to an ip address directly,\n // need to set the servername to an empty string\n // if the user has not given a servername explicitly\n const serverName = !net.isIP(this.config.server) ? this.config.server : '';\n const encryptOptions = {\n host: this.config.server,\n socket: socket,\n ALPNProtocols: ['tds/8.0'],\n secureContext: secureContext,\n servername: this.config.options.serverName ? this.config.options.serverName : serverName,\n };\n\n const { promise, resolve, reject } = withResolvers<tls.TLSSocket>();\n const encryptsocket = tls.connect(encryptOptions);\n\n try {\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n const onError = reject;\n const onConnect = () => { resolve(encryptsocket); };\n\n encryptsocket.once('error', onError);\n encryptsocket.once('secureConnect', onConnect);\n\n try {\n return await promise;\n } finally {\n encryptsocket.removeListener('error', onError);\n encryptsocket.removeListener('connect', onConnect);\n }\n } finally {\n signal.removeEventListener('abort', onAbort);\n }\n } catch (err: any) {\n encryptsocket.destroy();\n\n throw err;\n }\n }\n\n async connectOnPort(port: number, multiSubnetFailover: boolean, signal: AbortSignal, customConnector?: () => Promise<net.Socket>) {\n const connectOpts = {\n host: this.routingData ? this.routingData.server : this.config.server,\n port: this.routingData ? this.routingData.port : port,\n localAddress: this.config.options.localAddress\n };\n\n const connect = customConnector || (multiSubnetFailover ? connectInParallel : connectInSequence);\n\n let socket = await connect(connectOpts, dns.lookup, signal);\n\n if (this.config.options.encrypt === 'strict') {\n try {\n // Wrap the socket with TLS for TDS 8.0\n socket = await this.wrapWithTls(socket, signal);\n } catch (err) {\n socket.end();\n\n throw err;\n }\n }\n\n return socket;\n }\n\n /**\n * @private\n */\n closeConnection() {\n if (this.socket) {\n this.socket.destroy();\n }\n }\n\n /**\n * @private\n */\n createCancelTimer() {\n this.clearCancelTimer();\n const timeout = this.config.options.cancelTimeout;\n if (timeout > 0) {\n this.cancelTimer = setTimeout(() => {\n this.cancelTimeout();\n }, timeout);\n }\n }\n\n /**\n * @private\n */\n createRequestTimer() {\n this.clearRequestTimer(); // release old timer, just to be safe\n const request = this.request as Request;\n const timeout = (request.timeout !== undefined) ? request.timeout : this.config.options.requestTimeout;\n if (timeout) {\n this.requestTimer = setTimeout(() => {\n this.requestTimeout();\n }, timeout);\n }\n }\n\n /**\n * @private\n */\n cancelTimeout() {\n const message = `Failed to cancel request in ${this.config.options.cancelTimeout}ms`;\n this.debug.log(message);\n this.dispatchEvent('socketError', new ConnectionError(message, 'ETIMEOUT'));\n }\n\n /**\n * @private\n */\n requestTimeout() {\n this.requestTimer = undefined;\n const request = this.request!;\n request.cancel();\n const timeout = (request.timeout !== undefined) ? request.timeout : this.config.options.requestTimeout;\n const message = 'Timeout: Request failed to complete in ' + timeout + 'ms';\n request.error = new RequestError(message, 'ETIMEOUT');\n }\n\n /**\n * @private\n */\n clearCancelTimer() {\n if (this.cancelTimer) {\n clearTimeout(this.cancelTimer);\n this.cancelTimer = undefined;\n }\n }\n\n /**\n * @private\n */\n clearRequestTimer() {\n if (this.requestTimer) {\n clearTimeout(this.requestTimer);\n this.requestTimer = undefined;\n }\n }\n\n /**\n * @private\n */\n transitionTo(newState: State) {\n if (this.state === newState) {\n this.debug.log('State is already ' + newState.name);\n return;\n }\n\n if (this.state && this.state.exit) {\n this.state.exit.call(this, newState);\n }\n\n this.debug.log('State change: ' + (this.state ? this.state.name : 'undefined') + ' -> ' + newState.name);\n this.state = newState;\n\n if (this.state.enter) {\n this.state.enter.apply(this);\n }\n }\n\n /**\n * @private\n */\n getEventHandler<T extends keyof State['events']>(eventName: T): NonNullable<State['events'][T]> {\n const handler = this.state.events[eventName];\n\n if (!handler) {\n throw new Error(`No event '${eventName}' in state '${this.state.name}'`);\n }\n\n return handler!;\n }\n\n /**\n * @private\n */\n dispatchEvent<T extends keyof State['events']>(eventName: T, ...args: Parameters<NonNullable<State['events'][T]>>) {\n const handler = this.state.events[eventName] as ((this: Connection, ...args: any[]) => void) | undefined;\n if (handler) {\n handler.apply(this, args);\n } else {\n this.emit('error', new Error(`No event '${eventName}' in state '${this.state.name}'`));\n this.close();\n }\n }\n\n /**\n * @private\n */\n wrapSocketError(error: Error): ConnectionError {\n if (this.state === this.STATE.CONNECTING || this.state === this.STATE.SENT_TLSSSLNEGOTIATION) {\n const hostPostfix = this.config.options.port ? `:${this.config.options.port}` : `\\\\${this.config.options.instanceName}`;\n // If we have routing data stored, this connection has been redirected\n const server = this.routingData ? this.routingData.server : this.config.server;\n const port = this.routingData ? `:${this.routingData.port}` : hostPostfix;\n // Grab the target host from the connection configuration, and from a redirect message\n // otherwise, leave the message empty.\n const routingMessage = this.routingData ? ` (redirected from ${this.config.server}${hostPostfix})` : '';\n const message = `Failed to connect to ${server}${port}${routingMessage} - ${error.message}`;\n\n return new ConnectionError(message, 'ESOCKET', { cause: error });\n } else {\n const message = `Connection lost - ${error.message}`;\n return new ConnectionError(message, 'ESOCKET', { cause: error });\n }\n }\n\n /**\n * @private\n */\n socketEnd() {\n this.debug.log('socket ended');\n if (this.state !== this.STATE.FINAL) {\n const error: ErrorWithCode = new Error('socket hang up');\n error.code = 'ECONNRESET';\n\n this.dispatchEvent('socketError', error);\n process.nextTick(() => {\n this.emit('error', this.wrapSocketError(error));\n });\n }\n }\n\n /**\n * @private\n */\n socketClose() {\n this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed');\n this.transitionTo(this.STATE.FINAL);\n this.cleanupConnection();\n }\n\n /**\n * @private\n */\n sendPreLogin() {\n const [, major, minor, build] = /^(\\d+)\\.(\\d+)\\.(\\d+)/.exec(version) ?? ['0.0.0', '0', '0', '0'];\n const payload = new PreloginPayload({\n // If encrypt setting is set to 'strict', then we should have already done the encryption before calling\n // this function. Therefore, the encrypt will be set to false here.\n // Otherwise, we will set encrypt here based on the encrypt Boolean value from the configuration.\n encrypt: typeof this.config.options.encrypt === 'boolean' && this.config.options.encrypt,\n version: { major: Number(major), minor: Number(minor), build: Number(build), subbuild: 0 }\n });\n\n this.messageIo.sendMessage(TYPE.PRELOGIN, payload.data);\n this.debug.payload(function() {\n return payload.toString(' ');\n });\n }\n\n /**\n * @private\n */\n sendLogin7Packet() {\n const payload = new Login7Payload({\n tdsVersion: versions[this.config.options.tdsVersion],\n packetSize: this.config.options.packetSize,\n clientProgVer: 0,\n clientPid: process.pid,\n connectionId: 0,\n clientTimeZone: new Date().getTimezoneOffset(),\n clientLcid: 0x00000409\n });\n\n const { authentication } = this.config;\n switch (authentication.type) {\n case 'azure-active-directory-password':\n payload.fedAuth = {\n type: 'ADAL',\n echo: this.fedAuthRequired,\n workflow: 'default'\n };\n break;\n\n case 'azure-active-directory-access-token':\n payload.fedAuth = {\n type: 'SECURITYTOKEN',\n echo: this.fedAuthRequired,\n fedAuthToken: authentication.options.token\n };\n break;\n\n case 'token-credential':\n case 'azure-active-directory-msi-vm':\n case 'azure-active-directory-default':\n case 'azure-active-directory-msi-app-service':\n case 'azure-active-directory-service-principal-secret':\n payload.fedAuth = {\n type: 'ADAL',\n echo: this.fedAuthRequired,\n workflow: 'integrated'\n };\n break;\n\n case 'ntlm':\n payload.sspi = createNTLMRequest({ domain: authentication.options.domain });\n break;\n\n default:\n payload.userName = authentication.options.userName;\n payload.password = authentication.options.password;\n }\n\n payload.hostname = this.config.options.workstationId || os.hostname();\n payload.serverName = this.routingData ?\n `${this.routingData.server}${this.routingData.instance ? '\\\\' + this.routingData.instance : ''}` :\n this.config.server;\n payload.appName = this.config.options.appName || 'Tedious';\n payload.libraryName = libraryName;\n payload.language = this.config.options.language;\n payload.database = this.config.options.database;\n payload.clientId = Buffer.from([1, 2, 3, 4, 5, 6]);\n\n payload.readOnlyIntent = this.config.options.readOnlyIntent;\n payload.initDbFatal = !this.config.options.fallbackToDefaultDb;\n\n this.routingData = undefined;\n this.messageIo.sendMessage(TYPE.LOGIN7, payload.toBuffer());\n\n this.debug.payload(function() {\n return payload.toString(' ');\n });\n }\n\n /**\n * @private\n */\n sendFedAuthTokenMessage(token: string) {\n const accessTokenLen = Buffer.byteLength(token, 'ucs2');\n const data = Buffer.alloc(8 + accessTokenLen);\n let offset = 0;\n offset = data.writeUInt32LE(accessTokenLen + 4, offset);\n offset = data.writeUInt32LE(accessTokenLen, offset);\n data.write(token, offset, 'ucs2');\n this.messageIo.sendMessage(TYPE.FEDAUTH_TOKEN, data);\n }\n\n /**\n * @private\n */\n sendInitialSql() {\n const payload = new SqlBatchPayload(this.getInitialSql(), this.currentTransactionDescriptor(), this.config.options);\n\n const message = new Message({ type: TYPE.SQL_BATCH });\n this.messageIo.outgoingMessageStream.write(message);\n Readable.from(payload).pipe(message);\n }\n\n /**\n * @private\n */\n getInitialSql() {\n const options = [];\n\n if (this.config.options.enableAnsiNull === true) {\n options.push('set ansi_nulls on');\n } else if (this.config.options.enableAnsiNull === false) {\n options.push('set ansi_nulls off');\n }\n\n if (this.config.options.enableAnsiNullDefault === true) {\n options.push('set ansi_null_dflt_on on');\n } else if (this.config.options.enableAnsiNullDefault === false) {\n options.push('set ansi_null_dflt_on off');\n }\n\n if (this.config.options.enableAnsiPadding === true) {\n options.push('set ansi_padding on');\n } else if (this.config.options.enableAnsiPadding === false) {\n options.push('set ansi_padding off');\n }\n\n if (this.config.options.enableAnsiWarnings === true) {\n options.push('set ansi_warnings on');\n } else if (this.config.options.enableAnsiWarnings === false) {\n options.push('set ansi_warnings off');\n }\n\n if (this.config.options.enableArithAbort === true) {\n options.push('set arithabort on');\n } else if (this.config.options.enableArithAbort === false) {\n options.push('set arithabort off');\n }\n\n if (this.config.options.enableConcatNullYieldsNull === true) {\n options.push('set concat_null_yields_null on');\n } else if (this.config.options.enableConcatNullYieldsNull === false) {\n options.push('set concat_null_yields_null off');\n }\n\n if (this.config.options.enableCursorCloseOnCommit === true) {\n options.push('set cursor_close_on_commit on');\n } else if (this.config.options.enableCursorCloseOnCommit === false) {\n options.push('set cursor_close_on_commit off');\n }\n\n if (this.config.options.datefirst !== null) {\n options.push(`set datefirst ${this.config.options.datefirst}`);\n }\n\n if (this.config.options.dateFormat !== null) {\n options.push(`set dateformat ${this.config.options.dateFormat}`);\n }\n\n if (this.config.options.enableImplicitTransactions === true) {\n options.push('set implicit_transactions on');\n } else if (this.config.options.enableImplicitTransactions === false) {\n options.push('set implicit_transactions off');\n }\n\n if (this.config.options.language !== null) {\n options.push(`set language ${this.config.options.language}`);\n }\n\n if (this.config.options.enableNumericRoundabort === true) {\n options.push('set numeric_roundabort on');\n } else if (this.config.options.enableNumericRoundabort === false) {\n options.push('set numeric_roundabort off');\n }\n\n if (this.config.options.enableQuotedIdentifier === true) {\n options.push('set quoted_identifier on');\n } else if (this.config.options.enableQuotedIdentifier === false) {\n options.push('set quoted_identifier off');\n }\n\n if (this.config.options.textsize !== null) {\n options.push(`set textsize ${this.config.options.textsize}`);\n }\n\n if (this.config.options.connectionIsolationLevel !== null) {\n options.push(`set transaction isolation level ${this.getIsolationLevelText(this.config.options.connectionIsolationLevel)}`);\n }\n\n if (this.config.options.abortTransactionOnError === true) {\n options.push('set xact_abort on');\n } else if (this.config.options.abortTransactionOnError === false) {\n options.push('set xact_abort off');\n }\n\n return options.join('\\n');\n }\n\n /**\n * Execute the SQL batch represented by [[Request]].\n * There is no param support, and unlike [[Request.execSql]],\n * it is not likely that SQL Server will reuse the execution plan it generates for the SQL.\n *\n * In almost all cases, [[Request.execSql]] will be a better choice.\n *\n * @param request A [[Request]] object representing the request.\n */\n execSqlBatch(request: Request) {\n this.makeRequest(request, TYPE.SQL_BATCH, new SqlBatchPayload(request.sqlTextOrProcedure!, this.currentTransactionDescriptor(), this.config.options));\n }\n\n /**\n * Execute the SQL represented by [[Request]].\n *\n * As `sp_executesql` is used to execute the SQL, if the same SQL is executed multiples times\n * using this function, the SQL Server query optimizer is likely to reuse the execution plan it generates\n * for the first execution. This may also result in SQL server treating the request like a stored procedure\n * which can result in the [[Event_doneInProc]] or [[Event_doneProc]] events being emitted instead of the\n * [[Event_done]] event you might expect. Using [[execSqlBatch]] will prevent this from occurring but may have a negative performance impact.\n *\n * Beware of the way that scoping rules apply, and how they may [affect local temp tables](http://weblogs.sqlteam.com/mladenp/archive/2006/11/03/17197.aspx)\n * If you're running in to scoping issues, then [[execSqlBatch]] may be a better choice.\n * See also [issue #24](https://github.com/pekim/tedious/issues/24)\n *\n * @param request A [[Request]] object representing the request.\n */\n execSql(request: Request) {\n try {\n request.validateParameters(this.databaseCollation);\n } catch (error: any) {\n request.error = error;\n\n process.nextTick(() => {\n this.debug.log(error.message);\n request.callback(error);\n });\n\n return;\n }\n\n const parameters: Parameter[] = [];\n\n parameters.push({\n type: TYPES.NVarChar,\n name: 'statement',\n value: request.sqlTextOrProcedure,\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n if (request.parameters.length) {\n parameters.push({\n type: TYPES.NVarChar,\n name: 'params',\n value: request.makeParamsParameter(request.parameters),\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n parameters.push(...request.parameters);\n }\n\n this.makeRequest(request, TYPE.RPC_REQUEST, new RpcRequestPayload(Procedures.Sp_ExecuteSql, parameters, this.currentTransactionDescriptor(), this.config.options, this.databaseCollation));\n }\n\n /**\n * Creates a new BulkLoad instance.\n *\n * @param table The name of the table to bulk-insert into.\n * @param options A set of bulk load options.\n */\n newBulkLoad(table: string, callback: BulkLoadCallback): BulkLoad\n newBulkLoad(table: string, options: BulkLoadOptions, callback: BulkLoadCallback): BulkLoad\n newBulkLoad(table: string, callbackOrOptions: BulkLoadOptions | BulkLoadCallback, callback?: BulkLoadCallback) {\n let options: BulkLoadOptions;\n\n if (callback === undefined) {\n callback = callbackOrOptions as BulkLoadCallback;\n options = {};\n } else {\n options = callbackOrOptions as BulkLoadOptions;\n }\n\n if (typeof options !== 'object') {\n throw new TypeError('\"options\" argument must be an object');\n }\n return new BulkLoad(table, this.databaseCollation, this.config.options, options, callback);\n }\n\n /**\n * Execute a [[BulkLoad]].\n *\n * ```js\n * // We want to perform a bulk load into a table with the following format:\n * // CREATE TABLE employees (first_name nvarchar(255), last_name nvarchar(255), day_of_birth date);\n *\n * const bulkLoad = connection.newBulkLoad('employees', (err, rowCount) => {\n * // ...\n * });\n *\n * // First, we need to specify the columns that we want to write to,\n * // and their definitions. These definitions must match the actual table,\n * // otherwise the bulk load will fail.\n * bulkLoad.addColumn('first_name', TYPES.NVarchar, { nullable: false });\n * bulkLoad.addColumn('last_name', TYPES.NVarchar, { nullable: false });\n * bulkLoad.addColumn('date_of_birth', TYPES.Date, { nullable: false });\n *\n * // Execute a bulk load with a predefined list of rows.\n * //\n * // Note that these rows are held in memory until the\n * // bulk load was performed, so if you need to write a large\n * // number of rows (e.g. by reading from a CSV file),\n * // passing an `AsyncIterable` is advisable to keep memory usage low.\n * connection.execBulkLoad(bulkLoad, [\n * { 'first_name': 'Steve', 'last_name': 'Jobs', 'day_of_birth': new Date('02-24-1955') },\n * { 'first_name': 'Bill', 'last_name': 'Gates', 'day_of_birth': new Date('10-28-1955') }\n * ]);\n * ```\n *\n * @param bulkLoad A previously created [[BulkLoad]].\n * @param rows A [[Iterable]] or [[AsyncIterable]] that contains the rows that should be bulk loaded.\n */\n execBulkLoad(bulkLoad: BulkLoad, rows: AsyncIterable<unknown[] | { [columnName: string]: unknown }> | Iterable<unknown[] | { [columnName: string]: unknown }>): void\n\n execBulkLoad(bulkLoad: BulkLoad, rows?: AsyncIterable<unknown[] | { [columnName: string]: unknown }> | Iterable<unknown[] | { [columnName: string]: unknown }>) {\n bulkLoad.executionStarted = true;\n\n if (rows) {\n if (bulkLoad.streamingMode) {\n throw new Error(\"Connection.execBulkLoad can't be called with a BulkLoad that was put in streaming mode.\");\n }\n\n if (bulkLoad.firstRowWritten) {\n throw new Error(\"Connection.execBulkLoad can't be called with a BulkLoad that already has rows written to it.\");\n }\n\n const rowStream = Readable.from(rows);\n\n // Destroy the packet transform if an error happens in the row stream,\n // e.g. if an error is thrown from within a generator or stream.\n rowStream.on('error', (err) => {\n bulkLoad.rowToPacketTransform.destroy(err);\n });\n\n // Destroy the row stream if an error happens in the packet transform,\n // e.g. if the bulk load is cancelled.\n bulkLoad.rowToPacketTransform.on('error', (err) => {\n rowStream.destroy(err);\n });\n\n rowStream.pipe(bulkLoad.rowToPacketTransform);\n } else if (!bulkLoad.streamingMode) {\n // If the bulkload was not put into streaming mode by the user,\n // we end the rowToPacketTransform here for them.\n //\n // If it was put into streaming mode, it's the user's responsibility\n // to end the stream.\n bulkLoad.rowToPacketTransform.end();\n }\n\n const onCancel = () => {\n request.cancel();\n };\n\n const payload = new BulkLoadPayload(bulkLoad);\n\n const request = new Request(bulkLoad.getBulkInsertSql(), (error: (Error & { code?: string }) | null | undefined) => {\n bulkLoad.removeListener('cancel', onCancel);\n\n if (error) {\n if (error.code === 'UNKNOWN') {\n error.message += ' This is likely because the schema of the BulkLoad does not match the schema of the table you are attempting to insert into.';\n }\n bulkLoad.error = error;\n bulkLoad.callback(error);\n return;\n }\n\n this.makeRequest(bulkLoad, TYPE.BULK_LOAD, payload);\n });\n\n bulkLoad.once('cancel', onCancel);\n\n this.execSqlBatch(request);\n }\n\n /**\n * Prepare the SQL represented by the request.\n *\n * The request can then be used in subsequent calls to\n * [[execute]] and [[unprepare]]\n *\n * @param request A [[Request]] object representing the request.\n * Parameters only require a name and type. Parameter values are ignored.\n */\n prepare(request: Request) {\n const parameters: Parameter[] = [];\n\n parameters.push({\n type: TYPES.Int,\n name: 'handle',\n value: undefined,\n output: true,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n parameters.push({\n type: TYPES.NVarChar,\n name: 'params',\n value: request.parameters.length ? request.makeParamsParameter(request.parameters) : null,\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n parameters.push({\n type: TYPES.NVarChar,\n name: 'stmt',\n value: request.sqlTextOrProcedure,\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n request.preparing = true;\n\n // TODO: We need to clean up this event handler, otherwise this leaks memory\n request.on('returnValue', (name: string, value: any) => {\n if (name === 'handle') {\n request.handle = value;\n } else {\n request.error = new RequestError(`Tedious > Unexpected output parameter ${name} from sp_prepare`);\n }\n });\n\n this.makeRequest(request, TYPE.RPC_REQUEST, new RpcRequestPayload(Procedures.Sp_Prepare, parameters, this.currentTransactionDescriptor(), this.config.options, this.databaseCollation));\n }\n\n /**\n * Release the SQL Server resources associated with a previously prepared request.\n *\n * @param request A [[Request]] object representing the request.\n * Parameters only require a name and type.\n * Parameter values are ignored.\n */\n unprepare(request: Request) {\n const parameters: Parameter[] = [];\n\n parameters.push({\n type: TYPES.Int,\n name: 'handle',\n // TODO: Abort if `request.handle` is not set\n value: request.handle,\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n this.makeRequest(request, TYPE.RPC_REQUEST, new RpcRequestPayload(Procedures.Sp_Unprepare, parameters, this.currentTransactionDescriptor(), this.config.options, this.databaseCollation));\n }\n\n /**\n * Execute previously prepared SQL, using the supplied parameters.\n *\n * @param request A previously prepared [[Request]].\n * @param parameters An object whose names correspond to the names of\n * parameters that were added to the [[Request]] before it was prepared.\n * The object's values are passed as the parameters' values when the\n * request is executed.\n */\n execute(request: Request, parameters?: { [key: string]: unknown }) {\n const executeParameters: Parameter[] = [];\n\n executeParameters.push({\n type: TYPES.Int,\n name: '',\n // TODO: Abort if `request.handle` is not set\n value: request.handle,\n output: false,\n length: undefined,\n precision: undefined,\n scale: undefined\n });\n\n try {\n for (let i = 0, len = request.parameters.length; i < len; i++) {\n const parameter = request.parameters[i];\n\n executeParameters.push({\n ...parameter,\n value: parameter.type.validate(parameters ? parameters[parameter.name] : null, this.databaseCollation)\n });\n }\n } catch (error: any) {\n request.error = error;\n\n process.nextTick(() => {\n this.debug.log(error.message);\n request.callback(error);\n });\n\n return;\n }\n\n this.makeRequest(request, TYPE.RPC_REQUEST, new RpcRequestPayload(Procedures.Sp_Execute, executeParameters, this.currentTransactionDescriptor(), this.config.options, this.databaseCollation));\n }\n\n /**\n * Call a stored procedure represented by [[Request]].\n *\n * @param request A [[Request]] object representing the request.\n */\n callProcedure(request: Request) {\n try {\n request.validateParameters(this.databaseCollation);\n } catch (error: any) {\n request.error = error;\n\n process.nextTick(() => {\n this.debug.log(error.message);\n request.callback(error);\n });\n\n return;\n }\n\n this.makeRequest(request, TYPE.RPC_REQUEST, new RpcRequestPayload(request.sqlTextOrProcedure!, request.parameters, this.currentTransactionDescriptor(), this.config.options, this.databaseCollation));\n }\n\n /**\n * Start a transaction.\n *\n * @param callback\n * @param name A string representing a name to associate with the transaction.\n * Optional, and defaults to an empty string. Required when `isolationLevel`\n * is present.\n * @param isolationLevel The isolation level that the transaction is to be run with.\n *\n * The isolation levels are available from `require('tedious').ISOLATION_LEVEL`.\n * * `READ_UNCOMMITTED`\n * * `READ_COMMITTED`\n * * `REPEATABLE_READ`\n * * `SERIALIZABLE`\n * * `SNAPSHOT`\n *\n * Optional, and defaults to the Connection's isolation level.\n */\n beginTransaction(callback: BeginTransactionCallback, name = '', isolationLevel = this.config.options.isolationLevel) {\n assertValidIsolationLevel(isolationLevel, 'isolationLevel');\n\n const transaction = new Transaction(name, isolationLevel);\n\n if (this.config.options.tdsVersion < '7_2') {\n return this.execSqlBatch(new Request('SET TRANSACTION ISOLATION LEVEL ' + (transaction.isolationLevelToTSQL()) + ';BEGIN TRAN ' + transaction.name, (err) => {\n this.transactionDepth++;\n if (this.transactionDepth === 1) {\n this.inTransaction = true;\n }\n callback(err);\n }));\n }\n\n const request = new Request(undefined, (err) => {\n return callback(err, this.currentTransactionDescriptor());\n });\n return this.makeRequest(request, TYPE.TRANSACTION_MANAGER, transaction.beginPayload(this.currentTransactionDescriptor()));\n }\n\n /**\n * Commit a transaction.\n *\n * There should be an active transaction - that is, [[beginTransaction]]\n * should have been previously called.\n *\n * @param callback\n * @param name A string representing a name to associate with the transaction.\n * Optional, and defaults to an empty string. Required when `isolationLevel`is present.\n */\n commitTransaction(callback: CommitTransactionCallback, name = '') {\n const transaction = new Transaction(name);\n if (this.config.options.tdsVersion < '7_2') {\n return this.execSqlBatch(new Request('COMMIT TRAN ' + transaction.name, (err) => {\n this.transactionDepth--;\n if (this.transactionDepth === 0) {\n this.inTransaction = false;\n }\n\n callback(err);\n }));\n }\n const request = new Request(undefined, callback);\n return this.makeRequest(request, TYPE.TRANSACTION_MANAGER, transaction.commitPayload(this.currentTransactionDescriptor()));\n }\n\n /**\n * Rollback a transaction.\n *\n * There should be an active transaction - that is, [[beginTransaction]]\n * should have been previously called.\n *\n * @param callback\n * @param name A string representing a name to associate with the transaction.\n * Optional, and defaults to an empty string.\n * Required when `isolationLevel` is present.\n */\n rollbackTransaction(callback: RollbackTransactionCallback, name = '') {\n const transaction = new Transaction(name);\n if (this.config.options.tdsVersion < '7_2') {\n return this.execSqlBatch(new Request('ROLLBACK TRAN ' + transaction.name, (err) => {\n this.transactionDepth--;\n if (this.transactionDepth === 0) {\n this.inTransaction = false;\n }\n callback(err);\n }));\n }\n const request = new Request(undefined, callback);\n return this.makeRequest(request, TYPE.TRANSACTION_MANAGER, transaction.rollbackPayload(this.currentTransactionDescriptor()));\n }\n\n /**\n * Set a savepoint within a transaction.\n *\n * There should be an active transaction - that is, [[beginTransaction]]\n * should have been previously called.\n *\n * @param callback\n * @param name A string representing a name to associate with the transaction.\\\n * Optional, and defaults to an empty string.\n * Required when `isolationLevel` is present.\n */\n saveTransaction(callback: SaveTransactionCallback, name: string) {\n const transaction = new Transaction(name);\n if (this.config.options.tdsVersion < '7_2') {\n return this.execSqlBatch(new Request('SAVE TRAN ' + transaction.name, (err) => {\n this.transactionDepth++;\n callback(err);\n }));\n }\n const request = new Request(undefined, callback);\n return this.makeRequest(request, TYPE.TRANSACTION_MANAGER, transaction.savePayload(this.currentTransactionDescriptor()));\n }\n\n /**\n * Run the given callback after starting a transaction, and commit or\n * rollback the transaction afterwards.\n *\n * This is a helper that employs [[beginTransaction]], [[commitTransaction]],\n * [[rollbackTransaction]], and [[saveTransaction]] to greatly simplify the\n * use of database transactions and automatically handle transaction nesting.\n *\n * @param cb\n * @param isolationLevel\n * The isolation level that the transaction is to be run with.\n *\n * The isolation levels are available from `require('tedious').ISOLATION_LEVEL`.\n * * `READ_UNCOMMITTED`\n * * `READ_COMMITTED`\n * * `REPEATABLE_READ`\n * * `SERIALIZABLE`\n * * `SNAPSHOT`\n *\n * Optional, and defaults to the Connection's isolation level.\n */\n transaction(cb: (err: Error | null | undefined, txDone?: <T extends TransactionDoneCallback>(err: Error | null | undefined, done: T, ...args: CallbackParameters<T>) => void) => void, isolationLevel?: typeof ISOLATION_LEVEL[keyof typeof ISOLATION_LEVEL]) {\n if (typeof cb !== 'function') {\n throw new TypeError('`cb` must be a function');\n }\n\n const useSavepoint = this.inTransaction;\n const name = '_tedious_' + (crypto.randomBytes(10).toString('hex'));\n const txDone: <T extends TransactionDoneCallback>(err: Error | null | undefined, done: T, ...args: CallbackParameters<T>) => void = (err, done, ...args) => {\n if (err) {\n if (this.inTransaction && this.state === this.STATE.LOGGED_IN) {\n this.rollbackTransaction((txErr) => {\n done(txErr || err, ...args);\n }, name);\n } else {\n done(err, ...args);\n }\n } else if (useSavepoint) {\n if (this.config.options.tdsVersion < '7_2') {\n this.transactionDepth--;\n }\n done(null, ...args);\n } else {\n this.commitTransaction((txErr) => {\n done(txErr, ...args);\n }, name);\n }\n };\n\n if (useSavepoint) {\n return this.saveTransaction((err) => {\n if (err) {\n return cb(err);\n }\n\n if (isolationLevel) {\n return this.execSqlBatch(new Request('SET transaction isolation level ' + this.getIsolationLevelText(isolationLevel), (err) => {\n return cb(err, txDone);\n }));\n } else {\n return cb(null, txDone);\n }\n }, name);\n } else {\n return this.beginTransaction((err) => {\n if (err) {\n return cb(err);\n }\n\n return cb(null, txDone);\n }, name, isolationLevel);\n }\n }\n\n /**\n * @private\n */\n makeRequest(request: Request | BulkLoad, packetType: number, payload: (Iterable<Buffer> | AsyncIterable<Buffer>) & { toString: (indent?: string) => string }) {\n if (this.state !== this.STATE.LOGGED_IN) {\n const message = 'Requests can only be made in the ' + this.STATE.LOGGED_IN.name + ' state, not the ' + this.state.name + ' state';\n this.debug.log(message);\n request.callback(new RequestError(message, 'EINVALIDSTATE'));\n } else if (request.canceled) {\n process.nextTick(() => {\n request.callback(new RequestError('Canceled.', 'ECANCEL'));\n });\n } else {\n if (packetType === TYPE.SQL_BATCH) {\n this.isSqlBatch = true;\n } else {\n this.isSqlBatch = false;\n }\n\n this.request = request;\n request.connection! = this;\n request.rowCount! = 0;\n request.rows! = [];\n request.rst! = [];\n\n const onCancel = () => {\n payloadStream.unpipe(message);\n payloadStream.destroy(new RequestError('Canceled.', 'ECANCEL'));\n\n // set the ignore bit and end the message.\n message.ignore = true;\n message.end();\n\n if (request instanceof Request && request.paused) {\n // resume the request if it was paused so we can read the remaining tokens\n request.resume();\n }\n };\n\n request.once('cancel', onCancel);\n\n this.createRequestTimer();\n\n const message = new Message({ type: packetType, resetConnection: this.resetConnectionOnNextRequest });\n this.messageIo.outgoingMessageStream.write(message);\n this.transitionTo(this.STATE.SENT_CLIENT_REQUEST);\n\n message.once('finish', () => {\n request.removeListener('cancel', onCancel);\n request.once('cancel', this._cancelAfterRequestSent);\n\n this.resetConnectionOnNextRequest = false;\n this.debug.payload(function() {\n return payload!.toString(' ');\n });\n });\n\n const payloadStream = Readable.from(payload);\n payloadStream.once('error', (error) => {\n payloadStream.unpipe(message);\n\n // Only set a request error if no error was set yet.\n request.error ??= error;\n\n message.ignore = true;\n message.end();\n });\n payloadStream.pipe(message);\n }\n }\n\n /**\n * Cancel currently executed request.\n */\n cancel() {\n if (!this.request) {\n return false;\n }\n\n if (this.request.canceled) {\n return false;\n }\n\n this.request.cancel();\n return true;\n }\n\n /**\n * Reset the connection to its initial state.\n * Can be useful for connection pool implementations.\n *\n * @param callback\n */\n reset(callback: ResetCallback) {\n const request = new Request(this.getInitialSql(), (err) => {\n if (this.config.options.tdsVersion < '7_2') {\n this.inTransaction = false;\n }\n callback(err);\n });\n this.resetConnectionOnNextRequest = true;\n this.execSqlBatch(request);\n }\n\n /**\n * @private\n */\n currentTransactionDescriptor() {\n return this.transactionDescriptors[this.transactionDescriptors.length - 1];\n }\n\n /**\n * @private\n */\n getIsolationLevelText(isolationLevel: typeof ISOLATION_LEVEL[keyof typeof ISOLATION_LEVEL]) {\n switch (isolationLevel) {\n case ISOLATION_LEVEL.READ_UNCOMMITTED:\n return 'read uncommitted';\n case ISOLATION_LEVEL.REPEATABLE_READ:\n return 'repeatable read';\n case ISOLATION_LEVEL.SERIALIZABLE:\n return 'serializable';\n case ISOLATION_LEVEL.SNAPSHOT:\n return 'snapshot';\n default:\n return 'read committed';\n }\n }\n\n /**\n * @private\n */\n async performTlsNegotiation(preloginPayload: PreloginPayload, signal: AbortSignal) {\n signal.throwIfAborted();\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n if (preloginPayload.fedAuthRequired === 1) {\n this.fedAuthRequired = true;\n }\n if ('strict' !== this.config.options.encrypt && (preloginPayload.encryptionString === 'ON' || preloginPayload.encryptionString === 'REQ')) {\n if (!this.config.options.encrypt) {\n throw new ConnectionError(\"Server requires encryption, set 'encrypt' config option to true.\", 'EENCRYPT');\n }\n\n this.transitionTo(this.STATE.SENT_TLSSSLNEGOTIATION);\n await Promise.race([\n this.messageIo.startTls(this.secureContextOptions, this.config.options.serverName ? this.config.options.serverName : this.routingData?.server ?? this.config.server, this.config.options.trustServerCertificate).catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n }\n } finally {\n signal.removeEventListener('abort', onAbort);\n }\n }\n\n async readPreloginResponse(signal: AbortSignal): Promise<PreloginPayload> {\n signal.throwIfAborted();\n\n let messageBuffer = Buffer.alloc(0);\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n const message = await Promise.race([\n this.messageIo.readMessage().catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n\n const iterator = message[Symbol.asyncIterator]();\n try {\n while (true) {\n const { done, value } = await Promise.race([\n iterator.next(),\n signalAborted\n ]);\n\n if (done) {\n break;\n }\n\n messageBuffer = Buffer.concat([messageBuffer, value]);\n }\n } finally {\n if (iterator.return) {\n await iterator.return();\n }\n }\n } finally {\n signal.removeEventListener('abort', onAbort);\n }\n\n const preloginPayload = new PreloginPayload(messageBuffer);\n this.debug.payload(function() {\n return preloginPayload.toString(' ');\n });\n return preloginPayload;\n }\n\n /**\n * @private\n */\n async performReRouting() {\n this.socket!.removeListener('error', this._onSocketError);\n this.socket!.removeListener('close', this._onSocketClose);\n this.socket!.removeListener('end', this._onSocketEnd);\n this.socket!.destroy();\n\n this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed');\n\n this.emit('rerouting');\n this.debug.log('Rerouting to ' + this.routingData!.server + ':' + this.routingData!.port);\n\n // Attempt connecting to the rerouting target\n this.transitionTo(this.STATE.CONNECTING);\n await this.initialiseConnection();\n }\n\n /**\n * @private\n */\n async performTransientFailureRetry() {\n this.curTransientRetryCount++;\n\n this.socket!.removeListener('error', this._onSocketError);\n this.socket!.removeListener('close', this._onSocketClose);\n this.socket!.removeListener('end', this._onSocketEnd);\n this.socket!.destroy();\n\n this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed');\n\n const server = this.routingData ? this.routingData.server : this.config.server;\n const port = this.routingData ? this.routingData.port : this.config.options.port;\n this.debug.log('Retry after transient failure connecting to ' + server + ':' + port);\n\n const { promise, resolve } = withResolvers<void>();\n setTimeout(resolve, this.config.options.connectionRetryInterval);\n await promise;\n\n this.emit('retry');\n this.transitionTo(this.STATE.CONNECTING);\n await this.initialiseConnection();\n }\n\n /**\n * @private\n */\n async performSentLogin7WithStandardLogin(signal: AbortSignal): Promise<RoutingData | undefined> {\n signal.throwIfAborted();\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n const message = await Promise.race([\n this.messageIo.readMessage().catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n\n const handler = new Login7TokenHandler(this);\n const tokenStreamParser = this.createTokenStreamParser(message, handler);\n await once(tokenStreamParser, 'end');\n\n if (handler.loginAckReceived) {\n return handler.routingData;\n } else if (this.loginError) {\n throw this.loginError;\n } else {\n throw new ConnectionError('Login failed.', 'ELOGIN');\n }\n } finally {\n this.loginError = undefined;\n signal.removeEventListener('abort', onAbort);\n }\n }\n\n /**\n * @private\n */\n async performSentLogin7WithNTLMLogin(signal: AbortSignal): Promise<RoutingData | undefined> {\n signal.throwIfAborted();\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n while (true) {\n const message = await Promise.race([\n this.messageIo.readMessage().catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n\n const handler = new Login7TokenHandler(this);\n const tokenStreamParser = this.createTokenStreamParser(message, handler);\n await Promise.race([\n once(tokenStreamParser, 'end'),\n signalAborted\n ]);\n\n if (handler.loginAckReceived) {\n return handler.routingData;\n } else if (this.ntlmpacket) {\n const authentication = this.config.authentication as NtlmAuthentication;\n\n const payload = new NTLMResponsePayload({\n domain: authentication.options.domain,\n userName: authentication.options.userName,\n password: authentication.options.password,\n ntlmpacket: this.ntlmpacket\n });\n\n this.messageIo.sendMessage(TYPE.NTLMAUTH_PKT, payload.data);\n this.debug.payload(function() {\n return payload.toString(' ');\n });\n\n this.ntlmpacket = undefined;\n } else if (this.loginError) {\n throw this.loginError;\n } else {\n throw new ConnectionError('Login failed.', 'ELOGIN');\n }\n }\n } finally {\n this.loginError = undefined;\n signal.removeEventListener('abort', onAbort);\n }\n }\n\n /**\n * @private\n */\n async performSentLogin7WithFedAuth(signal: AbortSignal): Promise<RoutingData | undefined> {\n signal.throwIfAborted();\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n const message = await Promise.race([\n this.messageIo.readMessage().catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n\n const handler = new Login7TokenHandler(this);\n const tokenStreamParser = this.createTokenStreamParser(message, handler);\n await Promise.race([\n once(tokenStreamParser, 'end'),\n signalAborted\n ]);\n\n if (handler.loginAckReceived) {\n return handler.routingData;\n }\n\n const fedAuthInfoToken = handler.fedAuthInfoToken;\n\n if (fedAuthInfoToken && fedAuthInfoToken.stsurl && fedAuthInfoToken.spn) {\n /** Federated authentication configation. */\n const authentication = this.config.authentication as TokenCredentialAuthentication | AzureActiveDirectoryPasswordAuthentication | AzureActiveDirectoryMsiVmAuthentication | AzureActiveDirectoryMsiAppServiceAuthentication | AzureActiveDirectoryServicePrincipalSecret | AzureActiveDirectoryDefaultAuthentication;\n /** Permission scope to pass to Entra ID when requesting an authentication token. */\n const tokenScope = new URL('/.default', fedAuthInfoToken.spn).toString();\n\n /** Instance of the token credential to use to authenticate to the resource. */\n let credentials: TokenCredential;\n\n switch (authentication.type) {\n case 'token-credential':\n credentials = authentication.options.credential;\n break;\n case 'azure-active-directory-password':\n credentials = new UsernamePasswordCredential(\n authentication.options.tenantId ?? 'common',\n authentication.options.clientId,\n authentication.options.userName,\n authentication.options.password\n );\n break;\n case 'azure-active-directory-msi-vm':\n case 'azure-active-directory-msi-app-service':\n const msiArgs = authentication.options.clientId ? [authentication.options.clientId, {}] : [{}];\n credentials = new ManagedIdentityCredential(...msiArgs);\n break;\n case 'azure-active-directory-default':\n const args = authentication.options.clientId ? { managedIdentityClientId: authentication.options.clientId } : {};\n credentials = new DefaultAzureCredential(args);\n break;\n case 'azure-active-directory-service-principal-secret':\n credentials = new ClientSecretCredential(\n authentication.options.tenantId,\n authentication.options.clientId,\n authentication.options.clientSecret\n );\n break;\n }\n\n /** Access token retrieved from Entra ID for the configured permission scope(s). */\n let tokenResponse: AccessToken | null;\n\n try {\n tokenResponse = await Promise.race([\n credentials.getToken(tokenScope),\n signalAborted\n ]);\n } catch (err) {\n signal.throwIfAborted();\n\n throw new AggregateError(\n [new ConnectionError('Security token could not be authenticated or authorized.', 'EFEDAUTH'), err]);\n }\n\n // Type guard the token value so that it is never null.\n if (tokenResponse === null) {\n throw new AggregateError(\n [new ConnectionError('Security token could not be authenticated or authorized.', 'EFEDAUTH')]);\n }\n\n this.sendFedAuthTokenMessage(tokenResponse.token);\n // sent the fedAuth token message, the rest is similar to standard login 7\n this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN);\n return await this.performSentLogin7WithStandardLogin(signal);\n } else if (this.loginError) {\n throw this.loginError;\n } else {\n throw new ConnectionError('Login failed.', 'ELOGIN');\n }\n } finally {\n this.loginError = undefined;\n signal.removeEventListener('abort', onAbort);\n }\n }\n\n /**\n * @private\n */\n async performLoggedInSendingInitialSql(signal: AbortSignal) {\n signal.throwIfAborted();\n\n const { promise: signalAborted, reject } = withResolvers<never>();\n\n const onAbort = () => { reject(signal.reason); };\n signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n this.sendInitialSql();\n\n const message = await Promise.race([\n this.messageIo.readMessage().catch((err) => {\n throw this.wrapSocketError(err);\n }),\n signalAborted\n ]);\n\n const tokenStreamParser = this.createTokenStreamParser(message, new InitialSqlTokenHandler(this));\n await Promise.race([\n once(tokenStreamParser, 'end'),\n signalAborted\n ]);\n } finally {\n signal.removeEventListener('abort', onAbort);\n }\n }\n}\n\nfunction isTransientError(error: AggregateError | ConnectionError): boolean {\n if (error instanceof AggregateError) {\n error = error.errors[0];\n }\n return (error instanceof ConnectionError) && !!error.isTransient;\n}\n\nexport default Connection;\nmodule.exports = Connection;\n\nConnection.prototype.STATE = {\n INITIALIZED: {\n name: 'Initialized',\n events: {}\n },\n CONNECTING: {\n name: 'Connecting',\n events: {}\n },\n SENT_PRELOGIN: {\n name: 'SentPrelogin',\n events: {}\n },\n REROUTING: {\n name: 'ReRouting',\n events: {}\n },\n TRANSIENT_FAILURE_RETRY: {\n name: 'TRANSIENT_FAILURE_RETRY',\n events: {}\n },\n SENT_TLSSSLNEGOTIATION: {\n name: 'SentTLSSSLNegotiation',\n events: {}\n },\n SENT_LOGIN7_WITH_STANDARD_LOGIN: {\n name: 'SentLogin7WithStandardLogin',\n events: {}\n },\n SENT_LOGIN7_WITH_NTLM: {\n name: 'SentLogin7WithNTLMLogin',\n events: {}\n },\n SENT_LOGIN7_WITH_FEDAUTH: {\n name: 'SentLogin7WithFedauth',\n events: {}\n },\n LOGGED_IN_SENDING_INITIAL_SQL: {\n name: 'LoggedInSendingInitialSql',\n events: {}\n },\n LOGGED_IN: {\n name: 'LoggedIn',\n events: {\n socketError: function() {\n this.transitionTo(this.STATE.FINAL);\n this.cleanupConnection();\n }\n }\n },\n SENT_CLIENT_REQUEST: {\n name: 'SentClientRequest',\n enter: function() {\n (async () => {\n let message;\n try {\n message = await this.messageIo.readMessage();\n } catch (err: any) {\n this.dispatchEvent('socketError', err);\n process.nextTick(() => {\n this.emit('error', this.wrapSocketError(err));\n });\n return;\n }\n // request timer is stopped on first data package\n this.clearRequestTimer();\n\n const tokenStreamParser = this.createTokenStreamParser(message, new RequestTokenHandler(this, this.request!));\n\n // If the request was canceled and we have a `cancelTimer`\n // defined, we send a attention message after the\n // request message was fully sent off.\n //\n // We already started consuming the current message\n // (but all the token handlers should be no-ops), and\n // need to ensure the next message is handled by the\n // `SENT_ATTENTION` state.\n if (this.request?.canceled && this.cancelTimer) {\n return this.transitionTo(this.STATE.SENT_ATTENTION);\n }\n\n const onResume = () => {\n tokenStreamParser.resume();\n };\n const onPause = () => {\n tokenStreamParser.pause();\n\n this.request?.once('resume', onResume);\n };\n\n this.request?.on('pause', onPause);\n\n if (this.request instanceof Request && this.request.paused) {\n onPause();\n }\n\n const onCancel = () => {\n tokenStreamParser.removeListener('end', onEndOfMessage);\n\n if (this.request instanceof Request && this.request.paused) {\n // resume the request if it was paused so we can read the remaining tokens\n this.request.resume();\n }\n\n this.request?.removeListener('pause', onPause);\n this.request?.removeListener('resume', onResume);\n\n // The `_cancelAfterRequestSent` callback will have sent a\n // attention message, so now we need to also switch to\n // the `SENT_ATTENTION` state to make sure the attention ack\n // message is processed correctly.\n this.transitionTo(this.STATE.SENT_ATTENTION);\n };\n\n const onEndOfMessage = () => {\n this.request?.removeListener('cancel', this._cancelAfterRequestSent);\n this.request?.removeListener('cancel', onCancel);\n this.request?.removeListener('pause', onPause);\n this.request?.removeListener('resume', onResume);\n\n this.transitionTo(this.STATE.LOGGED_IN);\n const sqlRequest = this.request as Request;\n this.request = undefined;\n if (this.config.options.tdsVersion < '7_2' && sqlRequest.error && this.isSqlBatch) {\n this.inTransaction = false;\n }\n sqlRequest.callback(sqlRequest.error, sqlRequest.rowCount, sqlRequest.rows);\n };\n\n tokenStreamParser.once('end', onEndOfMessage);\n this.request?.once('cancel', onCancel);\n })();\n\n },\n exit: function(nextState) {\n this.clearRequestTimer();\n },\n events: {\n socketError: function(err) {\n const sqlRequest = this.request!;\n this.request = undefined;\n this.transitionTo(this.STATE.FINAL);\n this.cleanupConnection();\n\n sqlRequest.callback(err);\n }\n }\n },\n SENT_ATTENTION: {\n name: 'SentAttention',\n enter: function() {\n (async () => {\n let message;\n try {\n message = await this.messageIo.readMessage();\n } catch (err: any) {\n this.dispatchEvent('socketError', err);\n process.nextTick(() => {\n this.emit('error', this.wrapSocketError(err));\n });\n return;\n }\n\n const handler = new AttentionTokenHandler(this, this.request!);\n const tokenStreamParser = this.createTokenStreamParser(message, handler);\n\n await once(tokenStreamParser, 'end');\n // 3.2.5.7 Sent Attention State\n // Discard any data contained in the response, until we receive the attention response\n if (handler.attentionReceived) {\n this.clearCancelTimer();\n\n const sqlRequest = this.request!;\n this.request = undefined;\n this.transitionTo(this.STATE.LOGGED_IN);\n\n if (sqlRequest.error && sqlRequest.error instanceof RequestError && sqlRequest.error.code === 'ETIMEOUT') {\n sqlRequest.callback(sqlRequest.error);\n } else {\n sqlRequest.callback(new RequestError('Canceled.', 'ECANCEL'));\n }\n }\n })().catch((err) => {\n process.nextTick(() => {\n throw err;\n });\n });\n },\n events: {\n socketError: function(err) {\n const sqlRequest = this.request!;\n this.request = undefined;\n\n this.transitionTo(this.STATE.FINAL);\n this.cleanupConnection();\n\n sqlRequest.callback(err);\n }\n }\n },\n FINAL: {\n name: 'Final',\n events: {}\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,GAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAA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,KAAK,CAAC8C,IAAI,KAAK,UAAU,EAAE;YACxGiQ,UAAU,CAACjO,QAAQ,CAACiO,UAAU,CAAC/S,KAAK,CAAC;UACvC,CAAC,MAAM;YACL+S,UAAU,CAACjO,QAAQ,CAAC,IAAID,oBAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;UAC/D;QACF;MACF,CAAC,EAAE,CAAC,CAACsL,KAAK,CAAExP,GAAG,IAAK;QAClBT,OAAO,CAACC,QAAQ,CAAC,MAAM;UACrB,MAAMQ,GAAG;QACX,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC;IACDuG,MAAM,EAAE;MACNsL,WAAW,EAAE,SAAAA,CAAS7R,GAAG,EAAE;QACzB,MAAMoS,UAAU,GAAG,IAAI,CAACnO,OAAQ;QAChC,IAAI,CAACA,OAAO,GAAGrL,SAAS;QAExB,IAAI,CAACwH,YAAY,CAAC,IAAI,CAAC5B,KAAK,CAACgC,KAAK,CAAC;QACnC,IAAI,CAACM,iBAAiB,CAAC,CAAC;QAExBsR,UAAU,CAACjO,QAAQ,CAACnE,GAAG,CAAC;MAC1B;IACF;EACF,CAAC;EACDQ,KAAK,EAAE;IACLV,IAAI,EAAE,OAAO;IACbyG,MAAM,EAAE,CAAC;EACX;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import net from 'net';
|
|
2
|
+
import dns from 'dns';
|
|
3
|
+
type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void;
|
|
4
|
+
export declare function connectInParallel(options: {
|
|
5
|
+
host: string;
|
|
6
|
+
port: number;
|
|
7
|
+
localAddress?: string | undefined;
|
|
8
|
+
}, lookup: LookupFunction, signal: AbortSignal): Promise<net.Socket>;
|
|
9
|
+
export declare function connectInSequence(options: {
|
|
10
|
+
host: string;
|
|
11
|
+
port: number;
|
|
12
|
+
localAddress?: string | undefined;
|
|
13
|
+
}, lookup: LookupFunction, signal: AbortSignal): Promise<net.Socket>;
|
|
14
|
+
/**
|
|
15
|
+
* Look up all addresses for the given hostname.
|
|
16
|
+
*/
|
|
17
|
+
export declare function lookupAllAddresses(host: string, lookup: LookupFunction, signal: AbortSignal): Promise<dns.LookupAddress[]>;
|
|
18
|
+
export {};
|