Update types
This commit is contained in:
parent
59c6f6dd40
commit
4bbb4da274
4
.npmrc
4
.npmrc
@ -1,4 +1,4 @@
|
||||
# registry=https://git.tben.me/api/packages/Moduletrace/npm/
|
||||
|
||||
# registry=https://git.tben.me/api/packages/Moduletrace/npm/
|
||||
# //git.tben.me/api/packages/Moduletrace/npm/:_authToken=${GITBEN_NPM_TOKEN}
|
||||
registry=https://git.tben.me/api/packages/Moduletrace/npm/
|
||||
//git.tben.me/api/packages/Moduletrace/npm/:_authToken=${GITBEN_NPM_TOKEN}
|
||||
|
@ -20,7 +20,7 @@ const runQuery = require("../query/utils/runQuery");
|
||||
* @async
|
||||
*
|
||||
* @param {Object} params - Single object passed
|
||||
* @param {import("@/types/user.td").UserDataPayload} params.payload - SQL Query
|
||||
* @param {UserDataPayload} params.payload - SQL Query
|
||||
* @param {DSQL_DatabaseSchemaType | undefined} params.dbSchema - Name of the table to query
|
||||
* @param {string} [params.encryptionKey]
|
||||
* @param {string} [params.encryptionSalt]
|
||||
|
@ -115,15 +115,3 @@
|
||||
* @property {boolean} success - Did the function run successfully?
|
||||
* @property {(Object[]|string)} [payload=[]] - Payload
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
DATASQUIREL_LoggedInUser,
|
||||
AuthenticatedUser,
|
||||
AddUserFunctionReturn,
|
||||
SuccessUserObject,
|
||||
GoogleIdentityPromptNotification,
|
||||
UserDataPayload,
|
||||
GetUserFunctionReturn,
|
||||
ReauthUserFunctionReturn,
|
||||
UpdateUserFunctionReturn,
|
||||
};
|
@ -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,
|
||||
|
@ -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 }) {
|
||||
/**
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user