This commit is contained in:
Benjamin Toby 2024-12-12 14:43:25 +01:00
parent 2a4e111160
commit 6be3ede31a
7 changed files with 21 additions and 16 deletions

View File

@ -7,5 +7,5 @@ declare function _exports({ code, clientId, clientSecret, database, additionalFi
res?: any;
email?: string;
userId?: string | number;
}): Promise<import("../../../../types").APIGoogleLoginFunctionReturn>;
}): Promise<import("../../../../types").APILoginFunctionReturn>;
export = _exports;

View File

@ -16,7 +16,7 @@ const camelJoinedtoCamelSpace = require("../../../../utils/camelJoinedtoCamelSpa
* @param {string} [param.email]
* @param {string | number} [param.userId]
*
* @returns {Promise<import("../../../../types").APIGoogleLoginFunctionReturn>}
* @returns {Promise<import("../../../../types").APILoginFunctionReturn>}
*/
module.exports = async function apiGithubLogin({
code,

View File

@ -159,10 +159,7 @@ export interface GetReqQueryObject {
queryValues?: string;
tableName?: string;
}
export type SerializeQueryFnType = (param0: SerializeQueryParams) => string;
export interface SerializeQueryParams {
query: any;
}
export type SerializeQueryFnType = (query: any) => string;
export type DATASQUIREL_LoggedInUser = {
id: number;
uuid?: string;

View File

@ -188,13 +188,7 @@ export interface GetReqQueryObject {
tableName?: string;
}
export type SerializeQueryFnType = (param0: SerializeQueryParams) => string;
export interface SerializeQueryParams {
query: any;
}
// @ts-check
export type SerializeQueryFnType = (query: any) => string;
export type DATASQUIREL_LoggedInUser = {
id: number;

View File

@ -1,2 +1,2 @@
export = serializeQuery;
declare function serializeQuery(param0: import("../types").SerializeQueryParams): string;
declare function serializeQuery(query: any): string;

View File

@ -3,8 +3,22 @@
const EJSON = require("./ejson");
/** @type {import("../types").SerializeQueryFnType} */
function serializeQuery({ query }) {
function serializeQuery(query) {
let str = "?";
if (typeof query !== "object") {
console.log("Invalid Query type");
return str;
}
if (Array.isArray(query)) {
console.log("Query is an Array. This is invalid.");
return str;
}
if (!query) {
console.log("No Query provided.");
return str;
}
const keys = Object.keys(query);
/** @type {string[]} */

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "3.0.8",
"version": "3.0.9",
"description": "Cloud-based SQL data management tool",
"main": "index.js",
"bin": {