mirror of
https://github.com/sasjs/server.git
synced 2026-01-11 00:10:06 +00:00
chore: restructured controllers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import express from 'express'
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
import AuthController from '../../controllers/auth'
|
||||
import { AuthController } from '../../controllers/'
|
||||
import Client from '../../model/Client'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import express from 'express'
|
||||
import ClientController from '../../controllers/client'
|
||||
import { ClientController } from '../../controllers'
|
||||
import { registerClientValidation } from '../../utils'
|
||||
|
||||
const clientRouter = express.Router()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import express from 'express'
|
||||
import { DriveController } from '../../controllers/drive'
|
||||
import { DriveController } from '../../controllers/'
|
||||
import { getFileDriveValidation, updateFileDriveValidation } from '../../utils'
|
||||
|
||||
const driveRouter = express.Router()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import express from 'express'
|
||||
import GroupController from '../../controllers/group'
|
||||
import { GroupController } from '../../controllers/'
|
||||
import { authenticateAccessToken, verifyAdmin } from '../../middlewares'
|
||||
import { registerGroupValidation } from '../../utils'
|
||||
import userRouter from './user'
|
||||
|
||||
const groupRouter = express.Router()
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@ import mongoose, { Mongoose } from 'mongoose'
|
||||
import { MongoMemoryServer } from 'mongodb-memory-server'
|
||||
import request from 'supertest'
|
||||
import app from '../../../app'
|
||||
import UserController from '../../../controllers/user'
|
||||
import ClientController from '../../../controllers/client'
|
||||
import AuthController, {
|
||||
generateAccessToken,
|
||||
generateAuthCode,
|
||||
generateRefreshToken
|
||||
} from '../../../controllers/auth'
|
||||
import {
|
||||
UserController,
|
||||
ClientController,
|
||||
AuthController
|
||||
} from '../../../controllers/'
|
||||
import { populateClients } from '../auth'
|
||||
import { InfoJWT } from '../../../types'
|
||||
import { saveTokensInDB, verifyTokenInDB } from '../../../utils'
|
||||
import {
|
||||
generateAccessToken,
|
||||
generateAuthCode,
|
||||
generateRefreshToken,
|
||||
saveTokensInDB,
|
||||
verifyTokenInDB
|
||||
} from '../../../utils'
|
||||
|
||||
const clientId = 'someclientID'
|
||||
const clientSecret = 'someclientSecret'
|
||||
|
||||
@@ -2,10 +2,8 @@ import mongoose, { Mongoose } from 'mongoose'
|
||||
import { MongoMemoryServer } from 'mongodb-memory-server'
|
||||
import request from 'supertest'
|
||||
import app from '../../../app'
|
||||
import UserController from '../../../controllers/user'
|
||||
import ClientController from '../../../controllers/client'
|
||||
import { generateAccessToken } from '../../../controllers/auth'
|
||||
import { saveTokensInDB } from '../../../utils'
|
||||
import { UserController, ClientController } from '../../../controllers/'
|
||||
import { generateAccessToken, saveTokensInDB } from '../../../utils'
|
||||
|
||||
const client = {
|
||||
clientId: 'someclientID',
|
||||
|
||||
@@ -2,13 +2,12 @@ import mongoose, { Mongoose } from 'mongoose'
|
||||
import { MongoMemoryServer } from 'mongodb-memory-server'
|
||||
import request from 'supertest'
|
||||
import app from '../../../app'
|
||||
import { getTreeExample } from '../../../controllers/deploy'
|
||||
import UserController from '../../../controllers/user'
|
||||
import { UserController } from '../../../controllers/'
|
||||
import { getTreeExample } from '../../../controllers/internal'
|
||||
import { getTmpFilesFolderPath } from '../../../utils/file'
|
||||
import { folderExists, fileExists, readFile, deleteFolder } from '@sasjs/utils'
|
||||
import path from 'path'
|
||||
import { generateAccessToken } from '../../../controllers/auth'
|
||||
import { saveTokensInDB } from '../../../utils'
|
||||
import { generateAccessToken, saveTokensInDB } from '../../../utils'
|
||||
import { FolderMember, ServiceMember } from '../../../types'
|
||||
|
||||
const clientId = 'someclientID'
|
||||
|
||||
@@ -2,10 +2,8 @@ import mongoose, { Mongoose } from 'mongoose'
|
||||
import { MongoMemoryServer } from 'mongodb-memory-server'
|
||||
import request from 'supertest'
|
||||
import app from '../../../app'
|
||||
import UserController from '../../../controllers/user'
|
||||
import GroupController from '../../../controllers/group'
|
||||
import { generateAccessToken } from '../../../controllers/auth'
|
||||
import { saveTokensInDB } from '../../../utils'
|
||||
import { UserController, GroupController } from '../../../controllers/'
|
||||
import { generateAccessToken, saveTokensInDB } from '../../../utils'
|
||||
|
||||
const clientId = 'someclientID'
|
||||
const adminUser = {
|
||||
|
||||
@@ -2,9 +2,8 @@ import mongoose, { Mongoose } from 'mongoose'
|
||||
import { MongoMemoryServer } from 'mongodb-memory-server'
|
||||
import request from 'supertest'
|
||||
import app from '../../../app'
|
||||
import UserController from '../../../controllers/user'
|
||||
import { generateAccessToken } from '../../../controllers/auth'
|
||||
import { saveTokensInDB } from '../../../utils'
|
||||
import { UserController } from '../../../controllers/'
|
||||
import { generateAccessToken, saveTokensInDB } from '../../../utils'
|
||||
|
||||
const clientId = 'someclientID'
|
||||
const adminUser = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import express from 'express'
|
||||
import { executeProgramRawValidation } from '../../utils'
|
||||
import STPController from '../../controllers/stp'
|
||||
import { FileUploadController } from '../../controllers'
|
||||
import { STPController } from '../../controllers/'
|
||||
import { FileUploadController } from '../../controllers/internal'
|
||||
|
||||
const stpRouter = express.Router()
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import express from 'express'
|
||||
import UserController from '../../controllers/user'
|
||||
import { UserController } from '../../controllers/'
|
||||
import {
|
||||
authenticateAccessToken,
|
||||
verifyAdmin,
|
||||
|
||||
Reference in New Issue
Block a user