stimulsoft-data-adapter 2022.1.5 → 2022.1.6
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 +39 -14
- 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.
|
|
3
|
+
Version: 2022.1.6
|
|
4
|
+
Build date: 2022.02.11
|
|
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.6";
|
|
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.
|
|
3
|
+
Version: 2022.1.6
|
|
4
|
+
Build date: 2022.02.11
|
|
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.6";
|
|
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.
|
|
3
|
+
Version: 2022.1.6
|
|
4
|
+
Build date: 2022.02.11
|
|
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.6";
|
|
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.
|
|
3
|
+
Version: 2022.1.6
|
|
4
|
+
Build date: 2022.02.11
|
|
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.6";
|
|
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.
|
|
3
|
+
Version: 2022.1.6
|
|
4
|
+
Build date: 2022.02.11
|
|
5
5
|
License: https://www.stimulsoft.com/en/licensing/reports
|
|
6
6
|
*/
|
|
7
7
|
var http = require('http');
|
|
@@ -25,22 +25,41 @@ function accept(req, res) {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
req.on('end', function () {
|
|
28
|
-
|
|
28
|
+
var encryptResult = false;
|
|
29
|
+
|
|
30
|
+
if (typeof data === "string" && !data.startsWith("{")) {
|
|
29
31
|
data = Buffer.from(data.replace(/[A-Za-z]/g, function (c) {
|
|
30
32
|
return String.fromCharCode(c.charCodeAt(0) + (c.toUpperCase() <= "M" ? 13 : -13));
|
|
31
33
|
}), "base64").toString("ascii");
|
|
32
|
-
|
|
34
|
+
// encryptResult = true;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
var onProcessHandler = onProcess.bind(null, encryptResult);
|
|
36
38
|
|
|
37
|
-
command
|
|
39
|
+
var command = null;
|
|
40
|
+
try {
|
|
41
|
+
command = JSON.parse(data.toString());
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
console.log(e.message);
|
|
45
|
+
return onProcessHandler({ success: false, notice: e.message });
|
|
46
|
+
}
|
|
38
47
|
|
|
39
|
-
if (command.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
if (command.command === "GetSupportedAdapters") {
|
|
49
|
+
let result = {
|
|
50
|
+
success: true,
|
|
51
|
+
types: ["MySQL", "MS SQL", "Firebird", "PostgreSQL"]
|
|
52
|
+
};
|
|
53
|
+
onProcessHandler(result);
|
|
54
|
+
} else {
|
|
55
|
+
command.queryString = applyQueryParameters(command.queryString, command.parameters, command.escapeQueryParameters);
|
|
56
|
+
|
|
57
|
+
if (command.database == "MySQL") MySQLAdapter.process(command, onProcessHandler);
|
|
58
|
+
else if (command.database == "Firebird") FirebirdAdapter.process(command, onProcessHandler);
|
|
59
|
+
else if (command.database == "MS SQL") MSSQLAdapter.process(command, onProcessHandler);
|
|
60
|
+
else if (command.database == "PostgreSQL") PostgreSQLAdapter.process(command, onProcessHandler);
|
|
61
|
+
else onProcessHandler({ success: false, notice: "Database '" + command.database + "' not supported!" });
|
|
62
|
+
}
|
|
44
63
|
});
|
|
45
64
|
}
|
|
46
65
|
|
|
@@ -81,9 +100,15 @@ var applyQueryParameters = function (baseSqlCommand, parameters, escapeQueryPara
|
|
|
81
100
|
return result + baseSqlCommand;
|
|
82
101
|
}
|
|
83
102
|
|
|
84
|
-
var onProcess = function (result) {
|
|
85
|
-
result.handlerVersion = "2022.1.
|
|
86
|
-
|
|
103
|
+
var onProcess = function (encryptData, result) {
|
|
104
|
+
result.handlerVersion = "2022.1.6";
|
|
105
|
+
result = JSON.stringify(result);
|
|
106
|
+
if (encryptData) {
|
|
107
|
+
result = Buffer.from(result).toString("base64").replace(/[A-Za-z]/g, function (c) {
|
|
108
|
+
return String.fromCharCode(c.charCodeAt(0) + (c.toUpperCase() <= "M" ? 13 : -13));
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
response.end(result);
|
|
87
112
|
}
|
|
88
113
|
|
|
89
114
|
http.createServer(accept).listen(9615);
|