Update types: Remove '@/' references

This commit is contained in:
Benjamin Toby
2024-10-19 17:45:42 +01:00
parent bf1d7f5fcd
commit 4462ba315d
27 changed files with 39 additions and 42 deletions
+3 -3
View File
@@ -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("@/package-shared/types").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<import("@/package-shared/types").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 {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema;
try {
+4 -4
View File
@@ -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("@/package-shared/types").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 {import("@/package-shared/types").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: import("@/package-shared/types").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 {import("@/package-shared/types").PackageUserLoginRequestBody} */
/** @type {import("../package-shared/types").PackageUserLoginRequestBody} */
const reqPayload = {
encryptionKey,
payload,
+2 -2
View File
@@ -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("@/package-shared/types").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 {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema;
try {
+2 -2
View File
@@ -114,7 +114,7 @@ async function sendEmailCode({
DSQL_PASS?.match(/./) &&
DSQL_DB_NAME?.match(/./)
) {
/** @type {import("@/package-shared/types").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: import("@/package-shared/types").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({
+1 -1
View File
@@ -154,7 +154,7 @@ async function githubAuth({
DSQL_PASS?.match(/./) &&
DSQL_DB_NAME?.match(/./)
) {
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined | undefined} */
/** @type {import("../../package-shared/types").DSQL_DatabaseSchemaType | undefined | undefined} */
let dbSchema;
try {
+2 -2
View File
@@ -150,7 +150,7 @@ async function googleAuth({
DSQL_PASS?.match(/./) &&
DSQL_DB_NAME?.match(/./)
) {
/** @type {import("@/package-shared/types").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: import("@/package-shared/types").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({
+2 -2
View File
@@ -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("@/package-shared/types").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 {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema;
try {
+1 -1
View File
@@ -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("@/package-shared/types").AuthenticatedUser }
* @returns { import("../package-shared/types").AuthenticatedUser }
*/
function userAuth({
request,
+1 -1
View File
@@ -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("@/package-shared/types").DATASQUIREL_LoggedInUser | null}
* @returns { import("../package-shared/types").DATASQUIREL_LoggedInUser | null}
*/
function validateToken({ token, encryptionKey, encryptionSalt }) {
try {