From a1e7439958c1d6fe39095a80e871d63b742fd68a Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Tue, 12 Nov 2024 19:46:41 +0100 Subject: [PATCH] Minor Updates --- functions/sql/sql-delete-generator.d.ts | 24 ++++++++++++++++++++++++ index.d.ts | 2 ++ index.js | 2 ++ package.json | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 functions/sql/sql-delete-generator.d.ts diff --git a/functions/sql/sql-delete-generator.d.ts b/functions/sql/sql-delete-generator.d.ts new file mode 100644 index 0000000..438f8a0 --- /dev/null +++ b/functions/sql/sql-delete-generator.d.ts @@ -0,0 +1,24 @@ +export = sqlDeleteGenerator; +/** + * @typedef {object} SQLDeleteGenReturn + * @property {string} query + * @property {string[]} values + */ +/** + * @param {object} param0 + * @param {any} param0.data + * @param {string} param0.tableName + * + * @return {SQLDeleteGenReturn | undefined} + */ +declare function sqlDeleteGenerator({ tableName, data }: { + data: any; + tableName: string; +}): SQLDeleteGenReturn | undefined; +declare namespace sqlDeleteGenerator { + export { SQLDeleteGenReturn }; +} +type SQLDeleteGenReturn = { + query: string; + values: string[]; +}; diff --git a/index.d.ts b/index.d.ts index 8a227ed..ae1ba74 100644 --- a/index.d.ts +++ b/index.d.ts @@ -27,6 +27,7 @@ import datasquirelClient = require("./client"); export namespace sql { export { sqlGenerator }; export { sqlInsertGenerator }; + export { sqlDeleteGenerator }; } import uploadImage = require("./utils/upload-image"); import uploadFile = require("./utils/upload-file"); @@ -45,4 +46,5 @@ import loginWithGoogle = require("./users/social/google-auth"); import loginWithGithub = require("./users/social/github-auth"); import sqlGenerator = require("./functions/sql/sql-generator"); import sqlInsertGenerator = require("./functions/sql/sql-insert-generator"); +import sqlDeleteGenerator = require("./functions/sql/sql-delete-generator"); export { get, post, getSchema, sanitizeSql, datasquirelClient as client }; diff --git a/index.js b/index.js index 5a799da..a6344b5 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,7 @@ const sanitizeSql = require("./utils/functions/sanitizeSql"); const datasquirelClient = require("./client"); const sqlGenerator = require("./functions/sql/sql-generator"); const sqlInsertGenerator = require("./functions/sql/sql-insert-generator"); +const sqlDeleteGenerator = require("./functions/sql/sql-delete-generator"); //////////////////////////////////////// //////////////////////////////////////// @@ -70,6 +71,7 @@ const media = { const sql = { sqlGenerator, sqlInsertGenerator, + sqlDeleteGenerator, }; /** diff --git a/package.json b/package.json index aed9961..7a5764a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "2.6.1", + "version": "2.6.2", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {