@optolith/database-schema 0.42.1
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.
- package/AUTHORS +1 -0
- package/CHANGELOG.md +1789 -0
- package/LICENSE +378 -0
- package/README.md +34 -0
- package/gen/types.d.ts +24682 -0
- package/lib/cache/activatableSelectOptions.d.ts +18 -0
- package/lib/cache/activatableSelectOptions.js +762 -0
- package/lib/cache/ancestorBloodAdvantages.d.ts +4 -0
- package/lib/cache/ancestorBloodAdvantages.js +13 -0
- package/lib/cache/index.d.ts +31 -0
- package/lib/cache/index.js +22 -0
- package/lib/cache/internal.d.ts +4 -0
- package/lib/cache/internal.js +1 -0
- package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.d.ts +3 -0
- package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.js +103 -0
- package/lib/cache/newApplicationsAndUses.d.ts +22 -0
- package/lib/cache/newApplicationsAndUses.js +12 -0
- package/lib/main.d.ts +17 -0
- package/lib/main.js +226 -0
- package/lib/test.d.ts +1 -0
- package/lib/test.js +11 -0
- package/lib/types/Advantage.d.ts +1193 -0
- package/lib/types/Advantage.js +58 -0
- package/lib/types/AnimalDisease.d.ts +91 -0
- package/lib/types/AnimalDisease.js +35 -0
- package/lib/types/AnimalType.d.ts +6 -0
- package/lib/types/AnimalType.js +21 -0
- package/lib/types/ArcaneBardTradition.d.ts +30 -0
- package/lib/types/ArcaneBardTradition.js +14 -0
- package/lib/types/ArcaneDancerTradition.d.ts +30 -0
- package/lib/types/ArcaneDancerTradition.js +14 -0
- package/lib/types/Aspect.d.ts +7 -0
- package/lib/types/Aspect.js +27 -0
- package/lib/types/Attribute.d.ts +19 -0
- package/lib/types/Attribute.js +49 -0
- package/lib/types/Blessing.d.ts +106 -0
- package/lib/types/Blessing.js +102 -0
- package/lib/types/Cantrip.d.ts +134 -0
- package/lib/types/Cantrip.js +166 -0
- package/lib/types/Ceremony.d.ts +685 -0
- package/lib/types/Ceremony.js +94 -0
- package/lib/types/CombatTechnique.d.ts +153 -0
- package/lib/types/CombatTechnique.js +133 -0
- package/lib/types/Condition.d.ts +53 -0
- package/lib/types/Condition.js +38 -0
- package/lib/types/Continent.d.ts +6 -0
- package/lib/types/Continent.js +22 -0
- package/lib/types/Culture.d.ts +158 -0
- package/lib/types/Culture.js +374 -0
- package/lib/types/DerivedCharacteristic.d.ts +267 -0
- package/lib/types/DerivedCharacteristic.js +227 -0
- package/lib/types/Disadvantage.d.ts +1120 -0
- package/lib/types/Disadvantage.js +59 -0
- package/lib/types/Disease.d.ts +111 -0
- package/lib/types/Disease.js +35 -0
- package/lib/types/Element.d.ts +6 -0
- package/lib/types/Element.js +21 -0
- package/lib/types/ExperienceLevel.d.ts +13 -0
- package/lib/types/ExperienceLevel.js +56 -0
- package/lib/types/EyeColor.d.ts +6 -0
- package/lib/types/EyeColor.js +21 -0
- package/lib/types/FamiliarsTrick.d.ts +192 -0
- package/lib/types/FamiliarsTrick.js +202 -0
- package/lib/types/HairColor.d.ts +6 -0
- package/lib/types/HairColor.js +21 -0
- package/lib/types/HomunculusType.d.ts +6 -0
- package/lib/types/HomunculusType.js +15 -0
- package/lib/types/Influence.d.ts +80 -0
- package/lib/types/Influence.js +52 -0
- package/lib/types/Lessons.d.ts +181 -0
- package/lib/types/Lessons.js +230 -0
- package/lib/types/LiturgicalChant.d.ts +685 -0
- package/lib/types/LiturgicalChant.js +94 -0
- package/lib/types/Locale.d.ts +1607 -0
- package/lib/types/Locale.js +1747 -0
- package/lib/types/MetaCondition.d.ts +53 -0
- package/lib/types/MetaCondition.js +39 -0
- package/lib/types/PactCategory.d.ts +75 -0
- package/lib/types/PactCategory.js +102 -0
- package/lib/types/Patron.d.ts +101 -0
- package/lib/types/Patron.js +203 -0
- package/lib/types/PatronCategory.d.ts +7 -0
- package/lib/types/PatronCategory.js +26 -0
- package/lib/types/PersonalityTrait.d.ts +81 -0
- package/lib/types/PersonalityTrait.js +58 -0
- package/lib/types/Profession.d.ts +2120 -0
- package/lib/types/Profession.js +631 -0
- package/lib/types/Property.d.ts +7 -0
- package/lib/types/Property.js +26 -0
- package/lib/types/Race.d.ts +207 -0
- package/lib/types/Race.js +332 -0
- package/lib/types/Region.d.ts +6 -0
- package/lib/types/Region.js +21 -0
- package/lib/types/Ritual.d.ts +688 -0
- package/lib/types/Ritual.js +96 -0
- package/lib/types/Service.d.ts +56 -0
- package/lib/types/Service.js +45 -0
- package/lib/types/SexPractice.d.ts +51 -0
- package/lib/types/SexPractice.js +39 -0
- package/lib/types/Skill.d.ts +116 -0
- package/lib/types/Skill.js +139 -0
- package/lib/types/SkillGroup.d.ts +17 -0
- package/lib/types/SkillGroup.js +45 -0
- package/lib/types/SkillModificationLevel.d.ts +34 -0
- package/lib/types/SkillModificationLevel.js +116 -0
- package/lib/types/SocialStatus.d.ts +7 -0
- package/lib/types/SocialStatus.js +26 -0
- package/lib/types/Spell.d.ts +688 -0
- package/lib/types/Spell.js +96 -0
- package/lib/types/State.d.ts +52 -0
- package/lib/types/State.js +31 -0
- package/lib/types/Talisman.d.ts +135 -0
- package/lib/types/Talisman.js +168 -0
- package/lib/types/TargetCategory.d.ts +7 -0
- package/lib/types/TargetCategory.js +26 -0
- package/lib/types/_Activatable.d.ts +12 -0
- package/lib/types/_Activatable.js +43 -0
- package/lib/types/_ActivatableAdvanced.d.ts +50 -0
- package/lib/types/_ActivatableAdvanced.js +101 -0
- package/lib/types/_ActivatableAdventurePointsValue.d.ts +159 -0
- package/lib/types/_ActivatableAdventurePointsValue.js +148 -0
- package/lib/types/_ActivatableAutomatic.d.ts +74 -0
- package/lib/types/_ActivatableAutomatic.js +64 -0
- package/lib/types/_ActivatableCombat.d.ts +123 -0
- package/lib/types/_ActivatableCombat.js +350 -0
- package/lib/types/_ActivatableNames.d.ts +15 -0
- package/lib/types/_ActivatableNames.js +26 -0
- package/lib/types/_ActivatableNonMundane.d.ts +387 -0
- package/lib/types/_ActivatableNonMundane.js +536 -0
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +1380 -0
- package/lib/types/_ActivatableSelectOptionCategory.js +478 -0
- package/lib/types/_ActivatableSelectOptions.d.ts +1077 -0
- package/lib/types/_ActivatableSelectOptions.js +218 -0
- package/lib/types/_ActivatableSkill.d.ts +1231 -0
- package/lib/types/_ActivatableSkill.js +89 -0
- package/lib/types/_ActivatableSkillApplicationsAndUses.d.ts +109 -0
- package/lib/types/_ActivatableSkillApplicationsAndUses.js +80 -0
- package/lib/types/_ActivatableSkillCastingTime.d.ts +66 -0
- package/lib/types/_ActivatableSkillCastingTime.js +92 -0
- package/lib/types/_ActivatableSkillCheckResultBased.d.ts +27 -0
- package/lib/types/_ActivatableSkillCheckResultBased.js +45 -0
- package/lib/types/_ActivatableSkillCost.d.ts +366 -0
- package/lib/types/_ActivatableSkillCost.js +280 -0
- package/lib/types/_ActivatableSkillDuration.d.ts +204 -0
- package/lib/types/_ActivatableSkillDuration.js +138 -0
- package/lib/types/_ActivatableSkillEffect.d.ts +16 -0
- package/lib/types/_ActivatableSkillEffect.js +65 -0
- package/lib/types/_ActivatableSkillRange.d.ts +62 -0
- package/lib/types/_ActivatableSkillRange.js +106 -0
- package/lib/types/_ActivatableSkillTargetCategory.d.ts +14 -0
- package/lib/types/_ActivatableSkillTargetCategory.js +30 -0
- package/lib/types/_AlternativeNames.d.ts +5 -0
- package/lib/types/_AlternativeNames.js +14 -0
- package/lib/types/_ArcaneTradition.d.ts +30 -0
- package/lib/types/_ArcaneTradition.js +14 -0
- package/lib/types/_Blessed.d.ts +8 -0
- package/lib/types/_Blessed.js +22 -0
- package/lib/types/_Color.d.ts +19 -0
- package/lib/types/_Color.js +27 -0
- package/lib/types/_CommonnessRatedAdvantageDisadvantage.d.ts +7 -0
- package/lib/types/_CommonnessRatedAdvantageDisadvantage.js +19 -0
- package/lib/types/_Dice.d.ts +6 -0
- package/lib/types/_Dice.js +23 -0
- package/lib/types/_DiseasePoison.d.ts +59 -0
- package/lib/types/_DiseasePoison.js +110 -0
- package/lib/types/_Enhancements.d.ts +170 -0
- package/lib/types/_Enhancements.js +80 -0
- package/lib/types/_Identifier.d.ts +170 -0
- package/lib/types/_Identifier.js +325 -0
- package/lib/types/_IdentifierGroup.d.ts +413 -0
- package/lib/types/_IdentifierGroup.js +333 -0
- package/lib/types/_ImprovementCost.d.ts +7 -0
- package/lib/types/_ImprovementCost.js +10 -0
- package/lib/types/_MathExpression.d.ts +12 -0
- package/lib/types/_MathExpression.js +36 -0
- package/lib/types/_Prerequisite.d.ts +421 -0
- package/lib/types/_Prerequisite.js +163 -0
- package/lib/types/_ResponsiveText.d.ts +13 -0
- package/lib/types/_ResponsiveText.js +43 -0
- package/lib/types/_Sex.d.ts +5 -0
- package/lib/types/_Sex.js +8 -0
- package/lib/types/_SizeCategory.d.ts +15 -0
- package/lib/types/_SizeCategory.js +24 -0
- package/lib/types/_SkillCheck.d.ts +11 -0
- package/lib/types/_SkillCheck.js +23 -0
- package/lib/types/_Spellwork.d.ts +17 -0
- package/lib/types/_Spellwork.js +39 -0
- package/lib/types/equipment/EquipmentPackage.d.ts +85 -0
- package/lib/types/equipment/EquipmentPackage.js +41 -0
- package/lib/types/equipment/item/Ammunition.d.ts +72 -0
- package/lib/types/equipment/item/Ammunition.js +44 -0
- package/lib/types/equipment/item/Animal.d.ts +72 -0
- package/lib/types/equipment/item/Animal.js +22 -0
- package/lib/types/equipment/item/AnimalCare.d.ts +87 -0
- package/lib/types/equipment/item/AnimalCare.js +58 -0
- package/lib/types/equipment/item/Armor.d.ts +166 -0
- package/lib/types/equipment/item/Armor.js +181 -0
- package/lib/types/equipment/item/BandageOrRemedy.d.ts +201 -0
- package/lib/types/equipment/item/BandageOrRemedy.js +48 -0
- package/lib/types/equipment/item/Book.d.ts +169 -0
- package/lib/types/equipment/item/Book.js +271 -0
- package/lib/types/equipment/item/CeremonialItem.d.ts +202 -0
- package/lib/types/equipment/item/CeremonialItem.js +53 -0
- package/lib/types/equipment/item/Clothes.d.ts +201 -0
- package/lib/types/equipment/item/Clothes.js +48 -0
- package/lib/types/equipment/item/ClothingPackage.d.ts +63 -0
- package/lib/types/equipment/item/ClothingPackage.js +21 -0
- package/lib/types/equipment/item/Container.d.ts +201 -0
- package/lib/types/equipment/item/Container.js +48 -0
- package/lib/types/equipment/item/Elixir.d.ts +119 -0
- package/lib/types/equipment/item/Elixir.js +110 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.d.ts +215 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +44 -0
- package/lib/types/equipment/item/GemOrPreciousStone.d.ts +74 -0
- package/lib/types/equipment/item/GemOrPreciousStone.js +52 -0
- package/lib/types/equipment/item/IlluminationLightSource.d.ts +210 -0
- package/lib/types/equipment/item/IlluminationLightSource.js +78 -0
- package/lib/types/equipment/item/IlluminationRefillOrSupply.d.ts +201 -0
- package/lib/types/equipment/item/IlluminationRefillOrSupply.js +48 -0
- package/lib/types/equipment/item/Jewelry.d.ts +74 -0
- package/lib/types/equipment/item/Jewelry.js +46 -0
- package/lib/types/equipment/item/Laboratory.d.ts +81 -0
- package/lib/types/equipment/item/Laboratory.js +34 -0
- package/lib/types/equipment/item/Liebesspielzeug.d.ts +201 -0
- package/lib/types/equipment/item/Liebesspielzeug.js +48 -0
- package/lib/types/equipment/item/LuxuryGood.d.ts +201 -0
- package/lib/types/equipment/item/LuxuryGood.js +48 -0
- package/lib/types/equipment/item/MagicalArtifact.d.ts +204 -0
- package/lib/types/equipment/item/MagicalArtifact.js +82 -0
- package/lib/types/equipment/item/MusicalInstrument.d.ts +201 -0
- package/lib/types/equipment/item/MusicalInstrument.js +48 -0
- package/lib/types/equipment/item/Newspaper.d.ts +67 -0
- package/lib/types/equipment/item/Newspaper.js +36 -0
- package/lib/types/equipment/item/OrienteeringAid.d.ts +200 -0
- package/lib/types/equipment/item/OrienteeringAid.js +2 -0
- package/lib/types/equipment/item/Poison.d.ts +621 -0
- package/lib/types/equipment/item/Poison.js +486 -0
- package/lib/types/equipment/item/RopeOrChain.d.ts +200 -0
- package/lib/types/equipment/item/RopeOrChain.js +2 -0
- package/lib/types/equipment/item/Stationery.d.ts +200 -0
- package/lib/types/equipment/item/Stationery.js +2 -0
- package/lib/types/equipment/item/ThievesTool.d.ts +200 -0
- package/lib/types/equipment/item/ThievesTool.js +2 -0
- package/lib/types/equipment/item/ToolOfTheTrade.d.ts +83 -0
- package/lib/types/equipment/item/ToolOfTheTrade.js +34 -0
- package/lib/types/equipment/item/TravelGearOrTool.d.ts +201 -0
- package/lib/types/equipment/item/TravelGearOrTool.js +48 -0
- package/lib/types/equipment/item/Vehicle.d.ts +80 -0
- package/lib/types/equipment/item/Vehicle.js +30 -0
- package/lib/types/equipment/item/Weapon.d.ts +225 -0
- package/lib/types/equipment/item/Weapon.js +132 -0
- package/lib/types/equipment/item/WeaponAccessory.d.ts +201 -0
- package/lib/types/equipment/item/WeaponAccessory.js +48 -0
- package/lib/types/equipment/item/WorkingSupernaturalCreature.d.ts +72 -0
- package/lib/types/equipment/item/WorkingSupernaturalCreature.js +44 -0
- package/lib/types/equipment/item/_Herbary.d.ts +76 -0
- package/lib/types/equipment/item/_Herbary.js +48 -0
- package/lib/types/equipment/item/_Item.d.ts +414 -0
- package/lib/types/equipment/item/_Item.js +254 -0
- package/lib/types/equipment/item/_MeleeWeapon.d.ts +62 -0
- package/lib/types/equipment/item/_MeleeWeapon.js +100 -0
- package/lib/types/equipment/item/_RangedWeapon.d.ts +38 -0
- package/lib/types/equipment/item/_RangedWeapon.js +93 -0
- package/lib/types/equipment/item/_Weapon.d.ts +25 -0
- package/lib/types/equipment/item/_Weapon.js +77 -0
- package/lib/types/equipment/item/sub/ArmorType.d.ts +7 -0
- package/lib/types/equipment/item/sub/ArmorType.js +25 -0
- package/lib/types/equipment/item/sub/Reach.d.ts +7 -0
- package/lib/types/equipment/item/sub/Reach.js +28 -0
- package/lib/types/index.d.ts +160 -0
- package/lib/types/index.js +160 -0
- package/lib/types/magicalActions/AnimistPower.d.ts +302 -0
- package/lib/types/magicalActions/AnimistPower.js +204 -0
- package/lib/types/magicalActions/AnimistPower_Tribe.d.ts +30 -0
- package/lib/types/magicalActions/AnimistPower_Tribe.js +26 -0
- package/lib/types/magicalActions/Bannzeichen.d.ts +244 -0
- package/lib/types/magicalActions/Bannzeichen.js +231 -0
- package/lib/types/magicalActions/Curse.d.ts +219 -0
- package/lib/types/magicalActions/Curse.js +133 -0
- package/lib/types/magicalActions/DominationRitual.d.ts +204 -0
- package/lib/types/magicalActions/DominationRitual.js +133 -0
- package/lib/types/magicalActions/ElvenMagicalSong.d.ts +126 -0
- package/lib/types/magicalActions/ElvenMagicalSong.js +117 -0
- package/lib/types/magicalActions/GeodeRitual.d.ts +227 -0
- package/lib/types/magicalActions/GeodeRitual.js +142 -0
- package/lib/types/magicalActions/GoblinRitual.d.ts +286 -0
- package/lib/types/magicalActions/GoblinRitual.js +196 -0
- package/lib/types/magicalActions/JesterTrick.d.ts +305 -0
- package/lib/types/magicalActions/JesterTrick.js +160 -0
- package/lib/types/magicalActions/MagicalDance.d.ts +129 -0
- package/lib/types/magicalActions/MagicalDance.js +119 -0
- package/lib/types/magicalActions/MagicalMelody.d.ts +133 -0
- package/lib/types/magicalActions/MagicalMelody.js +123 -0
- package/lib/types/magicalActions/MagicalRune.d.ts +279 -0
- package/lib/types/magicalActions/MagicalRune.js +292 -0
- package/lib/types/magicalActions/ZibiljaRitual.d.ts +420 -0
- package/lib/types/magicalActions/ZibiljaRitual.js +90 -0
- package/lib/types/magicalActions/_MusicTradition.d.ts +17 -0
- package/lib/types/magicalActions/_MusicTradition.js +43 -0
- package/lib/types/prerequisites/ConditionalPrerequisites.d.ts +42 -0
- package/lib/types/prerequisites/ConditionalPrerequisites.js +9 -0
- package/lib/types/prerequisites/DisplayOption.d.ts +13 -0
- package/lib/types/prerequisites/DisplayOption.js +27 -0
- package/lib/types/prerequisites/PrerequisiteGroups.d.ts +2053 -0
- package/lib/types/prerequisites/PrerequisiteGroups.js +180 -0
- package/lib/types/prerequisites/single/ActivatablePrerequisite.d.ts +133 -0
- package/lib/types/prerequisites/single/ActivatablePrerequisite.js +32 -0
- package/lib/types/prerequisites/single/AncestorBloodPrerequisite.d.ts +4 -0
- package/lib/types/prerequisites/single/AncestorBloodPrerequisite.js +4 -0
- package/lib/types/prerequisites/single/AnimistPowerPrerequisite.d.ts +18 -0
- package/lib/types/prerequisites/single/AnimistPowerPrerequisite.js +24 -0
- package/lib/types/prerequisites/single/CulturePrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/CulturePrerequisite.js +16 -0
- package/lib/types/prerequisites/single/EnhancementPrerequisite.d.ts +4 -0
- package/lib/types/prerequisites/single/EnhancementPrerequisite.js +12 -0
- package/lib/types/prerequisites/single/InfluencePrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/InfluencePrerequisite.js +19 -0
- package/lib/types/prerequisites/single/PactPrerequisite.d.ts +18 -0
- package/lib/types/prerequisites/single/PactPrerequisite.js +24 -0
- package/lib/types/prerequisites/single/PersonalityTraitPrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/PersonalityTraitPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.d.ts +20 -0
- package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.js +25 -0
- package/lib/types/prerequisites/single/ProfessionPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/ProfessionPrerequisite.js +16 -0
- package/lib/types/prerequisites/single/PublicationPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/PublicationPrerequisite.js +15 -0
- package/lib/types/prerequisites/single/RacePrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/RacePrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.d.ts +51 -0
- package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.js +82 -0
- package/lib/types/prerequisites/single/RatedPrerequisite.d.ts +26 -0
- package/lib/types/prerequisites/single/RatedPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RatedSumPrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/RatedSumPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RulePrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/RulePrerequisite.js +15 -0
- package/lib/types/prerequisites/single/SexPrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/SexPrerequisite.js +15 -0
- package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.d.ts +7 -0
- package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.js +17 -0
- package/lib/types/prerequisites/single/SocialStatusPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/SocialStatusPrerequisite.js +16 -0
- package/lib/types/prerequisites/single/StatePrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/StatePrerequisite.js +15 -0
- package/lib/types/prerequisites/single/TextPrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/TextPrerequisite.js +53 -0
- package/lib/types/prerequisites/single/TraditionPrerequisite.d.ts +37 -0
- package/lib/types/prerequisites/single/TraditionPrerequisite.js +42 -0
- package/lib/types/rule/AlternativeRule.d.ts +54 -0
- package/lib/types/rule/AlternativeRule.js +40 -0
- package/lib/types/rule/AlternativeRule_PlayerType.d.ts +6 -0
- package/lib/types/rule/AlternativeRule_PlayerType.js +16 -0
- package/lib/types/rule/CoreRule.d.ts +143 -0
- package/lib/types/rule/CoreRule.js +181 -0
- package/lib/types/rule/FocusRule.d.ts +79 -0
- package/lib/types/rule/FocusRule.js +48 -0
- package/lib/types/rule/FocusRule_Subject.d.ts +6 -0
- package/lib/types/rule/FocusRule_Subject.js +22 -0
- package/lib/types/rule/OptionalRule.d.ts +83 -0
- package/lib/types/rule/OptionalRule.js +59 -0
- package/lib/types/source/Publication.d.ts +50 -0
- package/lib/types/source/Publication.js +64 -0
- package/lib/types/source/_Erratum.d.ts +12 -0
- package/lib/types/source/_Erratum.js +22 -0
- package/lib/types/source/_PublicationRef.d.ts +168 -0
- package/lib/types/source/_PublicationRef.js +164 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +1234 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +52 -0
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AncestorGlyph.d.ts +1063 -0
- package/lib/types/specialAbility/AncestorGlyph.js +48 -0
- package/lib/types/specialAbility/BlessedTradition.d.ts +1141 -0
- package/lib/types/specialAbility/BlessedTradition.js +147 -0
- package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +1127 -0
- package/lib/types/specialAbility/BrawlingSpecialAbility.js +46 -0
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +53 -0
- package/lib/types/specialAbility/CombatSpecialAbility.d.ts +1235 -0
- package/lib/types/specialAbility/CombatSpecialAbility.js +52 -0
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +1286 -0
- package/lib/types/specialAbility/CombatStyleSpecialAbility.js +54 -0
- package/lib/types/specialAbility/CommandSpecialAbility.d.ts +1127 -0
- package/lib/types/specialAbility/CommandSpecialAbility.js +46 -0
- package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/FamiliarSpecialAbility.js +43 -0
- package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/FatePointSexSpecialAbility.js +43 -0
- package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/FatePointSpecialAbility.js +46 -0
- package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/GeneralSpecialAbility.js +47 -0
- package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/KarmaSpecialAbility.js +43 -0
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +1165 -0
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +49 -0
- package/lib/types/specialAbility/LycantropicGift.d.ts +1062 -0
- package/lib/types/specialAbility/LycantropicGift.js +43 -0
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +1165 -0
- package/lib/types/specialAbility/MagicStyleSpecialAbility.js +49 -0
- package/lib/types/specialAbility/MagicalSign.d.ts +127 -0
- package/lib/types/specialAbility/MagicalSign.js +66 -0
- package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/MagicalSpecialAbility.js +47 -0
- package/lib/types/specialAbility/MagicalTradition.d.ts +1138 -0
- package/lib/types/specialAbility/MagicalTradition.js +115 -0
- package/lib/types/specialAbility/PactGift.d.ts +1143 -0
- package/lib/types/specialAbility/PactGift.js +76 -0
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +1064 -0
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +54 -0
- package/lib/types/specialAbility/Sermon.d.ts +1062 -0
- package/lib/types/specialAbility/Sermon.js +43 -0
- package/lib/types/specialAbility/SexSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/SexSpecialAbility.js +46 -0
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +43 -0
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +1111 -0
- package/lib/types/specialAbility/SkillStyleSpecialAbility.js +46 -0
- package/lib/types/specialAbility/VampiricGift.d.ts +1062 -0
- package/lib/types/specialAbility/VampiricGift.js +43 -0
- package/lib/types/specialAbility/Vision.d.ts +1062 -0
- package/lib/types/specialAbility/Vision.js +43 -0
- package/lib/types/specialAbility/_Tradition.d.ts +5 -0
- package/lib/types/specialAbility/_Tradition.js +14 -0
- package/lib/types/specialAbility/sub/Language.d.ts +108 -0
- package/lib/types/specialAbility/sub/Language.js +98 -0
- package/lib/types/specialAbility/sub/Script.d.ts +62 -0
- package/lib/types/specialAbility/sub/Script.js +50 -0
- package/lib/types/specialAbility/sub/TradeSecret.d.ts +972 -0
- package/lib/types/specialAbility/sub/TradeSecret.js +76 -0
- package/lib/types/specialAbility/sub/_LanguageScript.d.ts +5 -0
- package/lib/types/specialAbility/sub/_LanguageScript.js +15 -0
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/AttireEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/AttireEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Beutelzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Beutelzauber.js +50 -0
- package/lib/types/traditionArtifacts/BowlEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/BowlEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/CauldronEnchantment.d.ts +1283 -0
- package/lib/types/traditionArtifacts/CauldronEnchantment.js +55 -0
- package/lib/types/traditionArtifacts/ChronicleEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ChronicleEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/DaggerRitual.d.ts +1294 -0
- package/lib/types/traditionArtifacts/DaggerRitual.js +85 -0
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.js +52 -0
- package/lib/types/traditionArtifacts/Haubenzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Haubenzauber.js +50 -0
- package/lib/types/traditionArtifacts/InstrumentEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/InstrumentEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Krallenkettenzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Krallenkettenzauber.js +50 -0
- package/lib/types/traditionArtifacts/Kristallkugelzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Kristallkugelzauber.js +50 -0
- package/lib/types/traditionArtifacts/OrbEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/OrbEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/RingEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/RingEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/SickleRitual.d.ts +1282 -0
- package/lib/types/traditionArtifacts/SickleRitual.js +50 -0
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/StaffEnchantment.d.ts +1286 -0
- package/lib/types/traditionArtifacts/StaffEnchantment.js +55 -0
- package/lib/types/traditionArtifacts/ToyEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ToyEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Trinkhornzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Trinkhornzauber.js +50 -0
- package/lib/types/traditionArtifacts/WandEnchantment.d.ts +1231 -0
- package/lib/types/traditionArtifacts/WandEnchantment.js +49 -0
- package/lib/types/traditionArtifacts/WeaponEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/WeaponEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/sub/AnimalShape.d.ts +8 -0
- package/lib/types/traditionArtifacts/sub/AnimalShape.js +24 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapePath.d.ts +6 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapePath.js +15 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapeSize.d.ts +8 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapeSize.js +23 -0
- package/lib/types/traditionArtifacts/sub/Brew.d.ts +6 -0
- package/lib/types/traditionArtifacts/sub/Brew.js +15 -0
- package/package.json +61 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const buildAncestorBloodAdvantagesCache = database => database
|
|
2
|
+
.getAllInstanceContainersOfEntity("Advantage")
|
|
3
|
+
.filter(({ content }) => content.prerequisites?.some(p => {
|
|
4
|
+
switch (p.prerequisite.kind) {
|
|
5
|
+
case "Single":
|
|
6
|
+
return p.prerequisite.Single.kind === "NoOtherAncestorBloodAdvantage";
|
|
7
|
+
case "Disjunction":
|
|
8
|
+
return p.prerequisite.Disjunction.list.some(d => d.kind === "NoOtherAncestorBloodAdvantage");
|
|
9
|
+
case "Group":
|
|
10
|
+
return p.prerequisite.Group.list.some(g => g.kind === "NoOtherAncestorBloodAdvantage");
|
|
11
|
+
}
|
|
12
|
+
}))
|
|
13
|
+
.map(({ id }) => id);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TSONDB } from "tsondb";
|
|
2
|
+
import type { TSONDBTypes } from "../main.ts";
|
|
3
|
+
import { type ActivatableSelectOptionsCache, type ResolvedSelectOption, type ResolvedSelectOptionIdentifier } from "./activatableSelectOptions.ts";
|
|
4
|
+
import { type AncestorBloodAdvantagesCache } from "./ancestorBloodAdvantages.ts";
|
|
5
|
+
import { type MagicalAndBlessedAdvantagesAndDisadvantagesCache } from "./magicalAndBlessedAdvantagesAndDisadvantages.ts";
|
|
6
|
+
import { type NewApplicationsAndUsesCache, type ResolvedNewSkillApplication, type ResolvedSkillUse } from "./newApplicationsAndUses.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Identifiers of specific entries in the database that are used for creating the cache.
|
|
9
|
+
*/
|
|
10
|
+
export type IdMap = {
|
|
11
|
+
Advantage: Record<"Blessed" | "Spellcaster", string>;
|
|
12
|
+
MagicalSpecialAbility: Record<"PropertyKnowledge", string>;
|
|
13
|
+
KarmaSpecialAbility: Record<"AspectKnowledge", string>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The cache object containing all precomputed data.
|
|
17
|
+
*/
|
|
18
|
+
export type Cache = {
|
|
19
|
+
activatableSelectOptions: ActivatableSelectOptionsCache;
|
|
20
|
+
sncestorBloodAdvantages: AncestorBloodAdvantagesCache;
|
|
21
|
+
magicalAndBlessedAdvantagesAndDisadvantages: MagicalAndBlessedAdvantagesAndDisadvantagesCache;
|
|
22
|
+
newApplicationsAndUses: NewApplicationsAndUsesCache;
|
|
23
|
+
};
|
|
24
|
+
export type { ActivatableSelectOptionsCache, AncestorBloodAdvantagesCache, MagicalAndBlessedAdvantagesAndDisadvantagesCache, NewApplicationsAndUsesCache, ResolvedNewSkillApplication, ResolvedSelectOption, ResolvedSelectOptionIdentifier, ResolvedSkillUse, };
|
|
25
|
+
/**
|
|
26
|
+
* Creates the cache by precomputing all necessary data from the database.
|
|
27
|
+
* @param db The TSONDB instance containing the database.
|
|
28
|
+
* @param idMap An object containing identifiers of specific entries in the database that are used for creating the cache.
|
|
29
|
+
* @returns The created cache object.
|
|
30
|
+
*/
|
|
31
|
+
export declare const createCache: (db: TSONDB<TSONDBTypes>, idMap: IdMap) => Cache;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { activatableSelectOptionsCacheBuilder, } from "./activatableSelectOptions.js";
|
|
2
|
+
import { buildAncestorBloodAdvantagesCache, } from "./ancestorBloodAdvantages.js";
|
|
3
|
+
import { buildMagicalAndBlessedAdvantagesAndDisadvantagesCache, } from "./magicalAndBlessedAdvantagesAndDisadvantages.js";
|
|
4
|
+
import { buildNewApplicationsAndUsesCache, } from "./newApplicationsAndUses.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates the cache by precomputing all necessary data from the database.
|
|
7
|
+
* @param db The TSONDB instance containing the database.
|
|
8
|
+
* @param idMap An object containing identifiers of specific entries in the database that are used for creating the cache.
|
|
9
|
+
* @returns The created cache object.
|
|
10
|
+
*/
|
|
11
|
+
export const createCache = (db, idMap) => {
|
|
12
|
+
const activatableSelectOptions = activatableSelectOptionsCacheBuilder(db, idMap);
|
|
13
|
+
const sncestorBloodAdvantages = buildAncestorBloodAdvantagesCache(db, idMap);
|
|
14
|
+
const magicalAndBlessedAdvantagesAndDisadvantages = buildMagicalAndBlessedAdvantagesAndDisadvantagesCache(db, idMap);
|
|
15
|
+
const newApplicationsAndUses = buildNewApplicationsAndUsesCache(db, idMap, activatableSelectOptions);
|
|
16
|
+
return {
|
|
17
|
+
activatableSelectOptions,
|
|
18
|
+
sncestorBloodAdvantages,
|
|
19
|
+
magicalAndBlessedAdvantagesAndDisadvantages,
|
|
20
|
+
newApplicationsAndUses,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CacheBuilder } from "./internal.ts";
|
|
2
|
+
export type MagicalAndBlessedAdvantagesAndDisadvantagesCache = Record<"Advantage" | "Disadvantage", Record<"Magical" | "Blessed", string[]>>;
|
|
3
|
+
export declare const buildMagicalAndBlessedAdvantagesAndDisadvantagesCache: CacheBuilder<MagicalAndBlessedAdvantagesAndDisadvantagesCache>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { assertExhaustive } from "@elyukai/utils/typeSafety";
|
|
2
|
+
const getAdvantageId = (idMap, type) => {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case "Magical":
|
|
5
|
+
return idMap.Advantage.Spellcaster;
|
|
6
|
+
case "Blessed":
|
|
7
|
+
return idMap.Advantage.Blessed;
|
|
8
|
+
default:
|
|
9
|
+
return assertExhaustive(type);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const isRatedFor = (type, ratedId) => {
|
|
13
|
+
switch (ratedId.kind) {
|
|
14
|
+
case "Spell":
|
|
15
|
+
case "Ritual":
|
|
16
|
+
return type === "Magical";
|
|
17
|
+
case "LiturgicalChant":
|
|
18
|
+
case "Ceremony":
|
|
19
|
+
return type === "Blessed";
|
|
20
|
+
case "Attribute":
|
|
21
|
+
case "Skill":
|
|
22
|
+
case "CloseCombatTechnique":
|
|
23
|
+
case "RangedCombatTechnique":
|
|
24
|
+
return false;
|
|
25
|
+
default:
|
|
26
|
+
return assertExhaustive(ratedId);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const isPrerequisiteFor = (idMap, type, prerequisite, getById, traversedIds) => {
|
|
30
|
+
switch (prerequisite.kind) {
|
|
31
|
+
case "Activatable": {
|
|
32
|
+
if (prerequisite.Activatable.id.kind === "Advantage" &&
|
|
33
|
+
prerequisite.Activatable.id.Advantage === getAdvantageId(idMap, type) &&
|
|
34
|
+
prerequisite.Activatable.active) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const entry = getById(prerequisite.Activatable.id);
|
|
38
|
+
return entry !== undefined && is(idMap, type, entry, getById, traversedIds);
|
|
39
|
+
}
|
|
40
|
+
case "Rated":
|
|
41
|
+
return isRatedFor(type, prerequisite.Rated.id);
|
|
42
|
+
case "CommonSuggestedByRCP":
|
|
43
|
+
case "Sex":
|
|
44
|
+
case "Race":
|
|
45
|
+
case "Culture":
|
|
46
|
+
case "Pact":
|
|
47
|
+
case "SocialStatus":
|
|
48
|
+
case "State":
|
|
49
|
+
case "Rule":
|
|
50
|
+
case "PrimaryAttribute":
|
|
51
|
+
case "BlessedTradition":
|
|
52
|
+
case "MagicalTradition":
|
|
53
|
+
case "RatedMinimumNumber":
|
|
54
|
+
case "RatedSum":
|
|
55
|
+
case "Enhancement":
|
|
56
|
+
case "Text":
|
|
57
|
+
case "NoOtherAncestorBloodAdvantage":
|
|
58
|
+
case "SexualCharacteristic":
|
|
59
|
+
return false;
|
|
60
|
+
default:
|
|
61
|
+
return assertExhaustive(prerequisite);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const is = (idMap, type, entry, getById, traversedIds) => {
|
|
65
|
+
if (!entry.content.prerequisites || traversedIds.includes(entry.id)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const newTraversedIds = [...traversedIds, entry.id];
|
|
69
|
+
return (entry.content.prerequisites !== undefined &&
|
|
70
|
+
entry.content.prerequisites.some(prerequisite => {
|
|
71
|
+
switch (prerequisite.prerequisite.kind) {
|
|
72
|
+
case "Single":
|
|
73
|
+
return isPrerequisiteFor(idMap, type, prerequisite.prerequisite.Single, getById, newTraversedIds);
|
|
74
|
+
case "Disjunction":
|
|
75
|
+
return prerequisite.prerequisite.Disjunction.list.some(p => isPrerequisiteFor(idMap, type, p, getById, newTraversedIds));
|
|
76
|
+
case "Group":
|
|
77
|
+
return prerequisite.prerequisite.Group.list.some(p => isPrerequisiteFor(idMap, type, p, getById, newTraversedIds));
|
|
78
|
+
default:
|
|
79
|
+
return assertExhaustive(prerequisite.prerequisite);
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
const entityKeyMap = {
|
|
84
|
+
Advantage: null,
|
|
85
|
+
Disadvantage: null,
|
|
86
|
+
};
|
|
87
|
+
const typeKeyMap = {
|
|
88
|
+
Magical: null,
|
|
89
|
+
Blessed: null,
|
|
90
|
+
};
|
|
91
|
+
const collectIds = (entity, type, database, idMap) => database
|
|
92
|
+
.getAllInstanceContainersOfEntity(entity)
|
|
93
|
+
.filter(entry => is(idMap, type, entry, database.getInstanceContainerOfEntityById.bind(database), []))
|
|
94
|
+
.map(({ id }) => id);
|
|
95
|
+
export const buildMagicalAndBlessedAdvantagesAndDisadvantagesCache = (database, idMap) => {
|
|
96
|
+
return Object.fromEntries(Object.keys(entityKeyMap).map((entity) => [
|
|
97
|
+
entity,
|
|
98
|
+
Object.fromEntries(Object.keys(typeKeyMap).map((type) => [
|
|
99
|
+
type,
|
|
100
|
+
collectIds(entity, type, database, idMap),
|
|
101
|
+
])),
|
|
102
|
+
]));
|
|
103
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ActivatableIdentifier, NewSkillApplication, NewSkillApplicationOrUseParentIdentifier, Skill_ID, SkillUse } from "../../gen/types.js";
|
|
2
|
+
import type { ActivatableSelectOptionsCache } from "./activatableSelectOptions.ts";
|
|
3
|
+
import type { CacheBuilder } from "./internal.ts";
|
|
4
|
+
export type ResolvedNewSkillApplication = {
|
|
5
|
+
id: string;
|
|
6
|
+
content: Omit<NewSkillApplication, "parent"> & {
|
|
7
|
+
parent: NewSkillApplicationOrUseParentIdentifier | ActivatableIdentifier;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type ResolvedSkillUse = {
|
|
11
|
+
id: string;
|
|
12
|
+
content: Omit<SkillUse, "parent"> & {
|
|
13
|
+
parent: NewSkillApplicationOrUseParentIdentifier | ActivatableIdentifier;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type NewApplicationsAndUsesCache = {
|
|
17
|
+
newApplications: Record<Skill_ID, ResolvedNewSkillApplication[]>;
|
|
18
|
+
uses: Record<Skill_ID, ResolvedSkillUse[]>;
|
|
19
|
+
};
|
|
20
|
+
export declare const buildNewApplicationsAndUsesCache: CacheBuilder<NewApplicationsAndUsesCache, [
|
|
21
|
+
generatedSelectOptions: ActivatableSelectOptionsCache
|
|
22
|
+
]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const groupByAffectedSkill = (entries, prev = {}) => entries.reduce((acc, entry) => entry.content.skills.reduce((acc1, skillId) => ({ ...acc1, [skillId]: [...(acc1[skillId] ?? []), entry] }), acc), prev);
|
|
2
|
+
const addGeneratedEntries = (generatedSelectOptions, prev) => Object.values(generatedSelectOptions).reduce((acc, byInstance) => Object.values(byInstance).reduce((acc1, resolvedSelectOptions) => resolvedSelectOptions.reduce((acc2, selectOption) => ({
|
|
3
|
+
newApplications: groupByAffectedSkill(selectOption.newApplications, acc2.newApplications),
|
|
4
|
+
uses: groupByAffectedSkill(selectOption.uses, acc2.uses),
|
|
5
|
+
}), acc1), acc), prev);
|
|
6
|
+
export const buildNewApplicationsAndUsesCache = (database, _idMap, generatedSelectOptions) => {
|
|
7
|
+
const cache = {
|
|
8
|
+
newApplications: groupByAffectedSkill(database.getAllInstanceContainersOfEntity("NewSkillApplication")),
|
|
9
|
+
uses: groupByAffectedSkill(database.getAllInstanceContainersOfEntity("SkillUse")),
|
|
10
|
+
};
|
|
11
|
+
return addGeneratedEntries(generatedSelectOptions, cache);
|
|
12
|
+
};
|
package/lib/main.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Schema } from "tsondb/schema";
|
|
2
|
+
import type { ChildEntityMap, EntityMap, EnumMap, TypeAliasMap } from "../gen/types.js";
|
|
3
|
+
declare module "tsondb/schema/gen" {
|
|
4
|
+
interface Register {
|
|
5
|
+
entityMap: EntityMap;
|
|
6
|
+
childEntityMap: ChildEntityMap;
|
|
7
|
+
enumMap: EnumMap;
|
|
8
|
+
typeAliasMap: TypeAliasMap;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export interface TSONDBTypes {
|
|
12
|
+
entityMap: EntityMap;
|
|
13
|
+
childEntityMap: ChildEntityMap;
|
|
14
|
+
enumMap: EnumMap;
|
|
15
|
+
typeAliasMap: TypeAliasMap;
|
|
16
|
+
}
|
|
17
|
+
export declare const schema: Schema<TSONDBTypes>;
|
package/lib/main.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Schema } from "tsondb/schema";
|
|
2
|
+
import * as Types from "./types/index.js";
|
|
3
|
+
export const schema = new Schema([
|
|
4
|
+
Types.AdvancedCombatSpecialAbility,
|
|
5
|
+
Types.AdvancedKarmaSpecialAbility,
|
|
6
|
+
Types.AdvancedMagicalSpecialAbility,
|
|
7
|
+
Types.AdvancedSkillSpecialAbility,
|
|
8
|
+
Types.Advantage,
|
|
9
|
+
Types.AlternativeRule,
|
|
10
|
+
Types.Ammunition,
|
|
11
|
+
Types.AncestorGlyph,
|
|
12
|
+
Types.Animal,
|
|
13
|
+
Types.AnimalCare,
|
|
14
|
+
Types.AnimalDisease,
|
|
15
|
+
Types.AnimalShape,
|
|
16
|
+
Types.AnimalShapePath,
|
|
17
|
+
Types.AnimalShapeSize,
|
|
18
|
+
Types.AnimalType,
|
|
19
|
+
Types.AnimistPower,
|
|
20
|
+
Types.ArcaneBardTradition,
|
|
21
|
+
Types.ArcaneDancerTradition,
|
|
22
|
+
Types.ArcaneOrbEnchantment,
|
|
23
|
+
Types.Armor,
|
|
24
|
+
Types.ArmorType,
|
|
25
|
+
Types.Aspect,
|
|
26
|
+
Types.AttireEnchantment,
|
|
27
|
+
Types.Attribute,
|
|
28
|
+
Types.BandageOrRemedy,
|
|
29
|
+
Types.Bannzeichen,
|
|
30
|
+
Types.Beutelzauber,
|
|
31
|
+
Types.BlessedTradition,
|
|
32
|
+
Types.Blessing,
|
|
33
|
+
Types.Book,
|
|
34
|
+
Types.BowlEnchantment,
|
|
35
|
+
Types.BrawlingSpecialAbility,
|
|
36
|
+
Types.Brew,
|
|
37
|
+
Types.Cantrip,
|
|
38
|
+
Types.CauldronEnchantment,
|
|
39
|
+
Types.CeremonialItem,
|
|
40
|
+
Types.CeremonialItemSpecialAbility,
|
|
41
|
+
Types.Ceremony,
|
|
42
|
+
Types.ChronicleEnchantment,
|
|
43
|
+
Types.CloseCombatTechnique,
|
|
44
|
+
Types.Clothes,
|
|
45
|
+
Types.ClothingPackage,
|
|
46
|
+
Types.CombatSpecialAbility,
|
|
47
|
+
Types.CombatStyleSpecialAbility,
|
|
48
|
+
Types.CommandSpecialAbility,
|
|
49
|
+
Types.Condition,
|
|
50
|
+
Types.Container,
|
|
51
|
+
Types.Continent,
|
|
52
|
+
Types.CoreRule,
|
|
53
|
+
Types.Culture,
|
|
54
|
+
Types.Curriculum,
|
|
55
|
+
Types.Curse,
|
|
56
|
+
Types.DaggerRitual,
|
|
57
|
+
Types.DerivedCharacteristic,
|
|
58
|
+
Types.Disadvantage,
|
|
59
|
+
Types.Disease,
|
|
60
|
+
Types.DominationRitual,
|
|
61
|
+
Types.Element,
|
|
62
|
+
Types.Elixir,
|
|
63
|
+
Types.ElvenMagicalSong,
|
|
64
|
+
Types.EquipmentOfBlessedOnes,
|
|
65
|
+
Types.EquipmentPackage,
|
|
66
|
+
Types.ExperienceLevel,
|
|
67
|
+
Types.EyeColor,
|
|
68
|
+
Types.FamiliarSpecialAbility,
|
|
69
|
+
Types.FamiliarsTrick,
|
|
70
|
+
Types.FatePointSexSpecialAbility,
|
|
71
|
+
Types.FatePointSpecialAbility,
|
|
72
|
+
Types.FocusRule,
|
|
73
|
+
Types.FoolsHatEnchantment,
|
|
74
|
+
Types.GemOrPreciousStone,
|
|
75
|
+
Types.GeneralSpecialAbility,
|
|
76
|
+
Types.GeodeRitual,
|
|
77
|
+
Types.GoblinRitual,
|
|
78
|
+
Types.Guideline,
|
|
79
|
+
Types.HairColor,
|
|
80
|
+
Types.Haubenzauber,
|
|
81
|
+
Types.HomunculusType,
|
|
82
|
+
Types.IlluminationLightSource,
|
|
83
|
+
Types.IlluminationRefillOrSupply,
|
|
84
|
+
Types.InstrumentEnchantment,
|
|
85
|
+
Types.JesterTrick,
|
|
86
|
+
Types.Jewelry,
|
|
87
|
+
Types.KarmaSpecialAbility,
|
|
88
|
+
Types.Krallenkettenzauber,
|
|
89
|
+
Types.Kristallkugelzauber,
|
|
90
|
+
Types.Laboratory,
|
|
91
|
+
Types.Language,
|
|
92
|
+
Types.Liebesspielzeug,
|
|
93
|
+
Types.LiturgicalChant,
|
|
94
|
+
Types.LiturgicalStyleSpecialAbility,
|
|
95
|
+
Types.LuxuryGood,
|
|
96
|
+
Types.LycantropicGift,
|
|
97
|
+
Types.MagicalArtifact,
|
|
98
|
+
Types.MagicalDance,
|
|
99
|
+
Types.MagicalMelody,
|
|
100
|
+
Types.MagicalRune,
|
|
101
|
+
Types.MagicalSign,
|
|
102
|
+
Types.MagicalSpecialAbility,
|
|
103
|
+
Types.MagicalTradition,
|
|
104
|
+
Types.MagicStyleSpecialAbility,
|
|
105
|
+
Types.MetaCondition,
|
|
106
|
+
Types.MusicalInstrument,
|
|
107
|
+
Types.Newspaper,
|
|
108
|
+
Types.OptionalRule,
|
|
109
|
+
Types.OrbEnchantment,
|
|
110
|
+
Types.OrienteeringAid,
|
|
111
|
+
Types.PactCategory,
|
|
112
|
+
Types.PactGift,
|
|
113
|
+
Types.Patron,
|
|
114
|
+
Types.PatronCategory,
|
|
115
|
+
Types.PersonalityTrait,
|
|
116
|
+
Types.PlayerType,
|
|
117
|
+
Types.Poison,
|
|
118
|
+
Types.Profession,
|
|
119
|
+
Types.Property,
|
|
120
|
+
Types.ProtectiveWardingCircleSpecialAbility,
|
|
121
|
+
Types.Publication,
|
|
122
|
+
Types.Race,
|
|
123
|
+
Types.RangedCombatTechnique,
|
|
124
|
+
Types.Reach,
|
|
125
|
+
Types.Region,
|
|
126
|
+
Types.RingEnchantment,
|
|
127
|
+
Types.Ritual,
|
|
128
|
+
Types.RopeOrChain,
|
|
129
|
+
Types.Script,
|
|
130
|
+
Types.Sermon,
|
|
131
|
+
Types.Service,
|
|
132
|
+
Types.SexPractice,
|
|
133
|
+
Types.SexSpecialAbility,
|
|
134
|
+
Types.SickleRitual,
|
|
135
|
+
Types.SikaryanDrainSpecialAbility,
|
|
136
|
+
Types.Skill,
|
|
137
|
+
Types.SkillGroup,
|
|
138
|
+
Types.SkillModificationLevel,
|
|
139
|
+
Types.SkillStyleSpecialAbility,
|
|
140
|
+
Types.SocialStatus,
|
|
141
|
+
Types.Spell,
|
|
142
|
+
Types.SpellSwordEnchantment,
|
|
143
|
+
Types.StaffEnchantment,
|
|
144
|
+
Types.State,
|
|
145
|
+
Types.Stationery,
|
|
146
|
+
Types.Subject,
|
|
147
|
+
Types.Talisman,
|
|
148
|
+
Types.TargetCategory,
|
|
149
|
+
Types.ThievesTool,
|
|
150
|
+
Types.ToolOfTheTrade,
|
|
151
|
+
Types.ToyEnchantment,
|
|
152
|
+
Types.TradeSecret,
|
|
153
|
+
Types.TravelGearOrTool,
|
|
154
|
+
Types.Tribe,
|
|
155
|
+
Types.Trinkhornzauber,
|
|
156
|
+
Types.VampiricGift,
|
|
157
|
+
Types.Vehicle,
|
|
158
|
+
Types.Vision,
|
|
159
|
+
Types.WandEnchantment,
|
|
160
|
+
Types.Weapon,
|
|
161
|
+
Types.WeaponAccessory,
|
|
162
|
+
Types.WeaponEnchantment,
|
|
163
|
+
Types.WorkingSupernaturalCreature,
|
|
164
|
+
Types.ZibiljaRitual,
|
|
165
|
+
], Types.Locale);
|
|
166
|
+
// /**
|
|
167
|
+
// * A dictionary of cache types and their associated location.
|
|
168
|
+
// */
|
|
169
|
+
// export type CachePaths = {
|
|
170
|
+
// [K in keyof CacheMap]: string
|
|
171
|
+
// }
|
|
172
|
+
// export type CacheOptions = {
|
|
173
|
+
// /**
|
|
174
|
+
// * Whether to pretty-print the JSON. Default is `false`.
|
|
175
|
+
// */
|
|
176
|
+
// pretty?: boolean
|
|
177
|
+
// }
|
|
178
|
+
// /**
|
|
179
|
+
// * Builds the cache and writes it to the specified paths in JSON format.
|
|
180
|
+
// * @param cachePaths The absolute paths to write each cache to.
|
|
181
|
+
// * @param validResults The data to build the cache from. Usually the result of
|
|
182
|
+
// * `getAllValidData`.
|
|
183
|
+
// * @param options Configuration options for building the cache.
|
|
184
|
+
// */
|
|
185
|
+
// export const buildCache = async (
|
|
186
|
+
// cachePaths: CachePaths,
|
|
187
|
+
// validResults: ValidResults,
|
|
188
|
+
// options: CacheOptions = {}
|
|
189
|
+
// ): Promise<void> => {
|
|
190
|
+
// const { pretty = false } = options
|
|
191
|
+
// const activatableSelectOptionsCache = cacheMap.activatableSelectOptions.builder(validResults)
|
|
192
|
+
// const ancestorBloodAdvantagesCache = cacheMap.ancestorBloodAdvantages.builder(validResults)
|
|
193
|
+
// const magicalAndBlessedAdvantagesAndDisadvantagesCache =
|
|
194
|
+
// cacheMap.magicalAndBlessedAdvantagesAndDisadvantages.builder(validResults)
|
|
195
|
+
// const newApplicationsAndUsesCache = cacheMap.newApplicationsAndUses.builder(
|
|
196
|
+
// validResults,
|
|
197
|
+
// activatableSelectOptionsCache
|
|
198
|
+
// )
|
|
199
|
+
// const cacheData: CacheMap = {
|
|
200
|
+
// activatableSelectOptions: activatableSelectOptionsCache,
|
|
201
|
+
// ancestorBloodAdvantages: ancestorBloodAdvantagesCache,
|
|
202
|
+
// magicalAndBlessedAdvantagesAndDisadvantages: magicalAndBlessedAdvantagesAndDisadvantagesCache,
|
|
203
|
+
// newApplicationsAndUses: newApplicationsAndUsesCache,
|
|
204
|
+
// }
|
|
205
|
+
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
206
|
+
// await mkdir(dirname(cachePath), { recursive: true })
|
|
207
|
+
// await writeFile(
|
|
208
|
+
// cachePath,
|
|
209
|
+
// JSON.stringify(cacheData[cacheName as keyof CachePaths], null, pretty ? 2 : undefined),
|
|
210
|
+
// "utf-8"
|
|
211
|
+
// )
|
|
212
|
+
// }
|
|
213
|
+
// }
|
|
214
|
+
// /**
|
|
215
|
+
// * Reads the cache from the specified paths in JSON format.
|
|
216
|
+
// * @param cachePaths The absolute paths to read each cache from.
|
|
217
|
+
// * @returns
|
|
218
|
+
// */
|
|
219
|
+
// export const getCache = async (cachePaths: CachePaths): Promise<CacheMap> => {
|
|
220
|
+
// const cache: Partial<CacheMap> = {}
|
|
221
|
+
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
222
|
+
// const cacheData = JSON.parse(await readFile(cachePath, "utf-8"))
|
|
223
|
+
// cache[cacheName as keyof CacheMap] = cacheData
|
|
224
|
+
// }
|
|
225
|
+
// return cache as CacheMap
|
|
226
|
+
// }
|
package/lib/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/test.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { stderr } from "node:process";
|
|
2
|
+
import { styleText } from "node:util";
|
|
3
|
+
// importing the main file will run the schema checks
|
|
4
|
+
import("./main.js")
|
|
5
|
+
.then(() => {
|
|
6
|
+
console.log(styleText("green", "Schema is valid"));
|
|
7
|
+
})
|
|
8
|
+
.catch((err) => {
|
|
9
|
+
console.error(styleText("red", err instanceof Error ? err.message : String(err), { stream: stderr }));
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
});
|