diff --git a/docker-compose.yml b/docker-compose.yml index 3f2d669b..abab8cf3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: db: - # image: ghcr.io/5e-bits/5e-database:latest - build: ../5e-database + image: ghcr.io/5e-bits/5e-database:latest + # build: ../5e-database ports: - '27017:27017' diff --git a/src/controllers/api/2014/abilityScoreController.ts b/src/controllers/api/2014/abilityScoreController.ts new file mode 100644 index 00000000..b48b05f5 --- /dev/null +++ b/src/controllers/api/2014/abilityScoreController.ts @@ -0,0 +1,4 @@ +import AbilityScore from '../../../models/2014/abilityScore/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(AbilityScore); diff --git a/src/controllers/api/2014/alignmentController.ts b/src/controllers/api/2014/alignmentController.ts new file mode 100644 index 00000000..ce4d912c --- /dev/null +++ b/src/controllers/api/2014/alignmentController.ts @@ -0,0 +1,4 @@ +import Alignment from '../../../models/2014/alignment/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Alignment); diff --git a/src/controllers/api/2014/backgroundController.ts b/src/controllers/api/2014/backgroundController.ts new file mode 100644 index 00000000..c25c1d57 --- /dev/null +++ b/src/controllers/api/2014/backgroundController.ts @@ -0,0 +1,4 @@ +import Background from '../../../models/2014/background/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Background); diff --git a/src/controllers/api/classController.ts b/src/controllers/api/2014/classController.ts similarity index 92% rename from src/controllers/api/classController.ts rename to src/controllers/api/2014/classController.ts index 47381d3b..8c876d2b 100644 --- a/src/controllers/api/classController.ts +++ b/src/controllers/api/2014/classController.ts @@ -1,14 +1,14 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp } from '../../util/index.js'; - -import Class from '../../models/2014/class/index.js'; -import Feature from '../../models/2014/feature/index.js'; -import Level from '../../models/2014/level/index.js'; -import Proficiency from '../../models/2014/proficiency/index.js'; -import SimpleController from '../simpleController.js'; -import Spell from '../../models/2014/spell/index.js'; -import Subclass from '../../models/2014/subclass/index.js'; +import { ResourceList, escapeRegExp } from '../../../util/index.js'; + +import Class from '../../../models/2014/class/index.js'; +import Feature from '../../../models/2014/feature/index.js'; +import Level from '../../../models/2014/level/index.js'; +import Proficiency from '../../../models/2014/proficiency/index.js'; +import SimpleController from '../../simpleController.js'; +import Spell from '../../../models/2014/spell/index.js'; +import Subclass from '../../../models/2014/subclass/index.js'; const simpleController = new SimpleController(Class); interface ShowLevelsForClassQuery { diff --git a/src/controllers/api/2014/conditionController.ts b/src/controllers/api/2014/conditionController.ts new file mode 100644 index 00000000..28004bd7 --- /dev/null +++ b/src/controllers/api/2014/conditionController.ts @@ -0,0 +1,4 @@ +import Condition from '../../../models/2014/condition/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Condition); diff --git a/src/controllers/api/2014/damageTypeController.ts b/src/controllers/api/2014/damageTypeController.ts new file mode 100644 index 00000000..1771c0d3 --- /dev/null +++ b/src/controllers/api/2014/damageTypeController.ts @@ -0,0 +1,4 @@ +import DamageType from '../../../models/2014/damageType/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(DamageType); diff --git a/src/controllers/api/2014/equipmentCategoryController.ts b/src/controllers/api/2014/equipmentCategoryController.ts new file mode 100644 index 00000000..1e7830f0 --- /dev/null +++ b/src/controllers/api/2014/equipmentCategoryController.ts @@ -0,0 +1,4 @@ +import EquipmentCategory from '../../../models/2014/equipmentCategory/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(EquipmentCategory); diff --git a/src/controllers/api/2014/equipmentController.ts b/src/controllers/api/2014/equipmentController.ts new file mode 100644 index 00000000..993d45ea --- /dev/null +++ b/src/controllers/api/2014/equipmentController.ts @@ -0,0 +1,4 @@ +import Equipment from '../../../models/2014/equipment/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Equipment); diff --git a/src/controllers/api/2014/featController.ts b/src/controllers/api/2014/featController.ts new file mode 100644 index 00000000..a2dcc737 --- /dev/null +++ b/src/controllers/api/2014/featController.ts @@ -0,0 +1,4 @@ +import Feat from '../../../models/2014/feat/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Feat); diff --git a/src/controllers/api/2014/featureController.ts b/src/controllers/api/2014/featureController.ts new file mode 100644 index 00000000..e18ec857 --- /dev/null +++ b/src/controllers/api/2014/featureController.ts @@ -0,0 +1,4 @@ +import Feature from '../../../models/2014/feature/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Feature); diff --git a/src/controllers/api/imageController.ts b/src/controllers/api/2014/imageController.ts similarity index 93% rename from src/controllers/api/imageController.ts rename to src/controllers/api/2014/imageController.ts index ddd58fa6..683bfcd8 100644 --- a/src/controllers/api/imageController.ts +++ b/src/controllers/api/2014/imageController.ts @@ -1,7 +1,7 @@ import { NextFunction, Request, Response } from 'express'; import { GetObjectCommand } from '@aws-sdk/client-s3'; -import { awsS3Client } from '../../util/index.js'; +import { awsS3Client } from '../../../util/index.js'; const show = async (req: Request, res: Response, next: NextFunction) => { try { diff --git a/src/controllers/api/2014/languageController.ts b/src/controllers/api/2014/languageController.ts new file mode 100644 index 00000000..7047734e --- /dev/null +++ b/src/controllers/api/2014/languageController.ts @@ -0,0 +1,4 @@ +import Language from '../../../models/2014/language/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Language); diff --git a/src/controllers/api/magicItemController.ts b/src/controllers/api/2014/magicItemController.ts similarity index 88% rename from src/controllers/api/magicItemController.ts rename to src/controllers/api/2014/magicItemController.ts index 2aa3e514..42919c76 100644 --- a/src/controllers/api/magicItemController.ts +++ b/src/controllers/api/2014/magicItemController.ts @@ -1,7 +1,7 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp, redisClient } from '../../util/index.js'; -import MagicItem from '../../models/2014/magicItem/index.js'; +import { ResourceList, escapeRegExp, redisClient } from '../../../util/index.js'; +import MagicItem from '../../../models/2014/magicItem/index.js'; interface IndexQuery { name?: { $regex: RegExp }; diff --git a/src/controllers/api/2014/magicSchoolController.ts b/src/controllers/api/2014/magicSchoolController.ts new file mode 100644 index 00000000..fa7ddf1c --- /dev/null +++ b/src/controllers/api/2014/magicSchoolController.ts @@ -0,0 +1,4 @@ +import MagicSchool from '../../../models/2014/magicSchool/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(MagicSchool); diff --git a/src/controllers/api/monsterController.ts b/src/controllers/api/2014/monsterController.ts similarity index 91% rename from src/controllers/api/monsterController.ts rename to src/controllers/api/2014/monsterController.ts index 6f856cc3..97b68970 100644 --- a/src/controllers/api/monsterController.ts +++ b/src/controllers/api/2014/monsterController.ts @@ -1,8 +1,8 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp, redisClient } from '../../util/index.js'; +import { ResourceList, escapeRegExp, redisClient } from '../../../util/index.js'; -import Monster from '../../models/2014/monster/index.js'; +import Monster from '../../../models/2014/monster/index.js'; interface IndexQuery { name?: { $regex: RegExp }; diff --git a/src/controllers/api/2014/proficiencyController.ts b/src/controllers/api/2014/proficiencyController.ts new file mode 100644 index 00000000..f5a912a6 --- /dev/null +++ b/src/controllers/api/2014/proficiencyController.ts @@ -0,0 +1,4 @@ +import Proficiency from '../../../models/2014/proficiency/index.js'; +import SimpleController from '../../simpleController.js'; + +export default new SimpleController(Proficiency); diff --git a/src/controllers/api/raceController.ts b/src/controllers/api/2014/raceController.ts similarity index 81% rename from src/controllers/api/raceController.ts rename to src/controllers/api/2014/raceController.ts index 9234cc86..8639d298 100644 --- a/src/controllers/api/raceController.ts +++ b/src/controllers/api/2014/raceController.ts @@ -1,11 +1,11 @@ import { Request, Response, NextFunction } from 'express'; -import Proficiency from '../../models/2014/proficiency/index.js'; -import Race from '../../models/2014/race/index.js'; -import { ResourceList } from '../../util/data.js'; -import SimpleController from '../simpleController.js'; -import Subrace from '../../models/2014/subrace/index.js'; -import Trait from '../../models/2014/trait/index.js'; +import Proficiency from '../../../models/2014/proficiency/index.js'; +import Race from '../../../models/2014/race/index.js'; +import { ResourceList } from '../../../util/data.js'; +import SimpleController from '../../simpleController.js'; +import Subrace from '../../../models/2014/subrace/index.js'; +import Trait from '../../../models/2014/trait/index.js'; const simpleController = new SimpleController(Race); diff --git a/src/controllers/api/ruleController.ts b/src/controllers/api/2014/ruleController.ts similarity index 90% rename from src/controllers/api/ruleController.ts rename to src/controllers/api/2014/ruleController.ts index 960669b5..aca112ef 100644 --- a/src/controllers/api/ruleController.ts +++ b/src/controllers/api/2014/ruleController.ts @@ -1,7 +1,7 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp, redisClient } from '../../util/index.js'; +import { ResourceList, escapeRegExp, redisClient } from '../../../util/index.js'; -import Rule from '../../models/2014/rule/index.js'; +import Rule from '../../../models/2014/rule/index.js'; interface IndexQuery { name?: { $regex: RegExp }; diff --git a/src/controllers/api/ruleSectionController.ts b/src/controllers/api/2014/ruleSectionController.ts similarity index 89% rename from src/controllers/api/ruleSectionController.ts rename to src/controllers/api/2014/ruleSectionController.ts index 40ecea4e..fc50ace3 100644 --- a/src/controllers/api/ruleSectionController.ts +++ b/src/controllers/api/2014/ruleSectionController.ts @@ -1,7 +1,7 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp, redisClient } from '../../util/index.js'; +import { ResourceList, escapeRegExp, redisClient } from '../../../util/index.js'; -import RuleSection from '../../models/2014/ruleSection/index.js'; +import RuleSection from '../../../models/2014/ruleSection/index.js'; interface IndexQuery { name?: { $regex: RegExp }; desc?: { $regex: RegExp }; diff --git a/src/controllers/api/2014/skillController.ts b/src/controllers/api/2014/skillController.ts new file mode 100644 index 00000000..f201376b --- /dev/null +++ b/src/controllers/api/2014/skillController.ts @@ -0,0 +1,4 @@ +import SimpleController from '../../simpleController.js'; +import Skill from '../../../models/2014/skill/index.js'; + +export default new SimpleController(Skill); diff --git a/src/controllers/api/spellController.ts b/src/controllers/api/2014/spellController.ts similarity index 92% rename from src/controllers/api/spellController.ts rename to src/controllers/api/2014/spellController.ts index d9491ec7..f352ceb6 100644 --- a/src/controllers/api/spellController.ts +++ b/src/controllers/api/2014/spellController.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express'; -import { ResourceList, escapeRegExp, redisClient } from '../../util/index.js'; +import { ResourceList, escapeRegExp, redisClient } from '../../../util/index.js'; interface IndexQuery { name?: { $regex: RegExp }; @@ -7,7 +7,7 @@ interface IndexQuery { 'school.name'?: { $in: RegExp[] }; } -import Spell from '../../models/2014/spell/index.js'; +import Spell from '../../../models/2014/spell/index.js'; export const index = async (req: Request, res: Response, next: NextFunction) => { try { diff --git a/src/controllers/api/subclassController.ts b/src/controllers/api/2014/subclassController.ts similarity index 88% rename from src/controllers/api/subclassController.ts rename to src/controllers/api/2014/subclassController.ts index b9cc7082..5cf0f059 100644 --- a/src/controllers/api/subclassController.ts +++ b/src/controllers/api/2014/subclassController.ts @@ -1,9 +1,9 @@ import { Request, Response, NextFunction } from 'express'; -import Feature from '../../models/2014/feature/index.js'; -import Level from '../../models/2014/level/index.js'; -import { ResourceList } from '../../util/data.js'; -import SimpleController from '../simpleController.js'; -import Subclass from '../../models/2014/subclass/index.js'; +import Feature from '../../../models/2014/feature/index.js'; +import Level from '../../../models/2014/level/index.js'; +import { ResourceList } from '../../../util/data.js'; +import SimpleController from '../../simpleController.js'; +import Subclass from '../../../models/2014/subclass/index.js'; const simpleController = new SimpleController(Subclass); diff --git a/src/controllers/api/subraceController.ts b/src/controllers/api/2014/subraceController.ts similarity index 79% rename from src/controllers/api/subraceController.ts rename to src/controllers/api/2014/subraceController.ts index c788fd44..9afabeba 100644 --- a/src/controllers/api/subraceController.ts +++ b/src/controllers/api/2014/subraceController.ts @@ -1,9 +1,9 @@ import { Request, Response, NextFunction } from 'express'; -import Proficiency from '../../models/2014/proficiency/index.js'; -import { ResourceList } from '../../util/data.js'; -import SimpleController from '../simpleController.js'; -import Subrace from '../../models/2014/subrace/index.js'; -import Trait from '../../models/2014/trait/index.js'; +import Proficiency from '../../../models/2014/proficiency/index.js'; +import { ResourceList } from '../../../util/data.js'; +import SimpleController from '../../simpleController.js'; +import Subrace from '../../../models/2014/subrace/index.js'; +import Trait from '../../../models/2014/trait/index.js'; const simpleController = new SimpleController(Subrace); diff --git a/src/controllers/api/2014/traitController.ts b/src/controllers/api/2014/traitController.ts new file mode 100644 index 00000000..8ca93b25 --- /dev/null +++ b/src/controllers/api/2014/traitController.ts @@ -0,0 +1,4 @@ +import SimpleController from '../../simpleController.js'; +import Trait from '../../../models/2014/trait/index.js'; + +export default new SimpleController(Trait); diff --git a/src/controllers/api/2014/weaponPropertyController.ts b/src/controllers/api/2014/weaponPropertyController.ts new file mode 100644 index 00000000..42088f7f --- /dev/null +++ b/src/controllers/api/2014/weaponPropertyController.ts @@ -0,0 +1,4 @@ +import SimpleController from '../../simpleController.js'; +import WeaponProperty from '../../../models/2014/weaponProperty/index.js'; + +export default new SimpleController(WeaponProperty); diff --git a/src/controllers/api/abilityScoreController.ts b/src/controllers/api/abilityScoreController.ts deleted file mode 100644 index 784927a3..00000000 --- a/src/controllers/api/abilityScoreController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import AbilityScore from '../../models/2014/abilityScore/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(AbilityScore); diff --git a/src/controllers/api/alignmentController.ts b/src/controllers/api/alignmentController.ts deleted file mode 100644 index 60645334..00000000 --- a/src/controllers/api/alignmentController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Alignment from '../../models/2014/alignment/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Alignment); diff --git a/src/controllers/api/backgroundController.ts b/src/controllers/api/backgroundController.ts deleted file mode 100644 index 0abbfca1..00000000 --- a/src/controllers/api/backgroundController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Background from '../../models/2014/background/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Background); diff --git a/src/controllers/api/conditionController.ts b/src/controllers/api/conditionController.ts deleted file mode 100644 index ebde94ac..00000000 --- a/src/controllers/api/conditionController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Condition from '../../models/2014/condition/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Condition); diff --git a/src/controllers/api/damageTypeController.ts b/src/controllers/api/damageTypeController.ts deleted file mode 100644 index e389b661..00000000 --- a/src/controllers/api/damageTypeController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import DamageType from '../../models/2014/damageType/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(DamageType); diff --git a/src/controllers/api/equipmentCategoryController.ts b/src/controllers/api/equipmentCategoryController.ts deleted file mode 100644 index 2da9c825..00000000 --- a/src/controllers/api/equipmentCategoryController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import EquipmentCategory from '../../models/2014/equipmentCategory/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(EquipmentCategory); diff --git a/src/controllers/api/equipmentController.ts b/src/controllers/api/equipmentController.ts deleted file mode 100644 index bf3534e8..00000000 --- a/src/controllers/api/equipmentController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Equipment from '../../models/2014/equipment/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Equipment); diff --git a/src/controllers/api/featController.ts b/src/controllers/api/featController.ts deleted file mode 100644 index b37b0207..00000000 --- a/src/controllers/api/featController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Feat from '../../models/2014/feat/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Feat); diff --git a/src/controllers/api/featureController.ts b/src/controllers/api/featureController.ts deleted file mode 100644 index a1a130bc..00000000 --- a/src/controllers/api/featureController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Feature from '../../models/2014/feature/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Feature); diff --git a/src/controllers/api/languageController.ts b/src/controllers/api/languageController.ts deleted file mode 100644 index f6c4f5a8..00000000 --- a/src/controllers/api/languageController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Language from '../../models/2014/language/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Language); diff --git a/src/controllers/api/magicSchoolController.ts b/src/controllers/api/magicSchoolController.ts deleted file mode 100644 index 0d04753a..00000000 --- a/src/controllers/api/magicSchoolController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import MagicSchool from '../../models/2014/magicSchool/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(MagicSchool); diff --git a/src/controllers/api/proficiencyController.ts b/src/controllers/api/proficiencyController.ts deleted file mode 100644 index 644e6713..00000000 --- a/src/controllers/api/proficiencyController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Proficiency from '../../models/2014/proficiency/index.js'; -import SimpleController from '../simpleController.js'; - -export default new SimpleController(Proficiency); diff --git a/src/controllers/api/skillController.ts b/src/controllers/api/skillController.ts deleted file mode 100644 index 61a7062a..00000000 --- a/src/controllers/api/skillController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import SimpleController from '../simpleController.js'; -import Skill from '../../models/2014/skill/index.js'; - -export default new SimpleController(Skill); diff --git a/src/controllers/api/traitController.ts b/src/controllers/api/traitController.ts deleted file mode 100644 index d580bb0f..00000000 --- a/src/controllers/api/traitController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import SimpleController from '../simpleController.js'; -import Trait from '../../models/2014/trait/index.js'; - -export default new SimpleController(Trait); diff --git a/src/controllers/api/v2014Controller.ts b/src/controllers/api/v2014Controller.ts new file mode 100644 index 00000000..273501e1 --- /dev/null +++ b/src/controllers/api/v2014Controller.ts @@ -0,0 +1,22 @@ +import { Request, Response, NextFunction } from 'express'; +import Collection from '../../models/2014/collection/index.js'; + +export const index = async (req: Request, res: Response, next: NextFunction) => { + try { + const data = await Collection.find({}) + .select({ index: 1, _id: 0 }) + .sort({ index: 'asc' }) + .exec(); + + const apiIndex: Record = {}; + data.forEach((item) => { + if (item.index === 'levels') return; + + apiIndex[item.index] = `/api/2014/${item.index}`; + }); + + return res.status(200).json(apiIndex); + } catch (err) { + next(err); + } +}; diff --git a/src/controllers/api/weaponPropertyController.ts b/src/controllers/api/weaponPropertyController.ts deleted file mode 100644 index be6b81af..00000000 --- a/src/controllers/api/weaponPropertyController.ts +++ /dev/null @@ -1,4 +0,0 @@ -import SimpleController from '../simpleController.js'; -import WeaponProperty from '../../models/2014/weaponProperty/index.js'; - -export default new SimpleController(WeaponProperty); diff --git a/src/controllers/apiController.ts b/src/controllers/apiController.ts index f01336c7..a8a934f3 100644 --- a/src/controllers/apiController.ts +++ b/src/controllers/apiController.ts @@ -8,7 +8,7 @@ export const index = async (req: Request, res: Response, next: NextFunction) => .sort({ index: 'asc' }) .exec(); - const apiIndex: Record = {}; + const apiIndex: Record = { '2014': '/api/2014' }; data.forEach((item) => { if (item.index === 'levels') return; diff --git a/src/routes/api.ts b/src/routes/api.ts index a29af661..a1208f45 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -24,7 +24,8 @@ import { SubracesHandler, TraitsHandler, WeaponPropertiesHandler, -} from './api/index.js'; +} from './api/2014/index.js'; +import V2014Handler from './api/2014.js'; import express from 'express'; import { index } from '../controllers/apiController.js'; @@ -32,6 +33,7 @@ import { index } from '../controllers/apiController.js'; const router = express.Router(); router.get('/', index); +router.use('/2014', V2014Handler); router.use('/ability-scores', AbilityScoresHandler); router.use('/alignments', AlignmentsHandler); diff --git a/src/routes/api/2014.ts b/src/routes/api/2014.ts new file mode 100644 index 00000000..9206ff64 --- /dev/null +++ b/src/routes/api/2014.ts @@ -0,0 +1,62 @@ +import { + AbilityScoresHandler, + AlignmentsHandler, + BackgroundsHandler, + ClassesHandler, + ConditionsHandler, + DamageTypesHandler, + EquipmentCategoriesHandler, + EquipmentHandler, + FeatsHandler, + FeaturesHandler, + ImageHandler, + LanguagesHandler, + MagicItemsHandler, + MagicSchoolsHandler, + MonstersHandler, + ProficienciesHandler, + RacesHandler, + RuleSectionsHandler, + RulesHandler, + SkillsHandler, + SpellsHandler, + SubclassesHandler, + SubracesHandler, + TraitsHandler, + WeaponPropertiesHandler, +} from './2014/index.js'; + +import express from 'express'; +import { index } from '../../controllers/api/v2014Controller.js'; + +const router = express.Router(); + +router.get('/', index); + +router.use('/ability-scores', AbilityScoresHandler); +router.use('/alignments', AlignmentsHandler); +router.use('/backgrounds', BackgroundsHandler); +router.use('/classes', ClassesHandler); +router.use('/conditions', ConditionsHandler); +router.use('/damage-types', DamageTypesHandler); +router.use('/equipment-categories', EquipmentCategoriesHandler); +router.use('/equipment', EquipmentHandler); +router.use('/feats', FeatsHandler); +router.use('/features', FeaturesHandler); +router.use('/images', ImageHandler); +router.use('/languages', LanguagesHandler); +router.use('/magic-items', MagicItemsHandler); +router.use('/magic-schools', MagicSchoolsHandler); +router.use('/monsters', MonstersHandler); +router.use('/proficiencies', ProficienciesHandler); +router.use('/races', RacesHandler); +router.use('/rules', RulesHandler); +router.use('/rule-sections', RuleSectionsHandler); +router.use('/skills', SkillsHandler); +router.use('/spells', SpellsHandler); +router.use('/subclasses', SubclassesHandler); +router.use('/subraces', SubracesHandler); +router.use('/traits', TraitsHandler); +router.use('/weapon-properties', WeaponPropertiesHandler); + +export default router; diff --git a/src/routes/api/abilityScores.ts b/src/routes/api/2014/abilityScores.ts similarity index 50% rename from src/routes/api/abilityScores.ts rename to src/routes/api/2014/abilityScores.ts index 4455d0bc..9efb8613 100644 --- a/src/routes/api/abilityScores.ts +++ b/src/routes/api/2014/abilityScores.ts @@ -1,13 +1,13 @@ -import AbilityScoreController from '../../controllers/api/abilityScoreController.js'; +import AbilityScoreController from '../../../controllers/api/2014/abilityScoreController.js'; import express from 'express'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { AbilityScoreController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { AbilityScoreController.show(req, res, next); }); diff --git a/src/routes/api/alignments.ts b/src/routes/api/2014/alignments.ts similarity index 51% rename from src/routes/api/alignments.ts rename to src/routes/api/2014/alignments.ts index 0a1c4680..87842fa2 100644 --- a/src/routes/api/alignments.ts +++ b/src/routes/api/2014/alignments.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import AlignmentController from '../../controllers/api/alignmentController.js'; +import AlignmentController from '../../../controllers/api/2014/alignmentController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { AlignmentController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { AlignmentController.show(req, res, next); }); diff --git a/src/routes/api/backgrounds.ts b/src/routes/api/2014/backgrounds.ts similarity index 51% rename from src/routes/api/backgrounds.ts rename to src/routes/api/2014/backgrounds.ts index 66783635..988e532f 100644 --- a/src/routes/api/backgrounds.ts +++ b/src/routes/api/2014/backgrounds.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import BackgroundController from '../../controllers/api/backgroundController.js'; +import BackgroundController from '../../../controllers/api/2014/backgroundController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { BackgroundController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { BackgroundController.show(req, res, next); }); diff --git a/src/routes/api/classes.ts b/src/routes/api/2014/classes.ts similarity index 85% rename from src/routes/api/classes.ts rename to src/routes/api/2014/classes.ts index bee2e0b4..d25bd611 100644 --- a/src/routes/api/classes.ts +++ b/src/routes/api/2014/classes.ts @@ -1,13 +1,13 @@ import * as express from 'express'; -import * as ClassController from '../../controllers/api/classController.js'; +import * as ClassController from '../../../controllers/api/2014/classController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { ClassController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { ClassController.show(req, res, next); }); diff --git a/src/routes/api/conditions.ts b/src/routes/api/2014/conditions.ts similarity index 51% rename from src/routes/api/conditions.ts rename to src/routes/api/2014/conditions.ts index 73a134f3..395c2014 100644 --- a/src/routes/api/conditions.ts +++ b/src/routes/api/2014/conditions.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import ConditionController from '../../controllers/api/conditionController.js'; +import ConditionController from '../../../controllers/api/2014/conditionController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { ConditionController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { ConditionController.show(req, res, next); }); export default router; diff --git a/src/routes/api/damageTypes.ts b/src/routes/api/2014/damageTypes.ts similarity index 51% rename from src/routes/api/damageTypes.ts rename to src/routes/api/2014/damageTypes.ts index af1e3889..9d34e5e6 100644 --- a/src/routes/api/damageTypes.ts +++ b/src/routes/api/2014/damageTypes.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import DamageTypeController from '../../controllers/api/damageTypeController.js'; +import DamageTypeController from '../../../controllers/api/2014/damageTypeController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { DamageTypeController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { DamageTypeController.show(req, res, next); }); diff --git a/src/routes/api/equipment.ts b/src/routes/api/2014/equipment.ts similarity index 51% rename from src/routes/api/equipment.ts rename to src/routes/api/2014/equipment.ts index c5d99dc8..accb0d45 100644 --- a/src/routes/api/equipment.ts +++ b/src/routes/api/2014/equipment.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import EquipmentController from '../../controllers/api/equipmentController.js'; +import EquipmentController from '../../../controllers/api/2014/equipmentController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { EquipmentController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { EquipmentController.show(req, res, next); }); diff --git a/src/routes/api/equipmentCategories.ts b/src/routes/api/2014/equipmentCategories.ts similarity index 51% rename from src/routes/api/equipmentCategories.ts rename to src/routes/api/2014/equipmentCategories.ts index 37f7207d..747b3780 100644 --- a/src/routes/api/equipmentCategories.ts +++ b/src/routes/api/2014/equipmentCategories.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import EquipmentCategoryController from '../../controllers/api/equipmentCategoryController.js'; +import EquipmentCategoryController from '../../../controllers/api/2014/equipmentCategoryController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { EquipmentCategoryController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { EquipmentCategoryController.show(req, res, next); }); diff --git a/src/routes/api/feats.ts b/src/routes/api/2014/feats.ts similarity index 51% rename from src/routes/api/feats.ts rename to src/routes/api/2014/feats.ts index ba58df6d..ce835423 100644 --- a/src/routes/api/feats.ts +++ b/src/routes/api/2014/feats.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import FeatController from '../../controllers/api/featController.js'; +import FeatController from '../../../controllers/api/2014/featController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { FeatController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { FeatController.show(req, res, next); }); diff --git a/src/routes/api/features.ts b/src/routes/api/2014/features.ts similarity index 51% rename from src/routes/api/features.ts rename to src/routes/api/2014/features.ts index 1a92c60d..94bcd564 100644 --- a/src/routes/api/features.ts +++ b/src/routes/api/2014/features.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import FeatureController from '../../controllers/api/featureController.js'; +import FeatureController from '../../../controllers/api/2014/featureController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { FeatureController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { FeatureController.show(req, res, next); }); diff --git a/src/routes/api/images.ts b/src/routes/api/2014/images.ts similarity index 52% rename from src/routes/api/images.ts rename to src/routes/api/2014/images.ts index 92cf1342..636da639 100644 --- a/src/routes/api/images.ts +++ b/src/routes/api/2014/images.ts @@ -1,10 +1,10 @@ import * as express from 'express'; -import ImageController from '../../controllers/api/imageController.js'; +import ImageController from '../../../controllers/api/2014/imageController.js'; const router = express.Router(); -router.get('/*', function(req, res, next) { +router.get('/*', function (req, res, next) { ImageController.show(req, res, next); }); diff --git a/src/routes/api/index.ts b/src/routes/api/2014/index.ts similarity index 100% rename from src/routes/api/index.ts rename to src/routes/api/2014/index.ts diff --git a/src/routes/api/languages.ts b/src/routes/api/2014/languages.ts similarity index 51% rename from src/routes/api/languages.ts rename to src/routes/api/2014/languages.ts index 61d2599e..c82bbabb 100644 --- a/src/routes/api/languages.ts +++ b/src/routes/api/2014/languages.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import LanguageController from '../../controllers/api/languageController.js'; +import LanguageController from '../../../controllers/api/2014/languageController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { LanguageController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { LanguageController.show(req, res, next); }); diff --git a/src/routes/api/magicItems.ts b/src/routes/api/2014/magicItems.ts similarity index 66% rename from src/routes/api/magicItems.ts rename to src/routes/api/2014/magicItems.ts index 6f20f1c5..cc7d45d1 100644 --- a/src/routes/api/magicItems.ts +++ b/src/routes/api/2014/magicItems.ts @@ -1,4 +1,4 @@ -import * as MagicItemController from '../../controllers/api/magicItemController.js'; +import * as MagicItemController from '../../../controllers/api/2014/magicItemController.js'; import * as express from 'express'; const router = express.Router(); diff --git a/src/routes/api/magicSchools.ts b/src/routes/api/2014/magicSchools.ts similarity index 51% rename from src/routes/api/magicSchools.ts rename to src/routes/api/2014/magicSchools.ts index e383693b..75e5c948 100644 --- a/src/routes/api/magicSchools.ts +++ b/src/routes/api/2014/magicSchools.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import MagicSchoolController from '../../controllers/api/magicSchoolController.js'; +import MagicSchoolController from '../../../controllers/api/2014/magicSchoolController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { MagicSchoolController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { MagicSchoolController.show(req, res, next); }); diff --git a/src/routes/api/monsters.ts b/src/routes/api/2014/monsters.ts similarity index 67% rename from src/routes/api/monsters.ts rename to src/routes/api/2014/monsters.ts index b73d1d91..be0376e7 100644 --- a/src/routes/api/monsters.ts +++ b/src/routes/api/2014/monsters.ts @@ -1,4 +1,4 @@ -import * as MonsterController from '../../controllers/api/monsterController.js'; +import * as MonsterController from '../../../controllers/api/2014/monsterController.js'; import * as express from 'express'; const router = express.Router(); diff --git a/src/routes/api/proficiencies.ts b/src/routes/api/2014/proficiencies.ts similarity index 51% rename from src/routes/api/proficiencies.ts rename to src/routes/api/2014/proficiencies.ts index 7475261a..156f7fbc 100644 --- a/src/routes/api/proficiencies.ts +++ b/src/routes/api/2014/proficiencies.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import ProficiencyController from '../../controllers/api/proficiencyController.js'; +import ProficiencyController from '../../../controllers/api/2014/proficiencyController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { ProficiencyController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { ProficiencyController.show(req, res, next); }); diff --git a/src/routes/api/races.ts b/src/routes/api/2014/races.ts similarity index 69% rename from src/routes/api/races.ts rename to src/routes/api/2014/races.ts index 42ff42e8..bccb9269 100644 --- a/src/routes/api/races.ts +++ b/src/routes/api/2014/races.ts @@ -1,13 +1,13 @@ -import * as RaceController from '../../controllers/api/raceController.js'; +import * as RaceController from '../../../controllers/api/2014/raceController.js'; import * as express from 'express'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { RaceController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { RaceController.show(req, res, next); }); diff --git a/src/routes/api/rule-sections.ts b/src/routes/api/2014/rule-sections.ts similarity index 66% rename from src/routes/api/rule-sections.ts rename to src/routes/api/2014/rule-sections.ts index 0f16b22f..65dc581a 100644 --- a/src/routes/api/rule-sections.ts +++ b/src/routes/api/2014/rule-sections.ts @@ -1,4 +1,4 @@ -import * as RuleSectionController from '../../controllers/api/ruleSectionController.js'; +import * as RuleSectionController from '../../../controllers/api/2014/ruleSectionController.js'; import * as express from 'express'; const router = express.Router(); diff --git a/src/routes/api/rules.ts b/src/routes/api/2014/rules.ts similarity index 68% rename from src/routes/api/rules.ts rename to src/routes/api/2014/rules.ts index 8db56be1..1befff92 100644 --- a/src/routes/api/rules.ts +++ b/src/routes/api/2014/rules.ts @@ -1,4 +1,4 @@ -import * as RuleController from '../../controllers/api/ruleController.js'; +import * as RuleController from '../../../controllers/api/2014/ruleController.js'; import * as express from 'express'; const router = express.Router(); diff --git a/src/routes/api/skills.ts b/src/routes/api/2014/skills.ts similarity index 51% rename from src/routes/api/skills.ts rename to src/routes/api/2014/skills.ts index 77b9acfa..f08bd345 100644 --- a/src/routes/api/skills.ts +++ b/src/routes/api/2014/skills.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import SkillController from '../../controllers/api/skillController.js'; +import SkillController from '../../../controllers/api/2014/skillController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { SkillController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { SkillController.show(req, res, next); }); export default router; diff --git a/src/routes/api/spells.ts b/src/routes/api/2014/spells.ts similarity index 67% rename from src/routes/api/spells.ts rename to src/routes/api/2014/spells.ts index c6dbadcf..fe9e36ee 100644 --- a/src/routes/api/spells.ts +++ b/src/routes/api/2014/spells.ts @@ -1,4 +1,4 @@ -import * as SpellController from '../../controllers/api/spellController.js'; +import * as SpellController from '../../../controllers/api/2014/spellController.js'; import * as express from 'express'; const router = express.Router(); diff --git a/src/routes/api/subclasses.ts b/src/routes/api/2014/subclasses.ts similarity index 73% rename from src/routes/api/subclasses.ts rename to src/routes/api/2014/subclasses.ts index cb69ed64..76856450 100644 --- a/src/routes/api/subclasses.ts +++ b/src/routes/api/2014/subclasses.ts @@ -1,13 +1,13 @@ -import * as SubclassController from '../../controllers/api/subclassController.js'; +import * as SubclassController from '../../../controllers/api/2014/subclassController.js'; import * as express from 'express'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { SubclassController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { SubclassController.show(req, res, next); }); diff --git a/src/routes/api/subraces.ts b/src/routes/api/2014/subraces.ts similarity index 65% rename from src/routes/api/subraces.ts rename to src/routes/api/2014/subraces.ts index 94709b41..e9d85cb7 100644 --- a/src/routes/api/subraces.ts +++ b/src/routes/api/2014/subraces.ts @@ -1,13 +1,13 @@ -import * as SubraceController from '../../controllers/api/subraceController.js'; +import * as SubraceController from '../../../controllers/api/2014/subraceController.js'; import * as express from 'express'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { SubraceController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { SubraceController.show(req, res, next); }); diff --git a/src/routes/api/traits.ts b/src/routes/api/2014/traits.ts similarity index 51% rename from src/routes/api/traits.ts rename to src/routes/api/2014/traits.ts index 75f79ff3..9933371c 100644 --- a/src/routes/api/traits.ts +++ b/src/routes/api/2014/traits.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import TraitController from '../../controllers/api/traitController.js'; +import TraitController from '../../../controllers/api/2014/traitController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { TraitController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { TraitController.show(req, res, next); }); diff --git a/src/routes/api/weaponProperties.ts b/src/routes/api/2014/weaponProperties.ts similarity index 51% rename from src/routes/api/weaponProperties.ts rename to src/routes/api/2014/weaponProperties.ts index e2e80c00..35851c0b 100644 --- a/src/routes/api/weaponProperties.ts +++ b/src/routes/api/2014/weaponProperties.ts @@ -1,14 +1,14 @@ import * as express from 'express'; -import WeaponPropertyController from '../../controllers/api/weaponPropertyController.js'; +import WeaponPropertyController from '../../../controllers/api/2014/weaponPropertyController.js'; const router = express.Router(); -router.get('/', function(req, res, next) { +router.get('/', function (req, res, next) { WeaponPropertyController.index(req, res, next); }); -router.get('/:index', function(req, res, next) { +router.get('/:index', function (req, res, next) { WeaponPropertyController.show(req, res, next); }); diff --git a/src/tests/controllers/api/abilityScoreController.test.ts b/src/tests/controllers/api/abilityScoreController.test.ts index 0047ef52..f064972a 100644 --- a/src/tests/controllers/api/abilityScoreController.test.ts +++ b/src/tests/controllers/api/abilityScoreController.test.ts @@ -4,7 +4,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import AbilityScore from '../../../models/2014/abilityScore/index.js'; -import AbilityScoreController from '../../../controllers/api/abilityScoreController.js'; +import AbilityScoreController from '../../../controllers/api/2014/abilityScoreController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/classController.test.ts b/src/tests/controllers/api/classController.test.ts index e6b0f32f..8307777e 100644 --- a/src/tests/controllers/api/classController.test.ts +++ b/src/tests/controllers/api/classController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as ClassController from '../../../controllers/api/classController.js'; +import * as ClassController from '../../../controllers/api/2014/classController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/conditionController.test.ts b/src/tests/controllers/api/conditionController.test.ts index 2d81ae15..10148811 100644 --- a/src/tests/controllers/api/conditionController.test.ts +++ b/src/tests/controllers/api/conditionController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Condition from '../../../models/2014/condition/index.js'; -import ConditionController from '../../../controllers/api/conditionController.js'; +import ConditionController from '../../../controllers/api/2014/conditionController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/damageTypeController.test.ts b/src/tests/controllers/api/damageTypeController.test.ts index 459a4987..d0eec153 100644 --- a/src/tests/controllers/api/damageTypeController.test.ts +++ b/src/tests/controllers/api/damageTypeController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import DamageType from '../../../models/2014/damageType/index.js'; -import DamageTypeController from '../../../controllers/api/damageTypeController.js'; +import DamageTypeController from '../../../controllers/api/2014/damageTypeController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/equipmentCategoryController.test.ts b/src/tests/controllers/api/equipmentCategoryController.test.ts index 9a458f75..c74d72cc 100644 --- a/src/tests/controllers/api/equipmentCategoryController.test.ts +++ b/src/tests/controllers/api/equipmentCategoryController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import EquipmentCategory from '../../../models/2014/equipmentCategory/index.js'; -import EquipmentCategoryController from '../../../controllers/api/equipmentCategoryController.js'; +import EquipmentCategoryController from '../../../controllers/api/2014/equipmentCategoryController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/equipmentController.test.ts b/src/tests/controllers/api/equipmentController.test.ts index 5bfcb760..6f6eec46 100644 --- a/src/tests/controllers/api/equipmentController.test.ts +++ b/src/tests/controllers/api/equipmentController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Equipment from '../../../models/2014/equipment/index.js'; -import EquipmentController from '../../../controllers/api/equipmentController.js'; +import EquipmentController from '../../../controllers/api/2014/equipmentController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/featController.test.ts b/src/tests/controllers/api/featController.test.ts index d68ac50d..30007cce 100644 --- a/src/tests/controllers/api/featController.test.ts +++ b/src/tests/controllers/api/featController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Feat from '../../../models/2014/feat/index.js'; -import FeatController from '../../../controllers/api/featController.js'; +import FeatController from '../../../controllers/api/2014/featController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/featureController.test.ts b/src/tests/controllers/api/featureController.test.ts index 4ef4ffa1..58423635 100644 --- a/src/tests/controllers/api/featureController.test.ts +++ b/src/tests/controllers/api/featureController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Feature from '../../../models/2014/feature/index.js'; -import FeatureController from '../../../controllers/api/featureController.js'; +import FeatureController from '../../../controllers/api/2014/featureController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/languageController.test.ts b/src/tests/controllers/api/languageController.test.ts index 0541c9b8..f50d6ece 100644 --- a/src/tests/controllers/api/languageController.test.ts +++ b/src/tests/controllers/api/languageController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Language from '../../../models/2014/language/index.js'; -import LanguageController from '../../../controllers/api/languageController.js'; +import LanguageController from '../../../controllers/api/2014/languageController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/magicItemController.test.ts b/src/tests/controllers/api/magicItemController.test.ts index 72453d55..0ce70bd0 100644 --- a/src/tests/controllers/api/magicItemController.test.ts +++ b/src/tests/controllers/api/magicItemController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as MagicItemController from '../../../controllers/api/magicItemController.js'; +import * as MagicItemController from '../../../controllers/api/2014/magicItemController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/magicSchoolController.test.ts b/src/tests/controllers/api/magicSchoolController.test.ts index 675130b6..80463fbe 100644 --- a/src/tests/controllers/api/magicSchoolController.test.ts +++ b/src/tests/controllers/api/magicSchoolController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import MagicSchool from '../../../models/2014/magicSchool/index.js'; -import MagicSchoolController from '../../../controllers/api/magicSchoolController.js'; +import MagicSchoolController from '../../../controllers/api/2014/magicSchoolController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/monsterController.test.ts b/src/tests/controllers/api/monsterController.test.ts index 3000dbd1..15a595ed 100644 --- a/src/tests/controllers/api/monsterController.test.ts +++ b/src/tests/controllers/api/monsterController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as MonsterController from '../../../controllers/api/monsterController.js'; +import * as MonsterController from '../../../controllers/api/2014/monsterController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/proficiencyController.test.ts b/src/tests/controllers/api/proficiencyController.test.ts index 3c35abd7..3f7bfef6 100644 --- a/src/tests/controllers/api/proficiencyController.test.ts +++ b/src/tests/controllers/api/proficiencyController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Proficiency from '../../../models/2014/proficiency/index.js'; -import ProficiencyController from '../../../controllers/api/proficiencyController.js'; +import ProficiencyController from '../../../controllers/api/2014/proficiencyController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/raceController.test.ts b/src/tests/controllers/api/raceController.test.ts index 51b8ad74..e8f632d1 100644 --- a/src/tests/controllers/api/raceController.test.ts +++ b/src/tests/controllers/api/raceController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as RaceController from '../../../controllers/api/raceController.js'; +import * as RaceController from '../../../controllers/api/2014/raceController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/ruleSectionController.test.ts b/src/tests/controllers/api/ruleSectionController.test.ts index 6621a6ac..abe6f2d6 100644 --- a/src/tests/controllers/api/ruleSectionController.test.ts +++ b/src/tests/controllers/api/ruleSectionController.test.ts @@ -1,4 +1,4 @@ -import * as RuleSectionController from '../../../controllers/api/ruleSectionController.js'; +import * as RuleSectionController from '../../../controllers/api/2014/ruleSectionController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/rulesController.test.ts b/src/tests/controllers/api/rulesController.test.ts index e842ccaa..3fea0983 100644 --- a/src/tests/controllers/api/rulesController.test.ts +++ b/src/tests/controllers/api/rulesController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as RulesController from '../../../controllers/api/ruleController.js'; +import * as RulesController from '../../../controllers/api/2014/ruleController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/skillController.test.ts b/src/tests/controllers/api/skillController.test.ts index 5101159b..5400745c 100644 --- a/src/tests/controllers/api/skillController.test.ts +++ b/src/tests/controllers/api/skillController.test.ts @@ -3,7 +3,7 @@ import { mockNext } from '../../support/requestHelpers.js'; import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; import skill from '../../../models/2014/skill/index.js'; -import skillController from '../../../controllers/api/skillController.js'; +import skillController from '../../../controllers/api/2014/skillController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/spellController.test.ts b/src/tests/controllers/api/spellController.test.ts index 9cd40cda..f3ee8f59 100644 --- a/src/tests/controllers/api/spellController.test.ts +++ b/src/tests/controllers/api/spellController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as SpellController from '../../../controllers/api/spellController.js'; +import * as SpellController from '../../../controllers/api/2014/spellController.js'; import { mockNext } from '../../support/requestHelpers.js'; import Spell from '../../../models/2014/spell/index.js'; diff --git a/src/tests/controllers/api/subclassController.test.ts b/src/tests/controllers/api/subclassController.test.ts index 65b46b5f..ba1336de 100644 --- a/src/tests/controllers/api/subclassController.test.ts +++ b/src/tests/controllers/api/subclassController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as SubclassController from '../../../controllers/api/subclassController.js'; +import * as SubclassController from '../../../controllers/api/2014/subclassController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/subraceController.test.ts b/src/tests/controllers/api/subraceController.test.ts index 967b7936..5fc88ea5 100644 --- a/src/tests/controllers/api/subraceController.test.ts +++ b/src/tests/controllers/api/subraceController.test.ts @@ -1,6 +1,6 @@ import mockingoose from 'mockingoose'; import { createRequest, createResponse } from 'node-mocks-http'; -import * as SubraceController from '../../../controllers/api/subraceController.js'; +import * as SubraceController from '../../../controllers/api/2014/subraceController.js'; import { mockNext } from '../../support/requestHelpers.js'; diff --git a/src/tests/controllers/api/traitController.test.ts b/src/tests/controllers/api/traitController.test.ts index d003d742..ad5b6f45 100644 --- a/src/tests/controllers/api/traitController.test.ts +++ b/src/tests/controllers/api/traitController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import Trait from '../../../models/2014/trait/index.js'; -import TraitController from '../../../controllers/api/traitController.js'; +import TraitController from '../../../controllers/api/2014/traitController.js'; beforeEach(() => { mockingoose.resetAll(); diff --git a/src/tests/controllers/api/weaponPropertyController.test.ts b/src/tests/controllers/api/weaponPropertyController.test.ts index f3bd4ff7..be9440f7 100644 --- a/src/tests/controllers/api/weaponPropertyController.test.ts +++ b/src/tests/controllers/api/weaponPropertyController.test.ts @@ -3,7 +3,7 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { mockNext } from '../../support/requestHelpers.js'; import WeaponProperty from '../../../models/2014/weaponProperty/index.js'; -import WeaponPropertyController from '../../../controllers/api/weaponPropertyController.js'; +import WeaponPropertyController from '../../../controllers/api/2014/weaponPropertyController.js'; beforeEach(() => { mockingoose.resetAll();