From cae4b2edf2fc1773c9b8ea73250332f395de2951 Mon Sep 17 00:00:00 2001 From: davidcrammer Date: Mon, 25 Mar 2024 15:58:54 -0700 Subject: [PATCH] Change file structure --- .vscode/extensions.json | 3 --- src/app.js | 4 ++-- src/classes/authFactorClass.js | 4 ++-- src/classes/capabilitiesClass.js | 4 ++-- src/classes/jwtClass.js | 2 +- src/classes/rolesClass.js | 4 ++-- src/classes/totpClass.js | 2 +- src/classes/usersClass.js | 2 +- {config => src/config}/config.js | 0 {config => src/config}/database.js | 0 {models => src/models}/AuthFactor.js | 0 {models => src/models}/Capability.js | 0 {models => src/models}/Role.js | 0 {models => src/models}/Role_Capability.js | 0 {models => src/models}/Token.js | 0 {models => src/models}/User.js | 0 {models => src/models}/associations.js | 0 {models => src/models}/index.js | 0 18 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 .vscode/extensions.json rename {config => src/config}/config.js (100%) rename {config => src/config}/database.js (100%) rename {models => src/models}/AuthFactor.js (100%) rename {models => src/models}/Capability.js (100%) rename {models => src/models}/Role.js (100%) rename {models => src/models}/Role_Capability.js (100%) rename {models => src/models}/Token.js (100%) rename {models => src/models}/User.js (100%) rename {models => src/models}/associations.js (100%) rename {models => src/models}/index.js (100%) diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 3db358c..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["github.copilot-chat"] -} diff --git a/src/app.js b/src/app.js index 9c616d7..fb8e041 100644 --- a/src/app.js +++ b/src/app.js @@ -3,7 +3,7 @@ import "dotenv/config" import cors from "cors" import cookieParser from "cookie-parser" import helmet from "helmet" -import sequelize from "../config/database" +import sequelize from "./config/database" import requireSSL from "./middleware/requireSSL" // Routes @@ -18,7 +18,7 @@ import totpRoutes from "./routes/totpRoutes" // DB Models -import "../models/index" +import "./models/index" const PORT = process.env.PORT || 3000 const app = Express() diff --git a/src/classes/authFactorClass.js b/src/classes/authFactorClass.js index a67613a..9bdda12 100644 --- a/src/classes/authFactorClass.js +++ b/src/classes/authFactorClass.js @@ -1,5 +1,5 @@ -import AuthFactorModel from "../../models/AuthFactor" -import User from "../../models/User" +import AuthFactorModel from "../models/AuthFactor" +import User from "../models/User" import CodedError from "../config/CodedError" /** diff --git a/src/classes/capabilitiesClass.js b/src/classes/capabilitiesClass.js index fc0d118..65ca799 100644 --- a/src/classes/capabilitiesClass.js +++ b/src/classes/capabilitiesClass.js @@ -1,5 +1,5 @@ -import CapabilityModel from "../../models/Capability" -import RoleModel from "../../models/Role" +import CapabilityModel from "../models/Capability" +import RoleModel from "../models/Role" import CodedError from "../config/CodedError" class Capability { diff --git a/src/classes/jwtClass.js b/src/classes/jwtClass.js index c8cb9af..1d2d30b 100644 --- a/src/classes/jwtClass.js +++ b/src/classes/jwtClass.js @@ -1,6 +1,6 @@ import jwt from "jsonwebtoken" import CodedError from "../config/CodedError" -import Token from "../../models/Token" +import Token from "../models/Token" /** * The Standard payload for a JWT token diff --git a/src/classes/rolesClass.js b/src/classes/rolesClass.js index fc9ace7..1b9dae5 100644 --- a/src/classes/rolesClass.js +++ b/src/classes/rolesClass.js @@ -1,5 +1,5 @@ -import RoleModel from "../../models/Role" -import CapabilityModel from "../../models/Capability" +import RoleModel from "../models/Role" +import CapabilityModel from "../models/Capability" import Capability from "./capabilitiesClass" import CodedError from "../config/CodedError" diff --git a/src/classes/totpClass.js b/src/classes/totpClass.js index 3245bce..32da995 100644 --- a/src/classes/totpClass.js +++ b/src/classes/totpClass.js @@ -3,7 +3,7 @@ import * as OTPAuth from "otpauth" import crypto from "crypto" import base32 from "hi-base32" import AuthFactor from "./authFactorClass" -import User from "../../models/User" +import User from "../models/User" import CodedError from "../config/CodedError" /** diff --git a/src/classes/usersClass.js b/src/classes/usersClass.js index 0941a04..0d0241b 100644 --- a/src/classes/usersClass.js +++ b/src/classes/usersClass.js @@ -4,7 +4,7 @@ import isJWT from "validator/lib/isJWT" import CodedError from "../config/CodedError" import JWT from "./jwtClass" import Role from "./rolesClass" -import UserModel from "../../models/User" +import UserModel from "../models/User" /** * Default data to create a new user diff --git a/config/config.js b/src/config/config.js similarity index 100% rename from config/config.js rename to src/config/config.js diff --git a/config/database.js b/src/config/database.js similarity index 100% rename from config/database.js rename to src/config/database.js diff --git a/models/AuthFactor.js b/src/models/AuthFactor.js similarity index 100% rename from models/AuthFactor.js rename to src/models/AuthFactor.js diff --git a/models/Capability.js b/src/models/Capability.js similarity index 100% rename from models/Capability.js rename to src/models/Capability.js diff --git a/models/Role.js b/src/models/Role.js similarity index 100% rename from models/Role.js rename to src/models/Role.js diff --git a/models/Role_Capability.js b/src/models/Role_Capability.js similarity index 100% rename from models/Role_Capability.js rename to src/models/Role_Capability.js diff --git a/models/Token.js b/src/models/Token.js similarity index 100% rename from models/Token.js rename to src/models/Token.js diff --git a/models/User.js b/src/models/User.js similarity index 100% rename from models/User.js rename to src/models/User.js diff --git a/models/associations.js b/src/models/associations.js similarity index 100% rename from models/associations.js rename to src/models/associations.js diff --git a/models/index.js b/src/models/index.js similarity index 100% rename from models/index.js rename to src/models/index.js