2023-08-06 11:51:43 +00:00
|
|
|
// @ts-check
|
|
|
|
|
2023-05-03 06:16:29 +00:00
|
|
|
/**
|
|
|
|
* Imports
|
|
|
|
*/
|
|
|
|
const get = require("./utils/get");
|
2023-05-03 06:53:10 +00:00
|
|
|
const post = require("./utils/post");
|
2023-08-12 13:36:18 +00:00
|
|
|
const getSchema = require("./utils/get-schema");
|
2023-08-11 16:53:20 +00:00
|
|
|
|
2023-05-03 06:53:10 +00:00
|
|
|
const uploadImage = require("./utils/upload-image");
|
2023-08-10 13:09:12 +00:00
|
|
|
const uploadFile = require("./utils/upload-file");
|
2023-08-11 16:53:20 +00:00
|
|
|
const deleteFile = require("./utils/delete-file");
|
|
|
|
|
2023-05-06 11:14:09 +00:00
|
|
|
const createUser = require("./users/add-user");
|
2023-05-12 14:54:58 +00:00
|
|
|
const updateUser = require("./users/update-user");
|
2023-05-06 11:14:09 +00:00
|
|
|
const loginUser = require("./users/login-user");
|
2024-07-13 07:09:22 +00:00
|
|
|
const sendEmailCode = require("./users/send-email-code");
|
2023-05-06 11:14:09 +00:00
|
|
|
const logoutUser = require("./users/logout-user");
|
2023-08-11 16:53:20 +00:00
|
|
|
|
2023-05-06 11:14:09 +00:00
|
|
|
const userAuth = require("./users/user-auth");
|
2023-05-23 13:01:49 +00:00
|
|
|
const reAuthUser = require("./users/reauth-user");
|
2023-05-23 13:45:40 +00:00
|
|
|
const getUser = require("./users/get-user");
|
2023-08-11 16:53:20 +00:00
|
|
|
|
2023-06-24 09:22:31 +00:00
|
|
|
const loginWithGoogle = require("./users/social/google-auth");
|
2023-08-06 11:51:43 +00:00
|
|
|
const loginWithGithub = require("./users/social/github-auth");
|
2023-08-09 15:38:39 +00:00
|
|
|
const getToken = require("./users/get-token");
|
|
|
|
const validateToken = require("./users/validate-token");
|
2023-08-11 16:53:20 +00:00
|
|
|
|
2024-11-08 15:41:22 +00:00
|
|
|
const datasquirelClient = require("./client");
|
2024-12-06 10:31:24 +00:00
|
|
|
const sqlGenerator = require("./package-shared/functions/dsql/sql/sql-generator");
|
|
|
|
const sqlInsertGenerator = require("./package-shared/functions/dsql/sql/sql-insert-generator");
|
|
|
|
const sqlDeleteGenerator = require("./package-shared/functions/dsql/sql/sql-delete-generator");
|
2024-11-18 17:14:15 +00:00
|
|
|
const trimSql = require("./package-shared/utils/trim-sql");
|
2024-12-13 13:01:55 +00:00
|
|
|
const parseCookies = require("./package-shared/utils/backend/parseCookies");
|
2023-05-03 06:16:29 +00:00
|
|
|
|
2023-07-17 09:08:42 +00:00
|
|
|
////////////////////////////////////////
|
|
|
|
////////////////////////////////////////
|
|
|
|
////////////////////////////////////////
|
2023-05-03 06:16:29 +00:00
|
|
|
|
|
|
|
/**
|
2023-05-18 08:22:05 +00:00
|
|
|
* User Functions Object
|
|
|
|
*/
|
|
|
|
const user = {
|
|
|
|
createUser: createUser,
|
2024-12-08 08:58:57 +00:00
|
|
|
deleteUser: require("./users/delete-user"),
|
2023-05-18 08:22:05 +00:00
|
|
|
loginUser: loginUser,
|
2024-07-13 07:09:22 +00:00
|
|
|
sendEmailCode: sendEmailCode,
|
2023-05-18 08:22:05 +00:00
|
|
|
logoutUser: logoutUser,
|
|
|
|
userAuth: userAuth,
|
2023-05-23 13:01:49 +00:00
|
|
|
reAuthUser: reAuthUser,
|
2023-05-18 08:22:05 +00:00
|
|
|
updateUser: updateUser,
|
2023-05-23 13:45:40 +00:00
|
|
|
getUser: getUser,
|
2023-08-09 15:38:39 +00:00
|
|
|
getToken: getToken,
|
|
|
|
validateToken: validateToken,
|
2024-12-10 14:10:32 +00:00
|
|
|
validateTempEmailCode: require("./users/validate-temp-email-code"),
|
2023-06-24 09:22:31 +00:00
|
|
|
social: {
|
|
|
|
loginWithGoogle: loginWithGoogle,
|
2023-08-06 11:51:43 +00:00
|
|
|
loginWithGithub: loginWithGithub,
|
2023-06-24 09:22:31 +00:00
|
|
|
},
|
2023-05-18 08:22:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Media Functions Object
|
|
|
|
*/
|
|
|
|
const media = {
|
|
|
|
uploadImage: uploadImage,
|
2023-08-10 13:09:12 +00:00
|
|
|
uploadFile: uploadFile,
|
2023-08-11 16:53:20 +00:00
|
|
|
deleteFile: deleteFile,
|
2023-05-18 08:22:05 +00:00
|
|
|
};
|
|
|
|
|
2024-11-08 18:54:14 +00:00
|
|
|
/**
|
|
|
|
* SQL Utils
|
|
|
|
*/
|
|
|
|
const sql = {
|
|
|
|
sqlGenerator,
|
2024-11-12 11:01:39 +00:00
|
|
|
sqlInsertGenerator,
|
2024-11-12 18:46:41 +00:00
|
|
|
sqlDeleteGenerator,
|
2024-11-18 17:14:15 +00:00
|
|
|
trim: trimSql,
|
2024-11-08 18:54:14 +00:00
|
|
|
};
|
|
|
|
|
2023-05-18 08:22:05 +00:00
|
|
|
/**
|
|
|
|
* Main Export
|
2023-05-03 06:16:29 +00:00
|
|
|
*/
|
2023-05-03 06:25:12 +00:00
|
|
|
const datasquirel = {
|
2024-11-08 18:54:14 +00:00
|
|
|
get,
|
|
|
|
post,
|
|
|
|
media,
|
|
|
|
user,
|
|
|
|
getSchema,
|
2024-11-08 15:41:22 +00:00
|
|
|
client: datasquirelClient,
|
2024-11-08 18:54:14 +00:00
|
|
|
sql,
|
2024-12-06 10:53:26 +00:00
|
|
|
utils: {
|
|
|
|
crypto: {
|
|
|
|
encrypt: require("./package-shared/functions/dsql/encrypt"),
|
|
|
|
decrypt: require("./package-shared/functions/dsql/decrypt"),
|
2024-12-08 08:58:57 +00:00
|
|
|
hash: require("./package-shared/functions/dsql/hashPassword"),
|
2024-12-06 10:53:26 +00:00
|
|
|
},
|
2024-12-13 13:01:55 +00:00
|
|
|
parseCookies,
|
2024-12-06 10:53:26 +00:00
|
|
|
},
|
2023-05-03 06:16:29 +00:00
|
|
|
};
|
|
|
|
|
2024-12-12 06:03:35 +00:00
|
|
|
module.exports = datasquirel;
|