From 06de31dcb2704d651bc349524150fc5a1937b7db Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Wed, 5 Feb 2025 19:34:03 +0100 Subject: [PATCH] Updates --- dist/package-shared/actions/users/user-auth.js | 6 ++++++ dist/package-shared/functions/dsql/sql/sql-generator.js | 7 ++----- dist/package-shared/types/index.d.ts | 3 +++ dist/package-shared/types/index.js | 1 + package-shared/actions/get.ts | 1 - package-shared/actions/users/user-auth.ts | 6 ++++++ .../functions/api/social-login/handleSocialDb.ts | 2 +- package-shared/functions/dsql/sql/sql-generator.ts | 9 ++------- package-shared/types/index.ts | 1 + package.json | 2 +- 10 files changed, 23 insertions(+), 15 deletions(-) diff --git a/dist/package-shared/actions/users/user-auth.js b/dist/package-shared/actions/users/user-auth.js index 60c5379..0ff6293 100644 --- a/dist/package-shared/actions/users/user-auth.js +++ b/dist/package-shared/actions/users/user-auth.js @@ -69,6 +69,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "Couldn't Decrypt cookie", + cookieNames: keyNames, }; } /** @@ -86,6 +87,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "No CSRF_K in decrypted payload", + cookieNames: keyNames, }; } if (!(0, write_auth_files_1.checkAuthFile)(userObject.csrf_k)) { @@ -93,6 +95,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "Auth file doesn't exist", + cookieNames: keyNames, }; } /** @@ -107,6 +110,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "CSRF_K mismatch", + cookieNames: keyNames, }; } } @@ -117,6 +121,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "Payload Creation Date is not a number", + cookieNames: keyNames, }; } const timeElapsed = Date.now() - payloadCreationDate; @@ -128,6 +133,7 @@ function userAuth({ request, req, encryptionKey, encryptionSalt, level, database success: false, payload: null, msg: "Session has expired", + cookieNames: keyNames, }; } /** diff --git a/dist/package-shared/functions/dsql/sql/sql-generator.js b/dist/package-shared/functions/dsql/sql/sql-generator.js index 9333c2b..631dc94 100644 --- a/dist/package-shared/functions/dsql/sql/sql-generator.js +++ b/dist/package-shared/functions/dsql/sql/sql-generator.js @@ -41,7 +41,6 @@ function sqlGenerator({ tableName, genObject, dbFullName }) { } } else if (Array.isArray(queryObj.value)) { - /** @type {string[]} */ const strArray = []; queryObj.value.forEach((val) => { const valueParsed = val; @@ -62,13 +61,11 @@ function sqlGenerator({ tableName, genObject, dbFullName }) { return str; } const sqlSearhString = queryKeys === null || queryKeys === void 0 ? void 0 : queryKeys.map((field) => { - const queryObj = - /** @type {import("../../../types").ServerQueryQueryObject} */ finalQuery === null || finalQuery === void 0 ? void 0 : finalQuery[field]; + const queryObj = finalQuery === null || finalQuery === void 0 ? void 0 : finalQuery[field]; if (!queryObj) return; if (queryObj.__query) { - const subQueryGroup = - /** @type {import("../../../types").ServerQueryQueryObject}} */ queryObj.__query; + const subQueryGroup = queryObj.__query; const subSearchKeys = Object.keys(subQueryGroup); const subSearchString = subSearchKeys.map((_field) => { const newSubQueryObj = subQueryGroup === null || subQueryGroup === void 0 ? void 0 : subQueryGroup[_field]; diff --git a/dist/package-shared/types/index.d.ts b/dist/package-shared/types/index.d.ts index b76f60d..4777470 100644 --- a/dist/package-shared/types/index.d.ts +++ b/dist/package-shared/types/index.d.ts @@ -55,6 +55,9 @@ export declare const TextFieldTypesArray: readonly [{ }, { readonly title: "Javascript"; readonly value: "javascript"; +}, { + readonly title: "Shell"; + readonly value: "shell"; }]; export type DSQL_FieldSchemaType = { fieldName?: string; diff --git a/dist/package-shared/types/index.js b/dist/package-shared/types/index.js index 1f53184..bd004ec 100644 --- a/dist/package-shared/types/index.js +++ b/dist/package-shared/types/index.js @@ -9,6 +9,7 @@ exports.TextFieldTypesArray = [ { title: "HTML", value: "html" }, { title: "CSS", value: "css" }, { title: "Javascript", value: "javascript" }, + { title: "Shell", value: "shell" }, ]; exports.ServerQueryOperators = ["AND", "OR"]; exports.ServerQueryEqualities = ["EQUAL", "LIKE", "NOT EQUAL"]; diff --git a/package-shared/actions/get.ts b/package-shared/actions/get.ts index ca77ffb..2a8cf88 100644 --- a/package-shared/actions/get.ts +++ b/package-shared/actions/get.ts @@ -9,7 +9,6 @@ import { DSQL_DatabaseSchemaType, GetReqQueryObject, GetReturn, - ServerQueryParam, } from "../types"; import apiGetGrabQueryAndValues from "../utils/grab-query-and-values"; diff --git a/package-shared/actions/users/user-auth.ts b/package-shared/actions/users/user-auth.ts index fdaad18..dfb784f 100644 --- a/package-shared/actions/users/user-auth.ts +++ b/package-shared/actions/users/user-auth.ts @@ -105,6 +105,7 @@ export default function userAuth({ success: false, payload: null, msg: "Couldn't Decrypt cookie", + cookieNames: keyNames, }; } @@ -127,6 +128,7 @@ export default function userAuth({ success: false, payload: null, msg: "No CSRF_K in decrypted payload", + cookieNames: keyNames, }; } @@ -135,6 +137,7 @@ export default function userAuth({ success: false, payload: null, msg: "Auth file doesn't exist", + cookieNames: keyNames, }; } @@ -152,6 +155,7 @@ export default function userAuth({ success: false, payload: null, msg: "CSRF_K mismatch", + cookieNames: keyNames, }; } } @@ -166,6 +170,7 @@ export default function userAuth({ success: false, payload: null, msg: "Payload Creation Date is not a number", + cookieNames: keyNames, }; } @@ -180,6 +185,7 @@ export default function userAuth({ success: false, payload: null, msg: "Session has expired", + cookieNames: keyNames, }; } diff --git a/package-shared/functions/api/social-login/handleSocialDb.ts b/package-shared/functions/api/social-login/handleSocialDb.ts index cbe0dbf..8bc47b5 100644 --- a/package-shared/functions/api/social-login/handleSocialDb.ts +++ b/package-shared/functions/api/social-login/handleSocialDb.ts @@ -1,4 +1,4 @@ -import fs, { glob } from "fs"; +import fs from "fs"; import handleNodemailer from "../../backend/handleNodemailer"; import path from "path"; import addMariadbUser from "../../backend/addMariadbUser"; diff --git a/package-shared/functions/dsql/sql/sql-generator.ts b/package-shared/functions/dsql/sql/sql-generator.ts index d3b29c8..c1f3b5c 100644 --- a/package-shared/functions/dsql/sql/sql-generator.ts +++ b/package-shared/functions/dsql/sql/sql-generator.ts @@ -73,7 +73,6 @@ export default function sqlGenerator< sqlSearhValues.push(valueParsed); } } else if (Array.isArray(queryObj.value)) { - /** @type {string[]} */ const strArray: string[] = []; queryObj.value.forEach((val) => { const valueParsed = val; @@ -97,15 +96,11 @@ export default function sqlGenerator< } const sqlSearhString = queryKeys?.map((field) => { - const queryObj = - /** @type {import("../../../types").ServerQueryQueryObject} */ finalQuery?.[ - field - ]; + const queryObj = finalQuery?.[field]; if (!queryObj) return; if (queryObj.__query) { - const subQueryGroup = - /** @type {import("../../../types").ServerQueryQueryObject}} */ queryObj.__query; + const subQueryGroup = queryObj.__query; const subSearchKeys = Object.keys(subQueryGroup); const subSearchString = subSearchKeys.map((_field) => { diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 4196703..b959ca1 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -49,6 +49,7 @@ export const TextFieldTypesArray = [ { title: "HTML", value: "html" }, { title: "CSS", value: "css" }, { title: "Javascript", value: "javascript" }, + { title: "Shell", value: "shell" }, ] as const; export type DSQL_FieldSchemaType = { diff --git a/package.json b/package.json index 021e0f1..864fd5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.9.7", + "version": "3.9.8", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {