@heyhru/app-dms-server 0.3.3 → 0.3.7
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/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var PERMISSIONS = {
|
|
|
55
55
|
"POST /datasources/delete": { auth: true, roles: ["admin"] },
|
|
56
56
|
// SQL
|
|
57
57
|
"POST /sql/parse": { auth: true },
|
|
58
|
-
"POST /sql/execute": { auth: true, roles: ["admin", "maintainer", "developer"] },
|
|
58
|
+
"POST /sql/execute": { auth: true, roles: ["admin", "maintainer", "developer", "viewer"] },
|
|
59
59
|
"POST /sql/databases": { auth: true },
|
|
60
60
|
"POST /sql/tables": { auth: true },
|
|
61
61
|
// Approvals
|
|
@@ -448,7 +448,7 @@ async function postSqlDatabases(req, reply) {
|
|
|
448
448
|
...ds,
|
|
449
449
|
database: ds.database ?? (ds.type === "postgres" ? "postgres" : "")
|
|
450
450
|
});
|
|
451
|
-
const sql = ds.type === "mysql" ? "SHOW DATABASES" : "SELECT datname FROM pg_database WHERE datistemplate = false ORDER BY datname";
|
|
451
|
+
const sql = ds.type === "mysql" ? "SHOW DATABASES" : "SELECT datname FROM pg_database WHERE datistemplate = false AND datname NOT IN ('cloudsqladmin') ORDER BY datname";
|
|
452
452
|
try {
|
|
453
453
|
const rows = await pool.execute(sql);
|
|
454
454
|
const names = rows.map(
|
|
@@ -616,7 +616,7 @@ async function approvalExecute(req, reply) {
|
|
|
616
616
|
}
|
|
617
617
|
async function doExecuteApproval(id, userId, ip, log) {
|
|
618
618
|
const approval = await getApprovalById(id);
|
|
619
|
-
if (!approval || approval["status"]
|
|
619
|
+
if (!approval || !["approved", "execute_failed"].includes(approval["status"])) {
|
|
620
620
|
throw new Error("\u5BA1\u6279\u8BB0\u5F55\u4E0D\u5B58\u5728\u6216\u672A\u901A\u8FC7\u5BA1\u6279");
|
|
621
621
|
}
|
|
622
622
|
await setExecuting(id);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.7",
|
|
7
7
|
"description": "DMS backend API server built on Fastify",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.mjs",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"typescript": "^6.0.2",
|
|
37
37
|
"vitest": "^4.1.2"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5844861336ff4df88282f00a0eecd3a9a1fb50ea"
|
|
40
40
|
}
|