optolith-database-schema 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/lib/cache/newApplicationsAndUses.d.ts +17 -0
  3. package/lib/cache/newApplicationsAndUses.js +67 -0
  4. package/lib/cacheConfig.d.ts +4 -0
  5. package/lib/cacheConfig.js +1 -0
  6. package/lib/config/cache.d.ts +7 -0
  7. package/lib/config/cache.js +4 -0
  8. package/lib/main.d.ts +42 -0
  9. package/lib/main.js +44 -0
  10. package/lib/typeConfig.d.ts +2 -0
  11. package/lib/types/Advantage.js +4 -2
  12. package/lib/types/AnimalDisease.js +4 -2
  13. package/lib/types/AnimalType.js +4 -2
  14. package/lib/types/ArcaneBardTradition.js +4 -2
  15. package/lib/types/ArcaneDancerTradition.js +4 -2
  16. package/lib/types/Aspect.js +4 -2
  17. package/lib/types/Attribute.js +5 -3
  18. package/lib/types/Blessing.js +4 -2
  19. package/lib/types/Cantrip.js +4 -2
  20. package/lib/types/Ceremony.js +4 -2
  21. package/lib/types/CombatTechnique_Close.js +4 -2
  22. package/lib/types/CombatTechnique_Ranged.js +4 -2
  23. package/lib/types/Condition.js +4 -2
  24. package/lib/types/Continent.js +4 -2
  25. package/lib/types/Culture.d.ts +4 -17
  26. package/lib/types/Culture.js +4 -40
  27. package/lib/types/DerivedCharacteristic.js +4 -2
  28. package/lib/types/Disadvantage.js +4 -2
  29. package/lib/types/Disease.js +4 -2
  30. package/lib/types/Element.js +4 -2
  31. package/lib/types/ExperienceLevel.js +4 -2
  32. package/lib/types/EyeColor.js +4 -2
  33. package/lib/types/FamiliarsTrick.js +4 -2
  34. package/lib/types/HairColor.js +4 -2
  35. package/lib/types/Kirchenpraegung.js +4 -2
  36. package/lib/types/Lessons_Curriculum.js +4 -2
  37. package/lib/types/Lessons_Guideline.js +4 -2
  38. package/lib/types/LiturgicalChant.js +4 -2
  39. package/lib/types/Locale.js +3 -1
  40. package/lib/types/MetaCondition.js +4 -2
  41. package/lib/types/PactCategory.js +4 -2
  42. package/lib/types/Patron.d.ts +2 -12
  43. package/lib/types/Patron.js +4 -22
  44. package/lib/types/PatronCategory.js +4 -2
  45. package/lib/types/PersonalityTrait.js +4 -2
  46. package/lib/types/Profession.d.ts +1 -5
  47. package/lib/types/Profession.js +4 -8
  48. package/lib/types/Property.js +4 -2
  49. package/lib/types/Race.d.ts +68 -134
  50. package/lib/types/Race.js +4 -13
  51. package/lib/types/Region.js +4 -2
  52. package/lib/types/Ritual.js +4 -2
  53. package/lib/types/Service.d.ts +1 -4
  54. package/lib/types/Service.js +4 -7
  55. package/lib/types/SexPractice.js +4 -2
  56. package/lib/types/Skill.d.ts +2 -10
  57. package/lib/types/Skill.js +4 -21
  58. package/lib/types/SkillGroup.js +4 -2
  59. package/lib/types/SkillModificationLevel.d.ts +1 -4
  60. package/lib/types/SkillModificationLevel.js +4 -7
  61. package/lib/types/SocialStatus.js +4 -2
  62. package/lib/types/Spell.js +4 -2
  63. package/lib/types/State.js +4 -2
  64. package/lib/types/Talisman.d.ts +1 -7
  65. package/lib/types/Talisman.js +4 -10
  66. package/lib/types/TargetCategory.js +4 -2
  67. package/lib/types/UI.d.ts +171 -128
  68. package/lib/types/UI.js +2 -0
  69. package/lib/types/_Activatable.d.ts +5 -19
  70. package/lib/types/_Activatable.js +1 -40
  71. package/lib/types/_ActivatableSelectOptionCategory.d.ts +1 -4
  72. package/lib/types/_ActivatableSelectOptionCategory.js +1 -8
  73. package/lib/types/_ActivatableSkillCastingTime.d.ts +1 -4
  74. package/lib/types/_ActivatableSkillCastingTime.js +1 -5
  75. package/lib/types/_ActivatableSkillCheckResultBased.d.ts +2 -8
  76. package/lib/types/_ActivatableSkillCheckResultBased.js +1 -16
  77. package/lib/types/_ActivatableSkillDuration.d.ts +1 -12
  78. package/lib/types/_ActivatableSkillDuration.js +1 -13
  79. package/lib/types/_ActivatableSkillRange.d.ts +1 -4
  80. package/lib/types/_ActivatableSkillRange.js +1 -5
  81. package/lib/types/_Dice.d.ts +1 -5
  82. package/lib/types/_Dice.js +1 -9
  83. package/lib/types/_DiseasePoison.d.ts +2 -6
  84. package/lib/types/_DiseasePoison.js +1 -11
  85. package/lib/types/_ImprovementCost.d.ts +1 -6
  86. package/lib/types/_ImprovementCost.js +1 -10
  87. package/lib/types/_Sex.d.ts +1 -4
  88. package/lib/types/_Sex.js +1 -8
  89. package/lib/types/_SkillCheck.d.ts +1 -8
  90. package/lib/types/_SkillCheck.js +1 -13
  91. package/lib/types/equipment/EquipmentPackage.js +4 -2
  92. package/lib/types/equipment/item/Alchemicum.js +4 -2
  93. package/lib/types/equipment/item/Ammunition.js +4 -2
  94. package/lib/types/equipment/item/Animal.js +4 -2
  95. package/lib/types/equipment/item/AnimalCare.js +4 -2
  96. package/lib/types/equipment/item/Armor.js +4 -2
  97. package/lib/types/equipment/item/BandageOrRemedy.js +4 -2
  98. package/lib/types/equipment/item/Book.js +4 -2
  99. package/lib/types/equipment/item/CeremonialItem.js +4 -2
  100. package/lib/types/equipment/item/Clothes.js +4 -2
  101. package/lib/types/equipment/item/Container.js +4 -2
  102. package/lib/types/equipment/item/Elixir.js +4 -2
  103. package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +4 -2
  104. package/lib/types/equipment/item/GemOrPreciousStone.js +4 -2
  105. package/lib/types/equipment/item/IlluminationLightSource.d.ts +1 -3
  106. package/lib/types/equipment/item/IlluminationLightSource.js +4 -6
  107. package/lib/types/equipment/item/IlluminationRefillsOrSupplies.js +4 -2
  108. package/lib/types/equipment/item/Jewelry.js +4 -2
  109. package/lib/types/equipment/item/Liebesspielzeug.js +4 -2
  110. package/lib/types/equipment/item/LuxuryGood.js +4 -2
  111. package/lib/types/equipment/item/MagicalArtifact.js +4 -2
  112. package/lib/types/equipment/item/MusicalInstrument.js +4 -2
  113. package/lib/types/equipment/item/OrienteeringAid.js +4 -2
  114. package/lib/types/equipment/item/Poison.d.ts +3 -15
  115. package/lib/types/equipment/item/Poison.js +4 -20
  116. package/lib/types/equipment/item/RopeOrChain.js +4 -2
  117. package/lib/types/equipment/item/Stationary.js +4 -2
  118. package/lib/types/equipment/item/ThievesTool.js +4 -2
  119. package/lib/types/equipment/item/ToolOfTheTrade.js +4 -2
  120. package/lib/types/equipment/item/TravelGearOrTool.js +4 -2
  121. package/lib/types/equipment/item/Vehicle.js +4 -2
  122. package/lib/types/equipment/item/Weapon.js +4 -2
  123. package/lib/types/equipment/item/WeaponAccessory.js +4 -2
  124. package/lib/types/equipment/item/_Herbary.d.ts +2 -14
  125. package/lib/types/equipment/item/_Herbary.js +1 -19
  126. package/lib/types/equipment/item/sub/ArmorType.js +4 -2
  127. package/lib/types/equipment/item/sub/Reach.js +4 -2
  128. package/lib/types/magicalActions/AnimistPower.js +4 -2
  129. package/lib/types/magicalActions/AnimistPower_Tribe.js +4 -2
  130. package/lib/types/magicalActions/Curse.js +4 -2
  131. package/lib/types/magicalActions/DominationRitual.js +4 -2
  132. package/lib/types/magicalActions/ElvenMagicalSong.js +4 -2
  133. package/lib/types/magicalActions/GeodeRitual.js +4 -2
  134. package/lib/types/magicalActions/JesterTrick.js +4 -2
  135. package/lib/types/magicalActions/MagicalDance.js +4 -2
  136. package/lib/types/magicalActions/MagicalMelody.js +4 -2
  137. package/lib/types/magicalActions/MagicalRune.js +4 -2
  138. package/lib/types/magicalActions/ZibiljaRitual.js +4 -2
  139. package/lib/types/magicalActions/_MusicTradition.d.ts +2 -8
  140. package/lib/types/magicalActions/_MusicTradition.js +1 -10
  141. package/lib/types/magicalActions/_SkillReference.d.ts +1 -4
  142. package/lib/types/magicalActions/_SkillReference.js +1 -5
  143. package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.d.ts +1 -4
  144. package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.js +1 -5
  145. package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.d.ts +1 -5
  146. package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.js +1 -6
  147. package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.d.ts +1 -4
  148. package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.js +1 -5
  149. package/lib/types/prerequisites/single/TextPrerequisite.d.ts +2 -8
  150. package/lib/types/prerequisites/single/TextPrerequisite.js +1 -10
  151. package/lib/types/prerequisites/single/TraditionPrerequisite.d.ts +2 -8
  152. package/lib/types/prerequisites/single/TraditionPrerequisite.js +1 -18
  153. package/lib/types/rule/CoreRule.d.ts +1 -4
  154. package/lib/types/rule/CoreRule.js +4 -7
  155. package/lib/types/rule/FocusRule.js +4 -2
  156. package/lib/types/rule/FocusRule_Subject.js +4 -2
  157. package/lib/types/rule/OptionalRule.js +4 -2
  158. package/lib/types/source/Publication.d.ts +1 -6
  159. package/lib/types/source/Publication.js +4 -12
  160. package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +4 -2
  161. package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +4 -2
  162. package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +4 -2
  163. package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +4 -2
  164. package/lib/types/specialAbility/AncestorGlyph.js +4 -2
  165. package/lib/types/specialAbility/BlessedTradition.js +4 -2
  166. package/lib/types/specialAbility/BrawlingSpecialAbility.js +4 -2
  167. package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +4 -2
  168. package/lib/types/specialAbility/CombatSpecialAbility.js +4 -2
  169. package/lib/types/specialAbility/CombatStyleSpecialAbility.js +4 -2
  170. package/lib/types/specialAbility/CommandSpecialAbility.js +4 -2
  171. package/lib/types/specialAbility/FamiliarSpecialAbility.js +4 -2
  172. package/lib/types/specialAbility/FatePointSexSpecialAbility.js +4 -2
  173. package/lib/types/specialAbility/FatePointSpecialAbility.js +4 -2
  174. package/lib/types/specialAbility/GeneralSpecialAbility.js +4 -2
  175. package/lib/types/specialAbility/KarmaSpecialAbility.js +4 -2
  176. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +4 -2
  177. package/lib/types/specialAbility/LycantropicGift.js +4 -2
  178. package/lib/types/specialAbility/MagicStyleSpecialAbility.js +4 -2
  179. package/lib/types/specialAbility/MagicalSign.js +4 -2
  180. package/lib/types/specialAbility/MagicalSpecialAbility.js +4 -2
  181. package/lib/types/specialAbility/MagicalTradition.js +4 -2
  182. package/lib/types/specialAbility/PactGift.d.ts +2 -8
  183. package/lib/types/specialAbility/PactGift.js +4 -12
  184. package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +4 -2
  185. package/lib/types/specialAbility/Sermon.js +4 -2
  186. package/lib/types/specialAbility/SexSpecialAbility.js +4 -2
  187. package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +4 -2
  188. package/lib/types/specialAbility/SkillStyleSpecialAbility.js +4 -2
  189. package/lib/types/specialAbility/VampiricGift.js +4 -2
  190. package/lib/types/specialAbility/Vision.js +4 -2
  191. package/lib/types/specialAbility/sub/Language.js +4 -2
  192. package/lib/types/specialAbility/sub/Script.js +4 -2
  193. package/lib/types/specialAbility/sub/TradeSecret.js +4 -2
  194. package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.js +4 -2
  195. package/lib/types/traditionArtifacts/AttireEnchantment.js +4 -2
  196. package/lib/types/traditionArtifacts/BowlEnchantment.js +4 -2
  197. package/lib/types/traditionArtifacts/CauldronEnchantment.js +4 -2
  198. package/lib/types/traditionArtifacts/ChronicleEnchantment.js +4 -2
  199. package/lib/types/traditionArtifacts/DaggerRitual.js +4 -2
  200. package/lib/types/traditionArtifacts/FoolsHatEnchantment.js +4 -2
  201. package/lib/types/traditionArtifacts/InstrumentEnchantment.js +4 -2
  202. package/lib/types/traditionArtifacts/Krallenkettenzauber.js +4 -2
  203. package/lib/types/traditionArtifacts/OrbEnchantment.js +4 -2
  204. package/lib/types/traditionArtifacts/RingEnchantment.js +4 -2
  205. package/lib/types/traditionArtifacts/SickleRitual.js +4 -2
  206. package/lib/types/traditionArtifacts/SpellSwordEnchantment.js +4 -2
  207. package/lib/types/traditionArtifacts/StaffEnchantment.js +4 -2
  208. package/lib/types/traditionArtifacts/ToyEnchantment.js +4 -2
  209. package/lib/types/traditionArtifacts/Trinkhornzauber.js +4 -2
  210. package/lib/types/traditionArtifacts/WandEnchantment.js +4 -2
  211. package/lib/types/traditionArtifacts/WeaponEnchantment.js +4 -2
  212. package/lib/types/traditionArtifacts/sub/AnimalShape.js +4 -2
  213. package/lib/types/traditionArtifacts/sub/AnimalShapePath.js +4 -2
  214. package/lib/types/traditionArtifacts/sub/AnimalShapeSize.js +4 -2
  215. package/lib/types/traditionArtifacts/sub/Brew.js +4 -2
  216. package/lib/validation/builders/naming.d.ts +3 -1
  217. package/lib/validation/builders/naming.js +9 -6
  218. package/lib/validation/filename.d.ts +1 -1
  219. package/lib/validation/filename.js +1 -1
  220. package/lib/validation/raw.d.ts +1 -1
  221. package/lib/validation/raw.js +3 -4
  222. package/package.json +2 -2
  223. package/schema/Culture.schema.json +31 -13
  224. package/schema/Patron.schema.json +26 -10
  225. package/schema/Profession.schema.json +10 -4
  226. package/schema/Race.schema.json +79 -208
  227. package/schema/Service.schema.json +7 -3
  228. package/schema/Skill.schema.json +20 -8
  229. package/schema/SkillModificationLevel.schema.json +7 -3
  230. package/schema/Talisman.schema.json +16 -6
  231. package/schema/UI.schema.json +502 -304
  232. package/schema/_Activatable.schema.json +32 -14
  233. package/schema/_ActivatableSelectOptionCategory.schema.json +7 -3
  234. package/schema/_ActivatableSkillCastingTime.schema.json +7 -3
  235. package/schema/_ActivatableSkillCheckResultBased.schema.json +14 -6
  236. package/schema/_ActivatableSkillDuration.schema.json +31 -11
  237. package/schema/_ActivatableSkillRange.schema.json +7 -3
  238. package/schema/_Dice.schema.json +10 -4
  239. package/schema/_DiseasePoison.schema.json +10 -4
  240. package/schema/_ImprovementCost.schema.json +13 -5
  241. package/schema/_Sex.schema.json +7 -3
  242. package/schema/_SkillCheck.schema.json +19 -7
  243. package/schema/equipment/item/IlluminationLightSource.schema.json +4 -2
  244. package/schema/equipment/item/Poison.schema.json +30 -12
  245. package/schema/equipment/item/_Herbary.schema.json +32 -12
  246. package/schema/magicalActions/_MusicTradition.schema.json +14 -6
  247. package/schema/magicalActions/_SkillReference.schema.json +7 -3
  248. package/schema/prerequisites/single/PrimaryAttributePrerequisite.schema.json +7 -3
  249. package/schema/prerequisites/single/RatedMinimumNumberPrerequisite.schema.json +10 -4
  250. package/schema/prerequisites/single/SexualCharacteristicPrerequisite.schema.json +7 -3
  251. package/schema/prerequisites/single/TextPrerequisite.schema.json +14 -6
  252. package/schema/prerequisites/single/TraditionPrerequisite.schema.json +14 -6
  253. package/schema/rule/CoreRule.schema.json +7 -3
  254. package/schema/source/Publication.schema.json +13 -5
  255. package/schema/specialAbility/PactGift.schema.json +14 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.13.0](https://github.com/elyukai/optolith-database-schema/compare/v0.12.1...v0.13.0) (2023-10-03)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * change and add lots of new translations with new key format
11
+ * replace all enums with union types to enable type-only usage
12
+
13
+ ### Features
14
+
15
+ * cache capability ([45cf7bf](https://github.com/elyukai/optolith-database-schema/commit/45cf7bfd3e43f2786926633b0c5e2eee8982d965))
16
+ * change and add lots of new translations with new key format ([3068ee9](https://github.com/elyukai/optolith-database-schema/commit/3068ee94ed6a6d0a021704f92af18984d33bb53b))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * typo in getFilenamePrefixAsNumericId ([802349e](https://github.com/elyukai/optolith-database-schema/commit/802349ea5b566682e0fb7bbd45811bda1800a686))
22
+
23
+
24
+ * replace all enums with union types to enable type-only usage ([fe5aa11](https://github.com/elyukai/optolith-database-schema/commit/fe5aa116f8fc922c3b6150d2bc663ddde5e8f104))
25
+
26
+ ### [0.12.1](https://github.com/elyukai/optolith-database-schema/compare/v0.12.0...v0.12.1) (2023-06-11)
27
+
28
+
29
+ ### Features
30
+
31
+ * provide function to get raw validation results ([c4bf451](https://github.com/elyukai/optolith-database-schema/commit/c4bf451195f7b754edf15ef43cd5363baafdd1d4))
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * use different file name validation patterns per type ([8e3915f](https://github.com/elyukai/optolith-database-schema/commit/8e3915f716823b971068018acba196b900fc390c))
37
+
5
38
  ## [0.12.0](https://github.com/elyukai/optolith-database-schema/compare/v0.11.9...v0.12.0) (2023-06-03)
6
39
 
7
40
 
@@ -0,0 +1,17 @@
1
+ import type { CacheConfig } from "../cacheConfig.js";
2
+ import type { SkillApplication, SkillUse } from "../types/_Activatable.js";
3
+ import type { ActivatableIdentifier } from "../types/_IdentifierGroup.js";
4
+ export type NewApplication = {
5
+ source: ActivatableIdentifier;
6
+ data: SkillApplication;
7
+ requiredSkillRating?: number;
8
+ };
9
+ export type Use = {
10
+ source: ActivatableIdentifier;
11
+ data: SkillUse;
12
+ };
13
+ export type NewApplicationsAndUsesCache = {
14
+ newApplications: Record<number, NewApplication[]>;
15
+ uses: Record<number, Use[]>;
16
+ };
17
+ export declare const config: CacheConfig<NewApplicationsAndUsesCache>;
@@ -0,0 +1,67 @@
1
+ export const config = {
2
+ builder(database) {
3
+ const cache = {
4
+ newApplications: {},
5
+ uses: {},
6
+ };
7
+ const addNewApplicationsAndUses = (activatable, activatableId) => {
8
+ if (activatable.skill_applications) {
9
+ for (const newApplication of activatable.skill_applications) {
10
+ const pair = { source: activatableId, data: newApplication };
11
+ if (newApplication.skill.tag === "Single") {
12
+ const previous = (cache.newApplications[newApplication.skill.single.id.skill] ??= []);
13
+ previous.push(pair);
14
+ }
15
+ else {
16
+ for (const skill of newApplication.skill.multiple.list) {
17
+ const previous = (cache.newApplications[skill.id.skill] ??= []);
18
+ previous.push(pair);
19
+ }
20
+ if (newApplication.skill.multiple.required_skill_rating !== undefined) {
21
+ pair.requiredSkillRating = newApplication.skill.multiple.required_skill_rating;
22
+ }
23
+ }
24
+ }
25
+ }
26
+ if (activatable.skill_uses) {
27
+ for (const use of activatable.skill_uses) {
28
+ const pair = { source: activatableId, data: use };
29
+ if (use.skill.tag === "Single") {
30
+ const previous = (cache.uses[use.skill.single.id.skill] ??= []);
31
+ previous.push(pair);
32
+ }
33
+ else {
34
+ for (const skill of use.skill.multiple.list) {
35
+ const previous = (cache.uses[skill.id.skill] ??= []);
36
+ previous.push(pair);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ };
42
+ const entries = [
43
+ [database.advancedCombatSpecialAbilities, n => ({ tag: "AdvancedCombatSpecialAbility", advanced_combat_special_ability: n })],
44
+ [database.advancedKarmaSpecialAbilities, n => ({ tag: "AdvancedKarmaSpecialAbility", advanced_karma_special_ability: n })],
45
+ [database.advancedMagicalSpecialAbilities, n => ({ tag: "AdvancedMagicalSpecialAbility", advanced_magical_special_ability: n })],
46
+ [database.advancedSkillSpecialAbilities, n => ({ tag: "AdvancedSkillSpecialAbility", advanced_skill_special_ability: n })],
47
+ [database.advantages, n => ({ tag: "Advantage", advantage: n })],
48
+ [database.blessedTraditions, n => ({ tag: "BlessedTradition", blessed_tradition: n })],
49
+ [database.ceremonialItemSpecialAbilities, n => ({ tag: "CeremonialItemSpecialAbility", ceremonial_item_special_ability: n })],
50
+ [database.combatSpecialAbilities, n => ({ tag: "CombatSpecialAbility", combat_special_ability: n })],
51
+ [database.combatStyleSpecialAbilities, n => ({ tag: "CombatStyleSpecialAbility", combat_style_special_ability: n })],
52
+ [database.fatePointSpecialAbilities, n => ({ tag: "FatePointSpecialAbility", fate_point_special_ability: n })],
53
+ [database.generalSpecialAbilities, n => ({ tag: "GeneralSpecialAbility", general_special_ability: n })],
54
+ [database.liturgicalStyleSpecialAbilities, n => ({ tag: "LiturgicalStyleSpecialAbility", liturgical_style_special_ability: n })],
55
+ [database.magicStyleSpecialAbilities, n => ({ tag: "MagicStyleSpecialAbility", magic_style_special_ability: n })],
56
+ [database.magicalSpecialAbilities, n => ({ tag: "MagicalSpecialAbility", magical_special_ability: n })],
57
+ [database.magicalTraditions, n => ({ tag: "MagicalTradition", magical_tradition: n })],
58
+ [database.sexSpecialAbilities, n => ({ tag: "SexSpecialAbility", sex_special_ability: n })],
59
+ ];
60
+ entries.forEach(([entityEntries, createId]) => {
61
+ entityEntries.forEach(([numericId, activatable]) => {
62
+ addNewApplicationsAndUses(activatable, createId(numericId));
63
+ });
64
+ });
65
+ return cache;
66
+ }
67
+ };
@@ -0,0 +1,4 @@
1
+ import { ValidResults } from "./main.js";
2
+ export type CacheConfig<T> = {
3
+ builder: (data: ValidResults) => T;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as NewApplicationsAndUses from "../cache/newApplicationsAndUses.js";
2
+ export type CacheMap = {
3
+ newApplicationsAndUses: NewApplicationsAndUses.NewApplicationsAndUsesCache;
4
+ };
5
+ export declare const cacheMap: {
6
+ newApplicationsAndUses: import("../cacheConfig.js").CacheConfig<NewApplicationsAndUses.NewApplicationsAndUsesCache>;
7
+ };
@@ -0,0 +1,4 @@
1
+ import * as NewApplicationsAndUses from "../cache/newApplicationsAndUses.js";
2
+ export const cacheMap = {
3
+ newApplicationsAndUses: NewApplicationsAndUses.config
4
+ };
package/lib/main.d.ts CHANGED
@@ -1,9 +1,11 @@
1
+ import { CacheMap } from "./config/cache.js";
1
2
  import { TypeId, TypeMap } from "./config/types.js";
2
3
  import "./helpers/array.js";
3
4
  import { Result } from "./helpers/result.js";
4
5
  import { IntegrityError } from "./validation/builders/integrity.js";
5
6
  import { FileNameError } from "./validation/builders/naming.js";
6
7
  import { SchemaError } from "./validation/builders/schema.js";
8
+ import { TypeValidationResult } from "./validation/raw.js";
7
9
  /**
8
10
  * Options for validating data files.
9
11
  */
@@ -26,6 +28,12 @@ export type TypeValidationError = IntegrityError | FileNameError | SchemaError;
26
28
  export type ValidResults = {
27
29
  [K in keyof TypeMap]: [id: TypeId<K>, data: TypeMap[K]][];
28
30
  };
31
+ /**
32
+ * A map of all entries, grouped by entity type.
33
+ */
34
+ export type RawResults = {
35
+ [K in keyof TypeMap]: TypeValidationResult<K>[];
36
+ };
29
37
  /**
30
38
  * A dictionary of entity types and their data’s associated locations.
31
39
  */
@@ -51,4 +59,38 @@ export declare const getAllValidDataOrErrors: (entityDirPaths: EntityDirectoryPa
51
59
  * @returns The valid data.
52
60
  */
53
61
  export declare const getAllValidData: (entityDirPaths: EntityDirectoryPaths, options?: ValidationOptions) => Promise<ValidResults>;
62
+ /**
63
+ * Returns all data as a map of entity types to their validation results.
64
+ * @param entityDirPaths THe paths to the directories containing the data to be
65
+ * validated.
66
+ * @param options Configuration options for the validation.
67
+ * @returns The validation results.
68
+ */
69
+ export declare const getRawResults: (entityDirPaths: EntityDirectoryPaths, options?: ValidationOptions) => Promise<RawResults>;
70
+ /**
71
+ * A dictionary of cache types and their associated location.
72
+ */
73
+ export type CachePaths = {
74
+ [K in keyof CacheMap]: string;
75
+ };
76
+ export type CacheOptions = {
77
+ /**
78
+ * Whether to pretty-print the JSON. Default is `false`.
79
+ */
80
+ pretty?: boolean;
81
+ };
82
+ /**
83
+ * Builds the cache and writes it to the specified paths in JSON format.
84
+ * @param cachePaths The absolute paths to write each cache to.
85
+ * @param validResults The data to build the cache from. Usually the result of
86
+ * `getAllValidData`.
87
+ * @param options Configuration options for building the cache.
88
+ */
89
+ export declare const buildCache: (cachePaths: CachePaths, validResults: ValidResults, options?: CacheOptions) => Promise<void>;
90
+ /**
91
+ * Reads the cache from the specified paths in JSON format.
92
+ * @param cachePaths The absolute paths to read each cache from.
93
+ * @returns
94
+ */
95
+ export declare const getCache: (cachePaths: CachePaths) => Promise<CacheMap>;
54
96
  export {};
package/lib/main.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { dirname } from "node:path";
3
+ import { cacheMap } from "./config/cache.js";
1
4
  import "./helpers/array.js";
2
5
  import { mapSecond } from "./helpers/pair.js";
3
6
  import { Result, error, isError, isOk, ok } from "./helpers/result.js";
@@ -53,3 +56,44 @@ export const getAllValidData = async (entityDirPaths, options = {}) => {
53
56
  const rawResultMap = await getRawValidationResults(entityDirPaths, options);
54
57
  return filterResultMapByValidData(rawResultMap);
55
58
  };
59
+ /**
60
+ * Returns all data as a map of entity types to their validation results.
61
+ * @param entityDirPaths THe paths to the directories containing the data to be
62
+ * validated.
63
+ * @param options Configuration options for the validation.
64
+ * @returns The validation results.
65
+ */
66
+ export const getRawResults = async (entityDirPaths, options = {}) => {
67
+ const rawResultMap = await getRawValidationResults(entityDirPaths, options);
68
+ return Object.fromEntries(rawResultMap);
69
+ };
70
+ /**
71
+ * Builds the cache and writes it to the specified paths in JSON format.
72
+ * @param cachePaths The absolute paths to write each cache to.
73
+ * @param validResults The data to build the cache from. Usually the result of
74
+ * `getAllValidData`.
75
+ * @param options Configuration options for building the cache.
76
+ */
77
+ export const buildCache = async (cachePaths, validResults, options = {}) => {
78
+ const { pretty = false } = options;
79
+ for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
80
+ const cacheConfig = cacheMap[cacheName];
81
+ const cacheData = cacheConfig.builder(validResults);
82
+ await mkdir(dirname(cachePath), { recursive: true });
83
+ await writeFile(cachePath, JSON.stringify(cacheData, null, pretty ? 2 : undefined), "utf-8");
84
+ }
85
+ };
86
+ /**
87
+ * Reads the cache from the specified paths in JSON format.
88
+ * @param cachePaths The absolute paths to read each cache from.
89
+ * @returns
90
+ */
91
+ export const getCache = async (cachePaths) => {
92
+ const cache = {};
93
+ for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
94
+ const cacheConfig = cacheMap[cacheName];
95
+ const cacheData = JSON.parse(await readFile(cachePath, "utf-8"));
96
+ cache[cacheName] = cacheData;
97
+ }
98
+ return cache;
99
+ };
@@ -1,8 +1,10 @@
1
1
  import { IntegrityValidator } from "./validation/builders/integrity.js";
2
+ import { FileNameValidator } from "./validation/builders/naming.js";
2
3
  import { SchemaValidator } from "./validation/builders/schema.js";
3
4
  export type TypeConfig<T, ID extends string | number = number> = {
4
5
  name: string;
5
6
  id: (data: T, filepath: string) => ID;
6
7
  integrityValidator: IntegrityValidator<T>;
7
8
  schemaValidator: SchemaValidator<T>;
9
+ fileNameValidator: FileNameValidator;
8
10
  };
@@ -2,11 +2,13 @@
2
2
  * @main Advantage
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Advantage",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Advantage"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main AnimalDisease
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "AnimalDisease",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("AnimalDisease"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main AnimalType
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "AnimalType",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("AnimalType"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main ArcaneBardTradition
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "ArcaneBardTradition",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("ArcaneBardTradition"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main ArcaneDancerTradition
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "ArcaneDancerTradition",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("ArcaneDancerTradition"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Aspect
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Aspect",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Aspect"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Attribute
3
3
  */
4
4
  import { getReferencialIntegrityErrorsForTranslatable, reduceIntegrityValidationResults, validateEntityIntegrity } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Attribute",
9
- id: getFIlenamePrefixAsNumericId,
10
- integrityValidator: (validators, data, filepath) => reduceIntegrityValidationResults(validateEntityIntegrity(validators.identity.attributes.exists, getFIlenamePrefixAsNumericId(data, filepath), data.id, [{ k: "id" }]), getReferencialIntegrityErrorsForTranslatable(validators, data)),
10
+ id: getFilenamePrefixAsNumericId,
11
+ integrityValidator: (validators, data, filepath) => reduceIntegrityValidationResults(validateEntityIntegrity(validators.identity.attributes.exists, getFilenamePrefixAsNumericId(data, filepath), data.id, [{ k: "id" }]), getReferencialIntegrityErrorsForTranslatable(validators, data)),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Blessing
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Blessing",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Blessing"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Cantrip
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Cantrip",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Cantrip"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Ceremony
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Ceremony",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Ceremony"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main CloseCombatTechnique
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "CloseCombatTechnique",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("CloseCombatTechnique"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main RangedCombatTechnique
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "RangedCombatTechnique",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("RangedCombatTechnique"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Condition
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Condition",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Condition"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Continent
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Continent",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Continent"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -103,10 +103,7 @@ export type AreaKnowledge = {
103
103
  * Some professions or profession variants are simply more common (Mostly), but
104
104
  * sometimes only specific elements are used (Only).
105
105
  */
106
- export declare enum Weight {
107
- Mostly = "Mostly",
108
- Only = "Only"
109
- }
106
+ export type Weight = "Mostly" | "Only";
110
107
  /**
111
108
  * Some professions or profession variants are more common than others. There
112
109
  * may be cultures where some professions or profession variants are not
@@ -131,10 +128,7 @@ export type Weighted<ProfessionOrVariant> = {
131
128
  * that intersect with the constraints (include) or only the professions
132
129
  * are kept that are different from the constraints (exclude).
133
130
  */
134
- export declare enum CommonProfessionConstraintsOperation {
135
- Intersection = "Intersection",
136
- Difference = "Difference"
137
- }
131
+ export type CommonProfessionConstraintsOperation = "Intersection" | "Difference";
138
132
  /**
139
133
  * A list of professions. The filter specifies how the list is applied to
140
134
  * all mundane professions.
@@ -156,10 +150,7 @@ export type CommonProfessionConstraints<Constraint> = {
156
150
  /**
157
151
  * Some professions may be found in a culture, but are not that common.
158
152
  */
159
- export declare enum Rarity {
160
- Rare = "Rare",
161
- VeryRare = "VeryRare"
162
- }
153
+ export type Rarity = "Rare" | "VeryRare";
163
154
  export type ProfessionConstraint = {
164
155
  /**
165
156
  * The profession's identifier.
@@ -179,11 +170,7 @@ export type ProfessionConstraint = {
179
170
  /**
180
171
  * Some professions may be found in a culture, but are not that common.
181
172
  */
182
- export declare enum MundaneProfessionSubgroupConstraint {
183
- Profane = "Profane",
184
- Fighter = "Fighter",
185
- Religious = "Religious"
186
- }
173
+ export type MundaneProfessionSubgroupConstraint = "Profane" | "Fighter" | "Religious";
187
174
  export type MagicalTraditionConstraint = {
188
175
  /**
189
176
  * The magical tradition's identifier.
@@ -2,49 +2,13 @@
2
2
  * @main Culture
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- /**
8
- * The "weight" difference compared to other professions or profession variants.
9
- * Some professions or profession variants are simply more common (Mostly), but
10
- * sometimes only specific elements are used (Only).
11
- */
12
- export var Weight;
13
- (function (Weight) {
14
- Weight["Mostly"] = "Mostly";
15
- Weight["Only"] = "Only";
16
- })(Weight = Weight || (Weight = {}));
17
- /**
18
- * This defines how the list of constraints should be offset against the
19
- * list of all mundane professions: Either only the professions are kept
20
- * that intersect with the constraints (include) or only the professions
21
- * are kept that are different from the constraints (exclude).
22
- */
23
- export var CommonProfessionConstraintsOperation;
24
- (function (CommonProfessionConstraintsOperation) {
25
- CommonProfessionConstraintsOperation["Intersection"] = "Intersection";
26
- CommonProfessionConstraintsOperation["Difference"] = "Difference";
27
- })(CommonProfessionConstraintsOperation = CommonProfessionConstraintsOperation || (CommonProfessionConstraintsOperation = {}));
28
- /**
29
- * Some professions may be found in a culture, but are not that common.
30
- */
31
- export var Rarity;
32
- (function (Rarity) {
33
- Rarity["Rare"] = "Rare";
34
- Rarity["VeryRare"] = "VeryRare";
35
- })(Rarity = Rarity || (Rarity = {}));
36
- /**
37
- * Some professions may be found in a culture, but are not that common.
38
- */
39
- export var MundaneProfessionSubgroupConstraint;
40
- (function (MundaneProfessionSubgroupConstraint) {
41
- MundaneProfessionSubgroupConstraint["Profane"] = "Profane";
42
- MundaneProfessionSubgroupConstraint["Fighter"] = "Fighter";
43
- MundaneProfessionSubgroupConstraint["Religious"] = "Religious";
44
- })(MundaneProfessionSubgroupConstraint = MundaneProfessionSubgroupConstraint || (MundaneProfessionSubgroupConstraint = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
45
8
  export const config = {
46
9
  name: "Culture",
47
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
48
11
  integrityValidator: todo("Culture"),
49
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
50
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main DerivedCharacteristic
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "DerivedCharacteristic",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("DerivedCharacteristic"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };