Skip to content

Commit

Permalink
feat(api): Add updated_at to all entities (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
bagelbits authored Jan 15, 2025
1 parent fb95517 commit 4cf55a0
Show file tree
Hide file tree
Showing 51 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/models/2014/abilityScore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const AbilityScoreSchema = new Schema<AbilityScore>({
name: { type: String, index: true },
skills: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('AbilityScore', AbilityScoreSchema, '2014-ability-scores');
1 change: 1 addition & 0 deletions src/models/2014/abilityScore/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type AbilityScore = {
name: string;
skills: APIReference[] | [];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/alignment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const AlignmentSchema = new Schema<Alignment>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Alignment', AlignmentSchema, '2014-alignments');
1 change: 1 addition & 0 deletions src/models/2014/alignment/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export type Alignment = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const BackgroundSchema = new Schema<Background>({
ideals: ChoiceSchema,
bonds: ChoiceSchema,
flaws: ChoiceSchema,
updated_at: { type: String, index: true },
});

export default model('Background', BackgroundSchema, '2014-backgrounds');
1 change: 1 addition & 0 deletions src/models/2014/background/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export type Background = {
ideals: Choice;
bonds: Choice;
flaws: Choice;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/class/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const ClassSchema = new Schema<Class>({
starting_equipment_options: [ChoiceSchema],
subclasses: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Class', ClassSchema, '2014-classes');
1 change: 1 addition & 0 deletions src/models/2014/class/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ export type Class = {
starting_equipment_options: Choice[];
subclasses: APIReference[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/condition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ConditionSchema = new Schema<Condition>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Condition', ConditionSchema, '2014-conditions');
1 change: 1 addition & 0 deletions src/models/2014/condition/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type Condition = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/damageType/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const DamageTypeSchema = new Schema<DamageType>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('DamageType', DamageTypeSchema, '2014-damage-types');
1 change: 1 addition & 0 deletions src/models/2014/damageType/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type DamageType = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/equipment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const EquipmentSchema = new Schema<Equipment>({
weapon_category: { type: String, index: true },
weapon_range: { type: String, index: true },
weight: { type: Number, index: true },
updated_at: { type: String, index: true },
});

export default model('Equipment', EquipmentSchema, '2014-equipment');
1 change: 1 addition & 0 deletions src/models/2014/equipment/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ export type Equipment = {
weapon_category?: string;
weapon_range?: string;
weight?: number;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/equipmentCategory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const EquipmentCategorySchema = new Schema<EquipmentCategory>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('EquipmentCategory', EquipmentCategorySchema, '2014-equipment-categories');
1 change: 1 addition & 0 deletions src/models/2014/equipmentCategory/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export type EquipmentCategory = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/feat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const FeatSchema = new Schema<Feat>({
prerequisites: [PrerequisiteSchema],
desc: { type: [String], index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Feat', FeatSchema, '2014-feats');
1 change: 1 addition & 0 deletions src/models/2014/feat/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export type Feat = {
prerequisites: Prerequisite[];
desc: string[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/feature/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const FeatureSchema = new Schema<Feature>({
subclass: APIReferenceSchema,
feature_specific: FeatureSpecificSchema,
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Feature', FeatureSchema, '2014-features');
1 change: 1 addition & 0 deletions src/models/2014/feature/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ export type Feature = {
subclass?: APIReference;
feature_specific?: FeatureSpecific;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/language/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const LanguageSchema = new Schema<Language>({
type: { type: String, index: true },
typical_speakers: { type: [String], index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Language', LanguageSchema, '2014-languages');
1 change: 1 addition & 0 deletions src/models/2014/language/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type Language = {
type: string;
typical_speakers: string[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/level/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const LevelSchema = new Schema<Level>({
subclass: APIReferenceSchema,
subclass_specific: SubclassSpecificSchema,
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Level', LevelSchema, '2014-levels');
1 change: 1 addition & 0 deletions src/models/2014/level/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ export type Level = {
subclass?: APIReference;
subclass_specific?: SubclassSpecific;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/magicItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const MagicItemSchema = new Schema<MagicItem>({
url: { type: String, index: true },
variants: [APIReferenceSchema],
variant: Boolean,
updated_at: { type: String, index: true },
});

export default model('MagicItem', MagicItemSchema, '2014-magic-items');
1 change: 1 addition & 0 deletions src/models/2014/magicItem/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export type MagicItem = {
url: string;
variants: APIReference[];
variant: boolean;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/magicSchool/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const MagicSchoolSchema = new Schema<MagicSchool>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('MagicSchool', MagicSchoolSchema, '2014-magic-schools');
1 change: 1 addition & 0 deletions src/models/2014/magicSchool/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type MagicSchool = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/monster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const Monster = new Schema<Monster>({
url: { type: String, index: true },
wisdom: { type: Number, index: true },
xp: { type: Number, index: true },
updated_at: { type: String, index: true },
});

export default model('Monster', Monster, '2014-monsters');
1 change: 1 addition & 0 deletions src/models/2014/monster/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,5 @@ export type Monster = {
url: string;
wisdom: number;
xp: number;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/proficiency/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const ProficiencySchema = new Schema<Proficiency>({
reference: ReferenceSchema,
type: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Proficiency', ProficiencySchema, '2014-proficiencies');
1 change: 1 addition & 0 deletions src/models/2014/proficiency/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export type Proficiency = {
reference: Reference;
type: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/race/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const RaceSchema = new Schema<Race>({
subraces: [APIReferenceSchema],
traits: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Race', RaceSchema, '2014-races');
1 change: 1 addition & 0 deletions src/models/2014/race/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export type Race = {
subraces?: APIReference[];
traits?: APIReference[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/rule/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const RuleSchema = new Schema<Rule>({
name: { type: String, index: true },
subsections: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Rule', RuleSchema, '2014-rules');
1 change: 1 addition & 0 deletions src/models/2014/rule/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type Rule = {
name: string;
subsections: APIReference[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/ruleSection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const RuleSectionSchema = new Schema<RuleSection>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('RuleSection', RuleSectionSchema, '2014-rule-sections');
1 change: 1 addition & 0 deletions src/models/2014/ruleSection/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type RuleSection = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/skill/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const SkillSchema = new Schema<Skill>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Skill', SkillSchema, '2014-skills');
1 change: 1 addition & 0 deletions src/models/2014/skill/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type Skill = {
index: string;
name: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/spell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const Spell = new Schema({
school: APIReferenceSchema,
subclasses: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Spell', Spell, '2014-spells');
1 change: 1 addition & 0 deletions src/models/2014/spell/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ export interface Spell {
school: APIReference;
subclasses?: APIReference[];
url: string;
updated_at: string;
}
1 change: 1 addition & 0 deletions src/models/2014/subclass/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const SubclassSchema = new Schema<Subclass>({
subclass_flavor: { type: String, index: true },
subclass_levels: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Subclass', SubclassSchema, '2014-subclasses');
1 change: 1 addition & 0 deletions src/models/2014/subclass/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export type Subclass = {
subclass_flavor: string;
subclass_levels: string;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/subrace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Subrace = new Schema<Subrace>({
racial_traits: [APIReferenceSchema],
starting_proficiencies: [APIReferenceSchema],
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Subrace', Subrace, '2014-subraces');
1 change: 1 addition & 0 deletions src/models/2014/subrace/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export type Subrace = {
racial_traits: APIReference[];
starting_proficiencies?: APIReference[];
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/trait/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const TraitSchema = new Schema<Trait>({
parent: APIReferenceSchema,
trait_specific: TraitSpecificSchema,
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('Trait', TraitSchema, '2014-traits');
1 change: 1 addition & 0 deletions src/models/2014/trait/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export type Trait = {
parent?: APIReference;
trait_specific?: TraitSpecific;
url: string;
updated_at: string;
};
1 change: 1 addition & 0 deletions src/models/2014/weaponProperty/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const WeaponPropertySchema = new Schema<WeaponProperty>({
index: { type: String, index: true },
name: { type: String, index: true },
url: { type: String, index: true },
updated_at: { type: String, index: true },
});

export default model('WeaponProperty', WeaponPropertySchema, '2014-weapon-properties');
1 change: 1 addition & 0 deletions src/models/2014/weaponProperty/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type WeaponProperty = {
index: string;
name: string;
url: string;
updated_at: string;
};
3 changes: 3 additions & 0 deletions src/swagger/schemas/2014/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ api-ref-model:
url:
description: 'URL of the referenced resource.'
type: string
updated_at:
description: 'Date and time the resource was last updated.'
type: string
api-ref-list-model:
description: |
`APIReferenceList`
Expand Down

0 comments on commit 4cf55a0

Please sign in to comment.