From 7b9ec5404efebb08a58ee76c6b814aedee6eba61 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Thu, 12 Dec 2024 07:01:57 +0100 Subject: [PATCH] Updates --- index.d.ts | 72 +-------------------------------- index.js | 5 +-- package-shared/utils/index.d.ts | 13 ++++++ package.json | 2 +- 4 files changed, 16 insertions(+), 76 deletions(-) create mode 100644 package-shared/utils/index.d.ts diff --git a/index.d.ts b/index.d.ts index 8e319bf..95ec56d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,71 +1 @@ -import get = require("./utils/get"); -import post = require("./utils/post"); -export namespace media { - export { uploadImage }; - export { uploadFile }; - export { deleteFile }; -} -export namespace user { - export { createUser }; - export let deleteUser: typeof import("./users/delete-user"); - export { loginUser }; - export { sendEmailCode }; - export { logoutUser }; - export { userAuth }; - export { reAuthUser }; - export { updateUser }; - export { getUser }; - export { getToken }; - export { validateToken }; - export let validateTempEmailCode: typeof import("./users/validate-temp-email-code"); - export namespace social { - export { loginWithGoogle }; - export { loginWithGithub }; - } -} -import getSchema = require("./utils/get-schema"); -import datasquirelClient = require("./client"); -export namespace sql { - export { sqlGenerator }; - export { sqlInsertGenerator }; - export { sqlDeleteGenerator }; - export { trimSql as trim }; -} -import uploadImage = require("./utils/upload-image"); -import uploadFile = require("./utils/upload-file"); -import deleteFile = require("./utils/delete-file"); -import createUser = require("./users/add-user"); -import loginUser = require("./users/login-user"); -import sendEmailCode = require("./users/send-email-code"); -import logoutUser = require("./users/logout-user"); -import userAuth = require("./users/user-auth"); -import reAuthUser = require("./users/reauth-user"); -import updateUser = require("./users/update-user"); -import getUser = require("./users/get-user"); -import getToken = require("./users/get-token"); -import validateToken = require("./users/validate-token"); -import loginWithGoogle = require("./users/social/google-auth"); -import loginWithGithub = require("./users/social/github-auth"); -import sqlGenerator = require("./package-shared/functions/dsql/sql/sql-generator"); -import sqlInsertGenerator = require("./package-shared/functions/dsql/sql/sql-insert-generator"); -import sqlDeleteGenerator = require("./package-shared/functions/dsql/sql/sql-delete-generator"); -import trimSql = require("./package-shared/utils/trim-sql"); -export declare namespace utils { - namespace crypto { - let encrypt: ({ data, encryptionKey, encryptionSalt }: { - data: string; - encryptionKey?: string; - encryptionSalt?: string; - }) => string | null; - let decrypt: ({ encryptedString, encryptionKey, encryptionSalt }: { - encryptedString: string; - encryptionKey?: string; - encryptionSalt?: string; - }) => string; - let hash: ({ password, encryptionKey }: { - password: string; - encryptionKey?: string; - }) => string; - } -} -export { get, post, getSchema, datasquirelClient as client }; +export const dsqlUtils: typeof import("./package-shared/utils"); diff --git a/index.js b/index.js index d6b14cf..3a524da 100644 --- a/index.js +++ b/index.js @@ -103,7 +103,4 @@ const datasquirel = { }; module.exports = datasquirel; - -//////////////////////////////////////// -//////////////////////////////////////// -//////////////////////////////////////// +exports.dsqlUtils = require("./package-shared/utils"); diff --git a/package-shared/utils/index.d.ts b/package-shared/utils/index.d.ts new file mode 100644 index 0000000..39510e6 --- /dev/null +++ b/package-shared/utils/index.d.ts @@ -0,0 +1,13 @@ +export const numberfy: (num: any, decimals?: number) => number; +export const slugify: (str: string) => string; +export const serializeCookies: typeof import("./serialize-cookies"); +export const serializeQuery: typeof import("./serialize-query"); +export const trimSql: typeof import("./trim-sql"); +export const EJSON: { + parse: (string: string | null | number, reviver?: (this: any, key: string, value: any) => any) => { + [x: string]: any; + } | { + [x: string]: any; + }[] | undefined; + stringify: (value: any, replacer?: ((this: any, key: string, value: any) => any) | null, space?: string | number) => string | undefined; +}; diff --git a/package.json b/package.json index f3e16c4..14a29ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.0.1", + "version": "3.0.2", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {