mssql 10.0.0 → 10.0.2
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/bin/mssql
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const { Command } = require('commander')
|
|
3
3
|
const { version } = require('../package.json')
|
|
4
|
-
const { resolve: resolvePath } = require('path')
|
|
5
|
-
const { constants: { R_OK } } = require('fs')
|
|
4
|
+
const { resolve: resolvePath } = require('node:path')
|
|
5
|
+
const { constants: { R_OK } } = require('node:fs')
|
|
6
6
|
const { ConnectionPool } = require('../')
|
|
7
|
-
const { lstat, access, readFile } = require('fs')
|
|
7
|
+
const { lstat, access, readFile } = require('node:fs/promises')
|
|
8
8
|
Buffer.prototype.toJSON = () => {
|
|
9
9
|
return `0x${this.toString('hex')}`
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { EventEmitter } = require('events')
|
|
3
|
+
const { EventEmitter } = require('node:events')
|
|
4
4
|
const debug = require('debug')('mssql:base')
|
|
5
5
|
const { parseSqlConnectionString } = require('@tediousjs/connection-string')
|
|
6
6
|
const tarn = require('tarn')
|
|
@@ -363,7 +363,7 @@ class ConnectionPool extends EventEmitter {
|
|
|
363
363
|
*/
|
|
364
364
|
|
|
365
365
|
acquire (requester, callback) {
|
|
366
|
-
const acquirePromise = shared.Promise.resolve(this._acquire()
|
|
366
|
+
const acquirePromise = shared.Promise.resolve(this._acquire()).catch(err => {
|
|
367
367
|
this.emit('error', err)
|
|
368
368
|
throw err
|
|
369
369
|
})
|
|
@@ -382,7 +382,7 @@ class ConnectionPool extends EventEmitter {
|
|
|
382
382
|
return shared.Promise.reject(new ConnectionError('Connection is closing', 'ENOTOPEN'))
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
return this.pool.acquire()
|
|
385
|
+
return this.pool.acquire().promise
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const debug = require('debug')('mssql:base')
|
|
4
|
-
const { EventEmitter } = require('events')
|
|
4
|
+
const { EventEmitter } = require('node:events')
|
|
5
5
|
const { IDS, objectHasProperty } = require('../utils')
|
|
6
6
|
const globalConnection = require('../global-connection')
|
|
7
7
|
const { TransactionError, PreparedStatementError } = require('../error')
|
|
@@ -91,7 +91,7 @@ class PreparedStatement extends EventEmitter {
|
|
|
91
91
|
*/
|
|
92
92
|
|
|
93
93
|
input (name, type) {
|
|
94
|
-
if (
|
|
94
|
+
if (/--| |\/\*|\*\/|'/.test(name)) {
|
|
95
95
|
throw new PreparedStatementError(`SQL injection warning for param '${name}'`, 'EINJECT')
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -144,7 +144,7 @@ class PreparedStatement extends EventEmitter {
|
|
|
144
144
|
*/
|
|
145
145
|
|
|
146
146
|
output (name, type) {
|
|
147
|
-
if (
|
|
147
|
+
if (/--| |\/\*|\*\/|'/.test(name)) {
|
|
148
148
|
throw new PreparedStatementError(`SQL injection warning for param '${name}'`, 'EINJECT')
|
|
149
149
|
}
|
|
150
150
|
|
package/lib/base/request.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const debug = require('debug')('mssql:base')
|
|
4
|
-
const { EventEmitter } = require('events')
|
|
5
|
-
const { Readable } = require('stream')
|
|
4
|
+
const { EventEmitter } = require('node:events')
|
|
5
|
+
const { Readable } = require('node:stream')
|
|
6
6
|
const { IDS, objectHasProperty } = require('../utils')
|
|
7
7
|
const globalConnection = require('../global-connection')
|
|
8
8
|
const { RequestError, ConnectionError } = require('../error')
|
|
@@ -107,7 +107,7 @@ class Request extends EventEmitter {
|
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
109
|
input (name, type, value) {
|
|
110
|
-
if (
|
|
110
|
+
if (/--| |\/\*|\*\/|'/.test(name)) {
|
|
111
111
|
throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -170,7 +170,7 @@ class Request extends EventEmitter {
|
|
|
170
170
|
output (name, type, value) {
|
|
171
171
|
if (!type) { type = TYPES.NVarChar }
|
|
172
172
|
|
|
173
|
-
if (
|
|
173
|
+
if (/--| |\/\*|\*\/|'/.test(name)) {
|
|
174
174
|
throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
|
|
175
175
|
}
|
|
176
176
|
|
package/lib/base/transaction.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const debug = require('debug')('mssql:base')
|
|
4
|
-
const { EventEmitter } = require('events')
|
|
4
|
+
const { EventEmitter } = require('node:events')
|
|
5
5
|
const { IDS } = require('../utils')
|
|
6
6
|
const globalConnection = require('../global-connection')
|
|
7
7
|
const { TransactionError } = require('../error')
|
|
@@ -6,7 +6,7 @@ const BaseConnectionPool = require('../base/connection-pool')
|
|
|
6
6
|
const { IDS, INCREMENT } = require('../utils')
|
|
7
7
|
const shared = require('../shared')
|
|
8
8
|
const ConnectionError = require('../error/connection-error')
|
|
9
|
-
const { platform } = require('os')
|
|
9
|
+
const { platform } = require('node:os')
|
|
10
10
|
const { buildConnectionString } = require('@tediousjs/connection-string')
|
|
11
11
|
|
|
12
12
|
const CONNECTION_DRIVER = ['darwin', 'linux'].includes(platform()) ? 'ODBC Driver 17 for SQL Server' : 'SQL Server Native Client 11.0'
|
package/package.json
CHANGED
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
"azure",
|
|
22
22
|
"node-mssql"
|
|
23
23
|
],
|
|
24
|
-
"version": "10.0.
|
|
24
|
+
"version": "10.0.2",
|
|
25
25
|
"main": "index.js",
|
|
26
|
+
"type": "commonjs",
|
|
26
27
|
"repository": "github:tediousjs/node-mssql",
|
|
27
28
|
"license": "MIT",
|
|
28
29
|
"dependencies": {
|
|
@@ -34,18 +35,18 @@
|
|
|
34
35
|
"tedious": "^16.4.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "^
|
|
38
|
-
"@commitlint/config-conventional": "^
|
|
39
|
-
"@semantic-release/commit-analyzer": "^
|
|
38
|
+
"@commitlint/cli": "^18.0.0",
|
|
39
|
+
"@commitlint/config-conventional": "^18.0.0",
|
|
40
|
+
"@semantic-release/commit-analyzer": "^11.0.0",
|
|
40
41
|
"@semantic-release/github": "^9.0.3",
|
|
41
|
-
"@semantic-release/npm": "^
|
|
42
|
-
"@semantic-release/release-notes-generator": "^
|
|
42
|
+
"@semantic-release/npm": "^11.0.0",
|
|
43
|
+
"@semantic-release/release-notes-generator": "^12.0.0",
|
|
43
44
|
"mocha": "^10.0.0",
|
|
44
|
-
"semantic-release": "^
|
|
45
|
+
"semantic-release": "^22.0.0",
|
|
45
46
|
"standard": "^17.0.0"
|
|
46
47
|
},
|
|
47
48
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
49
|
+
"node": ">=14"
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"lib/",
|