This commit is contained in:
Benjamin Toby
2024-11-11 09:34:43 +01:00
parent 9f1d18ed0d
commit 4b13c5264d
238 changed files with 829 additions and 379 deletions
@@ -0,0 +1,9 @@
export = DB_HANDLER;
/**
* DSQL user read-only DB handler
* @param {object} params
* @param {string} params.paradigm
* @param {string} params.database
* @param {string} params.queryString
* @param {string[]} [params.queryValues]
*/ declare function DB_HANDLER(...args: any[]): Promise<any>;
@@ -0,0 +1,18 @@
export = DSQL_USER_DB_HANDLER;
/**
* DSQL user read-only DB handler
* @param {object} params
* @param {"Full Access" | "FA" | "Read Only"} params.paradigm
* @param {string} params.database
* @param {string} params.queryString
* @param {string[]} [params.queryValues]
*/
declare function DSQL_USER_DB_HANDLER({ paradigm, database, queryString, queryValues, }: {
paradigm: "Full Access" | "FA" | "Read Only";
database: string;
queryString: string;
queryValues?: string[];
}): Promise<any> | {
success: boolean;
error: any;
};
+4
View File
@@ -0,0 +1,4 @@
declare function _exports(): string | (import("tls").SecureContextOptions & {
rejectUnauthorized?: boolean | undefined;
}) | undefined;
export = _exports;
@@ -7,12 +7,17 @@ const fs = require("fs");
*/
module.exports = function grabDbSSL() {
const SSL_DIR = process.env.DSQL_SSL_DIR;
if (!SSL_DIR?.match(/./)) return undefined;
if (!SSL_DIR?.match(/./)) {
// console.log(
// "No SSL certificate provided. Query will run in normal mode. To add SSL add an env path dir `DSQL_SSL_DIR` with a file named `ca-cert.pem`"
// );
return undefined;
}
const caFilePath = `${SSL_DIR}/ca-cert.pem`;
if (!fs.existsSync(caFilePath)) {
console.log(`${caFilePath} does not exist`);
return undefined;
}