stimulsoft-data-adapter 2022.1.3 → 2022.1.4
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/FirebirdAdapter.js +3 -3
- package/MSSQLAdapter.js +3 -3
- package/MySQLAdapter.js +3 -3
- package/PostgreSQLAdapter.js +3 -3
- package/app.js +14 -31
- package/package.json +1 -1
package/FirebirdAdapter.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Stimulsoft.Reports.JS
|
|
3
|
-
Version: 2022.1.
|
|
4
|
-
Build date: 2022.01.
|
|
3
|
+
Version: 2022.1.4
|
|
4
|
+
Build date: 2022.01.14
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
exports.process = function (command, onResult) {
|
|
8
8
|
var end = function (result) {
|
|
9
9
|
try {
|
|
10
10
|
if (db) db.detach();
|
|
11
|
-
result.adapterVersion = "2022.1.
|
|
11
|
+
result.adapterVersion = "2022.1.4";
|
|
12
12
|
onResult(result);
|
|
13
13
|
}
|
|
14
14
|
catch (e) {
|
package/MSSQLAdapter.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Stimulsoft.Reports.JS
|
|
3
|
-
Version: 2022.1.
|
|
4
|
-
Build date: 2022.01.
|
|
3
|
+
Version: 2022.1.4
|
|
4
|
+
Build date: 2022.01.14
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
exports.process = function (command, onResult) {
|
|
8
8
|
var end = function (result) {
|
|
9
9
|
try {
|
|
10
10
|
if (connection) connection.close();
|
|
11
|
-
result.adapterVersion = "2022.1.
|
|
11
|
+
result.adapterVersion = "2022.1.4";
|
|
12
12
|
onResult(result);
|
|
13
13
|
}
|
|
14
14
|
catch (e) {
|
package/MySQLAdapter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Stimulsoft.Reports.JS
|
|
3
|
-
Version: 2022.1.
|
|
4
|
-
Build date: 2022.01.
|
|
3
|
+
Version: 2022.1.4
|
|
4
|
+
Build date: 2022.01.14
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
exports.process = function (command, onResult) {
|
|
@@ -10,7 +10,7 @@ exports.process = function (command, onResult) {
|
|
|
10
10
|
if (connection) {
|
|
11
11
|
connection.end();
|
|
12
12
|
}
|
|
13
|
-
result.adapterVersion = "2022.1.
|
|
13
|
+
result.adapterVersion = "2022.1.4";
|
|
14
14
|
onResult(result);
|
|
15
15
|
}
|
|
16
16
|
catch (e) {
|
package/PostgreSQLAdapter.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Stimulsoft.Reports.JS
|
|
3
|
-
Version: 2022.1.
|
|
4
|
-
Build date: 2022.01.
|
|
3
|
+
Version: 2022.1.4
|
|
4
|
+
Build date: 2022.01.14
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
exports.process = function (command, onResult) {
|
|
8
8
|
var end = function (result) {
|
|
9
9
|
try {
|
|
10
10
|
if (client) client.end();
|
|
11
|
-
result.adapterVersion = "2022.1.
|
|
11
|
+
result.adapterVersion = "2022.1.4";
|
|
12
12
|
onResult(result);
|
|
13
13
|
}
|
|
14
14
|
catch (e) {
|
package/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Stimulsoft.Reports.JS
|
|
3
|
-
Version: 2022.1.
|
|
4
|
-
Build date: 2022.01.
|
|
3
|
+
Version: 2022.1.4
|
|
4
|
+
Build date: 2022.01.14
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
var http = require('http');
|
|
@@ -10,8 +10,8 @@ var FirebirdAdapter = require('./FirebirdAdapter');
|
|
|
10
10
|
var MSSQLAdapter = require('./MSSQLAdapter');
|
|
11
11
|
var PostgreSQLAdapter = require('./PostgreSQLAdapter');
|
|
12
12
|
|
|
13
|
+
var connectionStringBuilder;
|
|
13
14
|
var response;
|
|
14
|
-
|
|
15
15
|
function accept(req, res) {
|
|
16
16
|
response = res;
|
|
17
17
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
@@ -25,33 +25,22 @@ function accept(req, res) {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
req.on('end', function () {
|
|
28
|
-
|
|
29
|
-
if (!data.startsWith("{")) {
|
|
28
|
+
if (data.indexOf("{") != 0) {
|
|
30
29
|
data = Buffer.from(data.replace(/[A-Za-z]/g, function (c) {
|
|
31
30
|
return String.fromCharCode(c.charCodeAt(0) + (c.toUpperCase() <= "M" ? 13 : -13));
|
|
32
31
|
}), "base64").toString("ascii");
|
|
33
|
-
encryptResult = true;
|
|
34
|
-
}
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
}
|
|
37
34
|
|
|
38
35
|
command = JSON.parse(data.toString());
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
let result = {
|
|
42
|
-
success: true,
|
|
43
|
-
types: ["MySQL", "MS SQL", "Firebird", "PostgreSQL"]
|
|
44
|
-
};
|
|
45
|
-
onProcessHandler(result);
|
|
46
|
-
} else {
|
|
47
|
-
command.queryString = applyQueryParameters(command.queryString, command.parameters, command.escapeQueryParameters);
|
|
37
|
+
command.queryString = applyQueryParameters(command.queryString, command.parameters, command.escapeQueryParameters);
|
|
48
38
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
39
|
+
if (command.database == "MySQL") MySQLAdapter.process(command, onProcess);
|
|
40
|
+
else if (command.database == "Firebird") FirebirdAdapter.process(command, onProcess);
|
|
41
|
+
else if (command.database == "MS SQL") MSSQLAdapter.process(command, onProcess);
|
|
42
|
+
else if (command.database == "PostgreSQL") PostgreSQLAdapter.process(command, onProcess);
|
|
43
|
+
else onResult({ success: false, notice: "Database '" + command.database + "' not supported!" });
|
|
55
44
|
});
|
|
56
45
|
}
|
|
57
46
|
|
|
@@ -92,15 +81,9 @@ var applyQueryParameters = function (baseSqlCommand, parameters, escapeQueryPara
|
|
|
92
81
|
return result + baseSqlCommand;
|
|
93
82
|
}
|
|
94
83
|
|
|
95
|
-
var onProcess = function (
|
|
96
|
-
result.handlerVersion = "2022.1.
|
|
97
|
-
|
|
98
|
-
if (encryptData) {
|
|
99
|
-
result = Buffer.from(result).toString("base64").replace(/[A-Za-z]/g, function (c) {
|
|
100
|
-
return String.fromCharCode(c.charCodeAt(0) + (c.toUpperCase() <= "M" ? 13 : -13));
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
response.end(result);
|
|
84
|
+
var onProcess = function (result) {
|
|
85
|
+
result.handlerVersion = "2022.1.4";
|
|
86
|
+
response.end(JSON.stringify(result));
|
|
104
87
|
}
|
|
105
88
|
|
|
106
89
|
http.createServer(accept).listen(9615);
|