This commit is contained in:
Benjamin Toby
2025-04-18 12:06:15 +01:00
parent 8d38f99bf1
commit 6593047efd
180 changed files with 3965 additions and 2 deletions
@@ -0,0 +1,8 @@
export type ExportMariaDBDatabaseParam = {
dbFullName: string;
targetFilePath: string;
mariadbUser?: string;
mariadbHost?: string;
mariadbPass?: string;
};
export default function exportMariadbDatabase({ dbFullName, targetFilePath, mariadbHost, mariadbPass, mariadbUser, }: ExportMariaDBDatabaseParam): string | Buffer<ArrayBufferLike>;
@@ -0,0 +1,5 @@
/**
* # DSQL user read-only DB handler
* @requires DSQL_DB_CONN - Gobal Variable for Datasquirel Database
*/
export default function DB_HANDLER(...args: any[]): Promise<any>;
@@ -0,0 +1,10 @@
type Param = {
paradigm: "Full Access" | "FA" | "Read Only";
queryString: string;
queryValues?: string[];
};
/**
* # DSQL user read-only DB handler
*/
export default function DSQL_USER_DB_HANDLER({ paradigm, queryString, queryValues, }: Param): Promise<any>;
export {};
@@ -0,0 +1,4 @@
/**
* # DSQL user read-only DB handler
*/
export default function LOCAL_DB_HANDLER(...args: any[]): Promise<any>;
@@ -0,0 +1,7 @@
/**
* # DSQL user read-only DB handler
*/
export default function NO_DB_HANDLER(...args: any[]): Promise<unknown> | {
success: boolean;
error: any;
};
@@ -0,0 +1,7 @@
/**
* # Root DB handler
*/
export default function ROOT_DB_HANDLER(...args: any[]): Promise<unknown> | {
success: boolean;
error: any;
};
+8
View File
@@ -0,0 +1,8 @@
type Return = string | (import("tls").SecureContextOptions & {
rejectUnauthorized?: boolean | undefined;
}) | undefined;
/**
* # Grall SSL
*/
export default function grabDbSSL(): Return;
export {};
@@ -0,0 +1,8 @@
export type ExportMariaDBDatabaseParam = {
dbFullName: string;
targetFilePath: string;
mariadbUser?: string;
mariadbHost?: string;
mariadbPass?: string;
};
export default function importMariadbDatabase({ dbFullName, targetFilePath, mariadbHost, mariadbPass, mariadbUser, }: ExportMariaDBDatabaseParam): Promise<string | Buffer<ArrayBufferLike>>;
@@ -0,0 +1,34 @@
import { DATASQUIREL_LoggedInUser, UserType } from "../../../types";
type Param = {
user?: DATASQUIREL_LoggedInUser | UserType;
userId?: string | number | null;
appDir?: string;
};
export default function grabDirNames(param?: Param): {
appDir: string;
schemasDir: string;
userDirPath: string | undefined;
mainShemaJSONFilePath: string;
mainDbTypeDefFile: string;
tempDirName: string;
defaultTableFieldsJSONFilePath: string;
usersSchemaDir: string;
userSchemaMainJSONFilePath: string | undefined;
userPrivateMediaDir: string | undefined;
userPrivateExportsDir: string | undefined;
userPrivateSQLExportsDir: string | undefined;
userPrivateTempSQLExportsDir: string | undefined;
userPrivateTempJSONSchemaFilePath: string | undefined;
userPrivateDbExportZipFileName: string;
userPrivateDbExportZipFilePath: string | undefined;
userPrivateDbImportZipFileName: string;
userPrivateDbImportZipFilePath: string | undefined;
dbNginxLoadBalancerConfigFile: string;
dockerComposeFile: string;
testDockerComposeFile: string;
extraDockerComposeFile: string;
siteSetupFile: string;
envFile: string;
testEnvFile: string;
};
export {};
@@ -0,0 +1,6 @@
type Param = {
str: string;
userId: string | number;
};
export default function replaceDatasquirelDbName({ str, userId, }: Param): string;
export {};
+16
View File
@@ -0,0 +1,16 @@
import { IncomingMessage } from "http";
/**
* Parse request cookies
* ===================================================
*
* @description This function takes in a request object and
* returns the cookies as a JS object
*/
export default function parseCookies({ request, cookieString, }: {
request?: IncomingMessage & {
[s: string]: any;
};
cookieString?: string;
}): {
[s: string]: string;
};