Update Types
This commit is contained in:
+3
-3
@@ -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 {UserDataPayload} props.payload - User Data Payload
|
||||
* @param {import("@/package-shared/types").UserDataPayload} props.payload - User Data Payload
|
||||
* @param {string} props.encryptionKey
|
||||
* @param {string} [props.encryptionSalt]
|
||||
*
|
||||
* @returns { Promise<AddUserFunctionReturn> }
|
||||
* @returns { Promise<import("@/package-shared/types").AddUserFunctionReturn> }
|
||||
*/
|
||||
async function addUser({
|
||||
key,
|
||||
@@ -64,7 +64,7 @@ async function addUser({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
|
||||
+4
-4
@@ -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<AuthenticatedUser>}
|
||||
* @returns { Promise<import("@/package-shared/types").AuthenticatedUser>}
|
||||
*/
|
||||
async function loginUser({
|
||||
key,
|
||||
@@ -126,7 +126,7 @@ async function loginUser({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
@@ -154,10 +154,10 @@ async function loginUser({
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
*
|
||||
* @type {{ success: boolean, payload: DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
* @type {{ success: boolean, payload: import("@/package-shared/types").DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
*/
|
||||
httpResponse = await new Promise((resolve, reject) => {
|
||||
/** @type {PackageUserLoginRequestBody} */
|
||||
/** @type {import("@/package-shared/types").PackageUserLoginRequestBody} */
|
||||
const reqPayload = {
|
||||
encryptionKey,
|
||||
payload,
|
||||
|
||||
@@ -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<ReauthUserFunctionReturn> }
|
||||
* @returns { Promise<import("@/package-shared/types").ReauthUserFunctionReturn> }
|
||||
*/
|
||||
async function reauthUser({
|
||||
key,
|
||||
@@ -103,7 +103,7 @@ async function reauthUser({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
|
||||
@@ -114,7 +114,7 @@ async function sendEmailCode({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
@@ -143,7 +143,7 @@ async function sendEmailCode({
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
*
|
||||
* @type {{ success: boolean, payload: DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
* @type {{ success: boolean, payload: import("@/package-shared/types").DATASQUIREL_LoggedInUser | null, userId?: number, msg?: string }}
|
||||
*/
|
||||
httpResponse = await new Promise((resolve, reject) => {
|
||||
const reqPayload = JSON.stringify({
|
||||
|
||||
@@ -154,7 +154,7 @@ async function githubAuth({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
|
||||
@@ -150,7 +150,7 @@ async function googleAuth({
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
@@ -179,7 +179,7 @@ async function googleAuth({
|
||||
* Make https request
|
||||
*
|
||||
* @description make a request to datasquirel.com
|
||||
* @type {{ success: boolean, user: DATASQUIREL_LoggedInUser | null, msg?: string, dsqlUserId?: number } | null } - Https response object
|
||||
* @type {{ success: boolean, user: import("@/package-shared/types").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<UpdateUserFunctionReturn>}
|
||||
* @returns { Promise<import("@/package-shared/types").UpdateUserFunctionReturn>}
|
||||
*/
|
||||
async function updateUser({ key, payload, database }) {
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ async function updateUser({ key, payload, database }) {
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
|
||||
+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 { AuthenticatedUser }
|
||||
* @returns { import("@/package-shared/types").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 { DATASQUIREL_LoggedInUser | null}
|
||||
* @returns { import("@/package-shared/types").DATASQUIREL_LoggedInUser | null}
|
||||
*/
|
||||
function validateToken({ token, encryptionKey, encryptionSalt }) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user