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; res?: any;
email?: string; email?: string;
userId?: string | number; userId?: string | number;
}): Promise<import("../../../../types").APIGoogleLoginFunctionReturn>; }): Promise<import("../../../../types").APILoginFunctionReturn>;
export = _exports; export = _exports;

View File

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

View File

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

View File

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

View File

@ -1,2 +1,2 @@
export = serializeQuery; 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"); const EJSON = require("./ejson");
/** @type {import("../types").SerializeQueryFnType} */ /** @type {import("../types").SerializeQueryFnType} */
function serializeQuery({ query }) { function serializeQuery(query) {
let str = "?"; 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); const keys = Object.keys(query);
/** @type {string[]} */ /** @type {string[]} */

View File

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