import * as express from 'express' ; import { MigrationController } from '../controllers/migration.controller' ; import { AuthMiddleware } from '../middlewares/auth' ; import { QuestionController } from '../controllers/question.controller' ; import { GeneralConstants , RoutesConstants } from '../../projects/shared-library/src/lib/shared/model' ; export const migrationRoutes = express . Router ( ) ; class MigrationRoutes { private CLN = RoutesConstants . COLLECTION_NAME ; private PROD = RoutesConstants . PROD ; private DEV = RoutesConstants . DEV ; public migrationRoutes : any ; constructor ( ) { this . migrationRoutes = express . Router ( ) ; this . migrationRoutes . post ( `/${ RoutesConstants . ACCOUNT }/${ RoutesConstants . STAT }` , AuthMiddleware . authTokenOnly , MigrationController . migrateUserStatToAccounts ) ; this . migrationRoutes . post ( `/${ RoutesConstants . USER }/${ RoutesConstants . STAT }` , AuthMiddleware . authTokenOnly , MigrationController . generateUsersStat ) ; this . migrationRoutes . post ( `/${ RoutesConstants . LEADERBOARD }/${ RoutesConstants . STAT }` , AuthMiddleware . authTokenOnly , MigrationController . generateLeaderBoardStat ) ; this . migrationRoutes . post ( `/${ RoutesConstants . USER }/${ RoutesConstants . CONTRIBUTION }/${ RoutesConstants . STAT }` , AuthMiddleware . authTokenOnly , MigrationController . generateUserContributionStat ) ; this . migrationRoutes . post ( `/${ RoutesConstants . QUESTION }/${ RoutesConstants . UPDATE }` , AuthMiddleware . authTokenOnly , MigrationController . changeQuestionCategoryIdType ) ; this . migrationRoutes . post ( `/${ RoutesConstants . MIGRATE }/:${ this . CLN }` , AuthMiddleware . authTokenOnly , MigrationController . migrateCollections ) ; this . migrationRoutes . post ( `/${ RoutesConstants . MIGRATE }/${ this . PROD }/${ this . DEV }/:${ this . CLN }` , AuthMiddleware . authTokenOnly , MigrationController . migrateProdCollectionsToDev ) ; this . migrationRoutes . post ( `/${ RoutesConstants . REBUILD }/${ RoutesConstants . QUESTION }/${ RoutesConstants . INDEX }` , AuthMiddleware . authTokenOnly , MigrationController . rebuildQuestionIndex ) ; this . migrationRoutes . post ( `/${ RoutesConstants . STAT }/${ RoutesConstants . SYSTEM }` , AuthMiddleware . authTokenOnly , MigrationController . generateSystemStat ) ; this . migrationRoutes . post ( `/${ RoutesConstants . BULK_UPLOAD }/${ RoutesConstants . UPDATE }` , AuthMiddleware . authTokenOnly , MigrationController . updateBulkUploadCollection ) ; this . migrationRoutes . post ( `/${ RoutesConstants . QUESTION }/${ RoutesConstants . UPDATE }/:${ this . CLN }` , AuthMiddleware . authTokenOnly , MigrationController . updateQuestionCollection ) ; this . migrationRoutes . post ( `/${ RoutesConstants . AUTH_DASH_USERS }` , AuthMiddleware . authTokenOnly , MigrationController . dumpAuthUsersInFirestore ) ; this . migrationRoutes . post ( `/${ RoutesConstants . USER }/${ RoutesConstants . PROFILE }/${ RoutesConstants . IMAGE }` , AuthMiddleware . authTokenOnly , MigrationController . generateAllUsersProfileImages ) ; this . migrationRoutes . post ( `/${ RoutesConstants . QUESTION }/${ RoutesConstants . STATUS }` , AuthMiddleware . authTokenOnly , QuestionController . changeUnpublishedQuestionStatus ) ; this . migrationRoutes . post ( `/${ RoutesConstants . ADD }/${ RoutesConstants . DEFAULT }/${ RoutesConstants . LIVES }` , AuthMiddleware . authTokenOnly , MigrationController . addDefaultLives ) ; this . migrationRoutes . post ( `/${ RoutesConstants . REMOVE }/${ RoutesConstants . SOCIAL }/${ RoutesConstants . PROFILE }` , AuthMiddleware . authTokenOnly , MigrationController . removeSocialProfile ) ; this . migrationRoutes . get ( `/${ RoutesConstants . UPDATE }/${ RoutesConstants . ALL }` , AuthMiddleware . adminOnly , MigrationController . updateAllGame ) ; this . migrationRoutes . get ( `/${ RoutesConstants . UPDATE }/${ RoutesConstants . ADD }/${ RoutesConstants . GAMEOVERAT }` , AuthMiddleware . authTokenOnly , MigrationController . addGameOverAtField ) ; this . migrationRoutes . post ( `/${ RoutesConstants . REMOVE }/${ RoutesConstants . ACCOUNTS }` , AuthMiddleware . authTokenOnly , MigrationController . removeAllAccounts ) ; this . migrationRoutes . post ( `/${ RoutesConstants . USER }/${ RoutesConstants . UPDATE_USER_GAME_PLAYED_WITH_STAT }` , AuthMiddleware . authTokenOnly , MigrationController . updateUserGamePlayedWithStat ) ; this . migrationRoutes . post ( `/question/renderwebview` , AuthMiddleware . authTokenOnly , MigrationController . generateRenderedQuestion ) ; this . migrationRoutes . post ( `/${ RoutesConstants . QUESTION }/${ RoutesConstants . UPDATE_DASH_QUESTION_DASH_STATS }` , AuthMiddleware . authTokenOnly , MigrationController . updateQuestionStats ) ; } } export default new MigrationRoutes ( ) . migrationRoutes ;