Update Types
This commit is contained in:
+1
-1
@@ -48,6 +48,6 @@ try {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Dump Error: ", error.message);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ module.exports = async function addUsersTableToDb({ dbSchema }) {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log(error.message);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -243,7 +243,7 @@ async function createDbFromSchema(dbSchema) {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Error in createDbFromSchema => ", error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ module.exports = async function dbHandler({ query, values, database }) {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("DB handler error:", error.message);
|
||||
|
||||
results = null;
|
||||
|
||||
@@ -72,7 +72,7 @@ module.exports = async function noDatabaseDbHandler({ query, values }) {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("ERROR in noDatabaseDbHandler =>", error.message);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ module.exports = async function parseDbResults({ unparsedResults, tableSchema })
|
||||
* @description Declare "results" variable
|
||||
*/
|
||||
return parsedResults;
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("ERROR in parseDbResults Function =>", error.message);
|
||||
return unparsedResults;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ module.exports = async function updateTable({ dbFullName, tableName, tableInfoAr
|
||||
////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @type {DSQL_MYSQL_SHOW_INDEXES_Type[] | null}
|
||||
* @type {*}
|
||||
* @description All indexes from MYSQL db
|
||||
*/
|
||||
const allExistingIndexes = await varDatabaseDbHandler({
|
||||
@@ -88,7 +88,7 @@ module.exports = async function updateTable({ dbFullName, tableName, tableInfoAr
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {DSQL_MYSQL_SHOW_COLUMNS_Type[] | null}
|
||||
* @type {*}
|
||||
* @description All columns from MYSQL db
|
||||
*/
|
||||
const allExistingColumns = await varDatabaseDbHandler({
|
||||
@@ -158,7 +158,7 @@ module.exports = async function updateTable({ dbFullName, tableName, tableInfoAr
|
||||
upToDateTableFieldsArray = userSchemaData[targetDbIndex].tables[targetTableIndex].fields;
|
||||
|
||||
fs.writeFileSync(schemaPath, JSON.stringify(userSchemaData), "utf8");
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Error in updating Table =>", error.message);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ module.exports = async function updateTable({ dbFullName, tableName, tableInfoAr
|
||||
|
||||
/**
|
||||
* @description All MSQL Foreign Keys
|
||||
* @type {DSQL_MYSQL_FOREIGN_KEYS_Type[] | null}
|
||||
* @type {*}
|
||||
*/
|
||||
const allForeignKeys = await varDatabaseDbHandler({
|
||||
queryString: `SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_SCHEMA = '${dbFullName}' AND TABLE_NAME='${tableName}' AND CONSTRAINT_TYPE='FOREIGN KEY'`,
|
||||
@@ -443,7 +443,7 @@ module.exports = async function updateTable({ dbFullName, tableName, tableInfoAr
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log('Error in "updateTable" function =>', error.message);
|
||||
|
||||
return "Error in Updating Table";
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = async function varReadOnlyDatabaseDbHandler({ queryString, data
|
||||
results = await dbHandler({ query: queryString, values: queryValuesArray, database: database });
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
|
||||
console.log("\x1b[31mvarReadOnlyDatabaseDbHandler ERROR\x1b[0m =>", database, error.message);
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ async function localGet({ options, dbSchema }) {
|
||||
return { success: true, payload: results };
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
|
||||
console.log("Error in local get Request =>", error.message);
|
||||
@@ -78,7 +78,7 @@ async function localGet({ options, dbSchema }) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
console.log("Error in local get Request =>", error.message);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ async function localPost({ options, dbSchema }) {
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
|
||||
return {
|
||||
@@ -83,7 +83,7 @@ async function localPost({ options, dbSchema }) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
console.log("Error in local post Request =>", error.message);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ async function updateApiSchemaFromLocalDb() {
|
||||
/** ********************************************** */
|
||||
|
||||
return httpResponse;
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
return {
|
||||
success: false,
|
||||
payload: null,
|
||||
|
||||
@@ -101,7 +101,7 @@ async function addDbEntry({ dbContext, paradigm, dbFullName, tableName, data, ta
|
||||
}
|
||||
|
||||
insertValuesArray.push(value);
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("DSQL: Error in parsing data keys =>", error.message);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ async function runQuery({ dbFullName, query, readOnly, dbSchema, queryValuesArra
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Error in Running Query =>", error.message);
|
||||
result = null;
|
||||
error = error.message;
|
||||
|
||||
@@ -96,7 +96,7 @@ async function updateDbEntry({ dbContext, paradigm, dbFullName, tableName, data,
|
||||
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ async function localAddUser({ payload, dbSchema }) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
console.log("Error in local add-user Request =>", error.message);
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ async function loginLocalUser({ payload, additionalFields, dbSchema }) {
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Error in local login-user Request =>", error.message);
|
||||
return {
|
||||
success: false,
|
||||
|
||||
@@ -93,7 +93,7 @@ async function localReauthUser({ existingUser, additionalFields, dbSchema }) {
|
||||
////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("Error in local login-user Request =>", error.message);
|
||||
return {
|
||||
success: false,
|
||||
|
||||
@@ -119,7 +119,7 @@ async function localGithubAuth({ res, code, email, clientId, clientSecret, addit
|
||||
return { ...loggedInGithubUser, dsqlUserId: "0" };
|
||||
|
||||
////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("localGithubAuth error", error.message);
|
||||
|
||||
return { success: false, msg: "Failed!" };
|
||||
|
||||
@@ -136,7 +136,7 @@ async function githubLogin({ code, clientId, clientSecret }) {
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
|
||||
@@ -258,7 +258,7 @@ async function handleSocialDb({ social_id, email, social_platform, payload, res,
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
console.log("ERROR in 'handleSocialDb.js' backend function =>", error.message);
|
||||
|
||||
return {
|
||||
|
||||
@@ -72,7 +72,7 @@ async function localUpdateUser({ payload, dbSchema }) {
|
||||
success: true,
|
||||
payload: updateUser,
|
||||
};
|
||||
} catch (error) {
|
||||
} catch (/** @type {*} */ error) {
|
||||
////////////////////////////////////////
|
||||
console.log("Error in local add-user Request =>", error.message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user