Update types
This commit is contained in:
+2
-2
@@ -26,11 +26,11 @@ const localAddUser = require("../engine/user/add-user");
|
||||
* @param {object} props - Single object passed
|
||||
* @param {string} props.key - FULL ACCESS API Key
|
||||
* @param {string} props.database - Database Name
|
||||
* @param {import("../types/user.td").UserDataPayload} props.payload - User Data Payload
|
||||
* @param {UserDataPayload} props.payload - User Data Payload
|
||||
* @param {string} props.encryptionKey
|
||||
* @param {string} [props.encryptionSalt]
|
||||
*
|
||||
* @returns { Promise<import("../types/user.td").AddUserFunctionReturn> }
|
||||
* @returns { Promise<AddUserFunctionReturn> }
|
||||
*/
|
||||
async function addUser({
|
||||
key,
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ const loginLocalUser = require("../engine/user/login-user");
|
||||
* @param {string} [params.temp_code_field] - Database table field name for temporary code
|
||||
* @param {boolean} [params.token] - Send access key as part of response body?
|
||||
*
|
||||
* @returns { Promise<import("../types/user.td").AuthenticatedUser>}
|
||||
* @returns { Promise<AuthenticatedUser>}
|
||||
*/
|
||||
async function loginUser({
|
||||
key,
|
||||
@@ -154,7 +154,7 @@ async function loginUser({
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
*
|
||||
* @type {{ success: boolean, payload: import("../types/user.td").DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
* @type {{ success: boolean, payload: DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
*/
|
||||
httpResponse = await new Promise((resolve, reject) => {
|
||||
/** @type {PackageUserLoginRequestBody} */
|
||||
|
||||
@@ -38,7 +38,7 @@ const localReauthUser = require("../engine/user/reauth-user");
|
||||
* @param {string[]} [params.additionalFields] - Additional Fields to be added to the user object
|
||||
* @param {string} [params.token] - access token to use instead of getting from cookie header
|
||||
*
|
||||
* @returns { Promise<import("../types/user.td").ReauthUserFunctionReturn> }
|
||||
* @returns { Promise<ReauthUserFunctionReturn> }
|
||||
*/
|
||||
async function reauthUser({
|
||||
key,
|
||||
|
||||
@@ -143,7 +143,7 @@ async function sendEmailCode({
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
*
|
||||
* @type {{ success: boolean, payload: import("../types/user.td").DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
* @type {{ success: boolean, payload: DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
*/
|
||||
httpResponse = await new Promise((resolve, reject) => {
|
||||
const reqPayload = JSON.stringify({
|
||||
|
||||
@@ -179,7 +179,7 @@ async function googleAuth({
|
||||
* Make https request
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
* @type {{ success: boolean, user: import("../../types/user.td").DATASQUIREL_LoggedInUser | null, msg?: string, dsqlUserId?: number } | null } - Https response object
|
||||
* @type {{ success: boolean, user: DATASQUIREL_LoggedInUser | null, msg?: string, dsqlUserId?: number } | null } - Https response object
|
||||
*/
|
||||
httpResponse = await new Promise((resolve, reject) => {
|
||||
const reqPayload = JSON.stringify({
|
||||
|
||||
@@ -29,7 +29,7 @@ const localUpdateUser = require("../engine/user/update-user");
|
||||
* @param {String} params.database - Target Database
|
||||
* @param {{ id: number } & Object.<string, *>} params.payload - User Object: ID is required
|
||||
*
|
||||
* @returns { Promise<import("../types/user.td").UpdateUserFunctionReturn>}
|
||||
* @returns { Promise<UpdateUserFunctionReturn>}
|
||||
*/
|
||||
async function updateUser({ key, payload, database }) {
|
||||
/**
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ const parseCookies = require("../utils/functions/parseCookies");
|
||||
* @param {string} params.database - Database Name
|
||||
* @param {string} [params.token] - access token to use instead of getting from cookie header
|
||||
*
|
||||
* @returns { import("../types/user.td").AuthenticatedUser }
|
||||
* @returns { AuthenticatedUser }
|
||||
*/
|
||||
function userAuth({
|
||||
request,
|
||||
|
||||
@@ -27,7 +27,7 @@ const decrypt = require("../functions/decrypt");
|
||||
* @param {("deep" | "normal")?} [params.level] - Optional. "Deep" value indicates an extra layer of security
|
||||
* @param {string} params.database - Database Name
|
||||
*
|
||||
* @returns { import("../types/user.td").DATASQUIREL_LoggedInUser | null}
|
||||
* @returns { DATASQUIREL_LoggedInUser | null}
|
||||
*/
|
||||
function validateToken({ token, encryptionKey, encryptionSalt }) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user