optolith-database-schema 0.1.25 → 0.1.28
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/CHANGELOG.md +28 -0
- package/lib/config.d.ts +16 -2
- package/lib/config.js +16 -2
- package/lib/main.js +8 -9
- package/lib/types/AnimalDisease.d.ts +252 -0
- package/lib/types/AnimalDisease.js +5 -0
- package/lib/types/{FamiliarsTrick_AnimalType.d.ts → AnimalType.d.ts} +0 -0
- package/lib/types/{FamiliarsTrick_AnimalType.js → AnimalType.js} +0 -0
- package/lib/types/Disease.d.ts +177 -0
- package/lib/types/Disease.js +5 -0
- package/lib/types/Poison.d.ts +208 -0
- package/lib/types/Poison.js +5 -0
- package/lib/types/Race.d.ts +3 -25
- package/lib/types/Race.js +0 -9
- package/lib/types/UI.d.ts +1065 -0
- package/lib/types/UI.js +5 -0
- package/lib/types/_Dice.d.ts +23 -0
- package/lib/types/_Dice.js +9 -0
- package/lib/types/_Identifier.d.ts +1 -0
- package/lib/types/_Identifier.js +1 -0
- package/lib/types/equipment/ArmorType.d.ts +31 -0
- package/lib/types/equipment/ArmorType.js +5 -0
- package/lib/types/equipment/Item.d.ts +308 -0
- package/lib/types/equipment/Item.js +35 -0
- package/lib/types/equipment/ItemGroup.d.ts +31 -0
- package/lib/types/equipment/ItemGroup.js +5 -0
- package/lib/types/equipment/Reach.d.ts +31 -0
- package/lib/types/equipment/Reach.js +5 -0
- package/lib/types/equipment/_Armor.d.ts +70 -0
- package/lib/types/equipment/_Armor.js +4 -0
- package/lib/types/equipment/_Weapon.d.ts +330 -0
- package/lib/types/equipment/_Weapon.js +4 -0
- package/package.json +1 -1
- package/schema/AnimalDisease.schema.json +382 -0
- package/schema/{FamiliarsTrick_AnimalType.schema.json → AnimalType.schema.json} +1 -1
- package/schema/Disease.schema.json +244 -0
- package/schema/Poison.schema.json +417 -0
- package/schema/Race.schema.json +3 -31
- package/schema/UI.schema.json +3389 -0
- package/schema/_Dice.schema.json +34 -0
- package/schema/_Identifier.schema.json +1 -0
- package/schema/equipment/ArmorType.schema.json +45 -0
- package/schema/equipment/Item.schema.json +621 -0
- package/schema/equipment/ItemGroup.schema.json +45 -0
- package/schema/equipment/Reach.schema.json +45 -0
- package/schema/equipment/_Armor.schema.json +125 -0
- package/schema/equipment/_Weapon.schema.json +664 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.1.28](https://github.com/elyukai/optolith-database-schema/compare/v0.1.27...v0.1.28) (2022-03-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* allow skills in advanced special ability restrictions ([237dbbd](https://github.com/elyukai/optolith-database-schema/commit/237dbbdeddcc0df07387196ae2537a19c1deab16))
|
|
11
|
+
* items status quo ([c4b349b](https://github.com/elyukai/optolith-database-schema/commit/c4b349bf10fca92286c0510cab8ccb67563f0532))
|
|
12
|
+
|
|
13
|
+
### [0.1.27](https://github.com/elyukai/optolith-database-schema/compare/v0.1.26...v0.1.27) (2022-03-24)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* maximum call stack size exceeded with ui schema ([a752342](https://github.com/elyukai/optolith-database-schema/commit/a752342708b2a3e4b98e57a0adcbfd9b449d02fe))
|
|
19
|
+
|
|
20
|
+
### [0.1.26](https://github.com/elyukai/optolith-database-schema/compare/v0.1.25...v0.1.26) (2022-03-24)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* animal diseases ([b7d2639](https://github.com/elyukai/optolith-database-schema/commit/b7d263942c14c76b6a3bfda780ecadf6cb7a60df))
|
|
26
|
+
* armor types ([c5b9a22](https://github.com/elyukai/optolith-database-schema/commit/c5b9a22e5c277a28a8bc0c8cbe3b0cc41235087d))
|
|
27
|
+
* diseases ([5e7c8a6](https://github.com/elyukai/optolith-database-schema/commit/5e7c8a6f83ce0b3f7c3854e759b8f042ed7451c8))
|
|
28
|
+
* item groups ([b2678ac](https://github.com/elyukai/optolith-database-schema/commit/b2678aca250d4666f7a894ddfc0fc9c3f6a22bcf))
|
|
29
|
+
* poisons ([fb9898f](https://github.com/elyukai/optolith-database-schema/commit/fb9898fbce8fcaaed0f83f8afe8fafeab8294a28))
|
|
30
|
+
* reaches ([9ed3937](https://github.com/elyukai/optolith-database-schema/commit/9ed39370410a3af29c585a3321c59e794dad70ae))
|
|
31
|
+
* ui status quo ([5cb5058](https://github.com/elyukai/optolith-database-schema/commit/5cb50581de6bb3c9a4ee7a89ae52a1dea957c8d8))
|
|
32
|
+
|
|
5
33
|
### [0.1.25](https://github.com/elyukai/optolith-database-schema/compare/v0.1.24...v0.1.25) (2022-03-23)
|
|
6
34
|
|
|
7
35
|
|
package/lib/config.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Advantage } from "./types/Advantage.js";
|
|
2
|
+
import { AnimalDisease } from "./types/AnimalDisease.js";
|
|
3
|
+
import { AnimalType } from "./types/AnimalType.js";
|
|
2
4
|
import { ArcaneBardTradition } from "./types/ArcaneBardTradition.js";
|
|
3
5
|
import { ArcaneDancerTradition } from "./types/ArcaneDancerTradition.js";
|
|
4
6
|
import { Aspect } from "./types/Aspect.js";
|
|
@@ -13,12 +15,15 @@ import { Continent } from "./types/Continent.js";
|
|
|
13
15
|
import { Culture } from "./types/Culture.js";
|
|
14
16
|
import { DerivedCharacteristic } from "./types/DerivedCharacteristic.js";
|
|
15
17
|
import { Disadvantage } from "./types/Disadvantage.js";
|
|
18
|
+
import { Disease } from "./types/Disease.js";
|
|
16
19
|
import { Element } from "./types/Element.js";
|
|
20
|
+
import { ArmorType } from "./types/equipment/ArmorType.js";
|
|
17
21
|
import { EquipmentPackage } from "./types/equipment/EquipmentPackage.js";
|
|
22
|
+
import { ItemGroup } from "./types/equipment/ItemGroup.js";
|
|
23
|
+
import { Reach } from "./types/equipment/Reach.js";
|
|
18
24
|
import { ExperienceLevel } from "./types/ExperienceLevel.js";
|
|
19
25
|
import { EyeColor } from "./types/EyeColor.js";
|
|
20
26
|
import { FamiliarsTrick } from "./types/FamiliarsTrick.js";
|
|
21
|
-
import { AnimalType } from "./types/FamiliarsTrick_AnimalType.js";
|
|
22
27
|
import { HairColor } from "./types/HairColor.js";
|
|
23
28
|
import { Kirchenpraegung } from "./types/Kirchenpraegung.js";
|
|
24
29
|
import { Curriculum } from "./types/Lessons_Curriculum.js";
|
|
@@ -42,6 +47,7 @@ import { PactCategory } from "./types/PactCategory.js";
|
|
|
42
47
|
import { Patron } from "./types/Patron.js";
|
|
43
48
|
import { PatronCategory } from "./types/PatronCategory.js";
|
|
44
49
|
import { PersonalityTrait } from "./types/PersonalityTrait.js";
|
|
50
|
+
import { Poison } from "./types/Poison.js";
|
|
45
51
|
import { Profession } from "./types/Profession.js";
|
|
46
52
|
import { Property } from "./types/Property.js";
|
|
47
53
|
import { Race } from "./types/Race.js";
|
|
@@ -116,6 +122,7 @@ import { ToyEnchantment } from "./types/traditionArtifacts/ToyEnchantment.js";
|
|
|
116
122
|
import { Trinkhornzauber } from "./types/traditionArtifacts/Trinkhornzauber.js";
|
|
117
123
|
import { WandEnchantment } from "./types/traditionArtifacts/WandEnchantment.js";
|
|
118
124
|
import { WeaponEnchantment } from "./types/traditionArtifacts/WeaponEnchantment.js";
|
|
125
|
+
import { UI } from "./types/UI.js";
|
|
119
126
|
import { TypeValidator } from "./validation/schema.js";
|
|
120
127
|
export declare type TypeMap = {
|
|
121
128
|
advancedCombatSpecialAbilities: AdvancedCombatSpecialAbility;
|
|
@@ -124,14 +131,17 @@ export declare type TypeMap = {
|
|
|
124
131
|
advancedSkillSpecialAbilities: AdvancedSkillSpecialAbility;
|
|
125
132
|
advantages: Advantage;
|
|
126
133
|
ancestorGlyphs: AncestorGlyph;
|
|
134
|
+
animalDiseases: AnimalDisease;
|
|
127
135
|
animalShapePaths: AnimalShapePath;
|
|
128
136
|
animalShapes: AnimalShape;
|
|
129
137
|
animalShapeSizes: AnimalShapeSize;
|
|
138
|
+
animalTypes: AnimalType;
|
|
130
139
|
animistPowers: AnimistPower;
|
|
131
140
|
animistPowerTribes: Tribe;
|
|
132
141
|
arcaneBardTraditions: ArcaneBardTradition;
|
|
133
142
|
arcaneDancerTraditions: ArcaneDancerTradition;
|
|
134
143
|
arcaneOrbEnchantments: ArcaneOrbEnchantment;
|
|
144
|
+
armorTypes: ArmorType;
|
|
135
145
|
aspects: Aspect;
|
|
136
146
|
attireEnchantments: AttireEnchantment;
|
|
137
147
|
attributes: Attribute;
|
|
@@ -157,6 +167,7 @@ export declare type TypeMap = {
|
|
|
157
167
|
daggerRituals: DaggerRitual;
|
|
158
168
|
derivedCharacteristics: DerivedCharacteristic;
|
|
159
169
|
disadvantages: Disadvantage;
|
|
170
|
+
diseases: Disease;
|
|
160
171
|
dominationRituals: DominationRitual;
|
|
161
172
|
elements: Element;
|
|
162
173
|
elvenMagicalSongs: ElvenMagicalSong;
|
|
@@ -164,7 +175,6 @@ export declare type TypeMap = {
|
|
|
164
175
|
experienceLevels: ExperienceLevel;
|
|
165
176
|
eyeColors: EyeColor;
|
|
166
177
|
familiarSpecialAbilities: FamiliarSpecialAbility;
|
|
167
|
-
familiarsTrickAnimalTypes: AnimalType;
|
|
168
178
|
familiarsTricks: FamiliarsTrick;
|
|
169
179
|
fatePointSexSpecialAbilities: FatePointSexSpecialAbility;
|
|
170
180
|
fatePointSpecialAbilities: FatePointSpecialAbility;
|
|
@@ -175,6 +185,7 @@ export declare type TypeMap = {
|
|
|
175
185
|
geodeRituals: GeodeRitual;
|
|
176
186
|
hairColors: HairColor;
|
|
177
187
|
instrumentEnchantments: InstrumentEnchantment;
|
|
188
|
+
itemGroups: ItemGroup;
|
|
178
189
|
jesterTricks: JesterTrick;
|
|
179
190
|
karmaSpecialAbilities: KarmaSpecialAbility;
|
|
180
191
|
kirchenpraegungen: Kirchenpraegung;
|
|
@@ -201,12 +212,14 @@ export declare type TypeMap = {
|
|
|
201
212
|
patronCategories: PatronCategory;
|
|
202
213
|
patrons: Patron;
|
|
203
214
|
personalityTraits: PersonalityTrait;
|
|
215
|
+
poisons: Poison;
|
|
204
216
|
professions: Profession;
|
|
205
217
|
properties: Property;
|
|
206
218
|
protectiveWardingCircleSpecialAbilities: ProtectiveWardingCircleSpecialAbility;
|
|
207
219
|
publications: Publication;
|
|
208
220
|
races: Race;
|
|
209
221
|
rangedCombatTechniques: RangedCombatTechnique;
|
|
222
|
+
reaches: Reach;
|
|
210
223
|
regions: Region;
|
|
211
224
|
ringEnchantments: RingEnchantment;
|
|
212
225
|
rituals: Ritual;
|
|
@@ -231,6 +244,7 @@ export declare type TypeMap = {
|
|
|
231
244
|
toyEnchantments: ToyEnchantment;
|
|
232
245
|
tradeSecrets: TradeSecret;
|
|
233
246
|
trinkhornzauber: Trinkhornzauber;
|
|
247
|
+
ui: UI;
|
|
234
248
|
vampiricGifts: VampiricGift;
|
|
235
249
|
visions: Vision;
|
|
236
250
|
wandEnchantments: WandEnchantment;
|
package/lib/config.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { validateSchema as validateAdvantageSchema } from "./types/Advantage.js";
|
|
2
|
+
import { validateSchema as validateAnimalDiseaseSchema } from "./types/AnimalDisease.js";
|
|
3
|
+
import { validateSchema as validateAnimalTypeSchema } from "./types/AnimalType.js";
|
|
2
4
|
import { validateSchema as validateArcaneBardTraditionSchema } from "./types/ArcaneBardTradition.js";
|
|
3
5
|
import { validateSchema as validateArcaneDancerTraditionSchema } from "./types/ArcaneDancerTradition.js";
|
|
4
6
|
import { validateSchema as validateAspectSchema } from "./types/Aspect.js";
|
|
@@ -13,12 +15,15 @@ import { validateSchema as validateContinentSchema } from "./types/Continent.js"
|
|
|
13
15
|
import { validateSchema as validateCultureSchema } from "./types/Culture.js";
|
|
14
16
|
import { validateSchema as validateDerivedCharacteristicSchema } from "./types/DerivedCharacteristic.js";
|
|
15
17
|
import { validateSchema as validateDisadvantageSchema } from "./types/Disadvantage.js";
|
|
18
|
+
import { validateSchema as validateDiseaseSchema } from "./types/Disease.js";
|
|
16
19
|
import { validateSchema as validateElementSchema } from "./types/Element.js";
|
|
20
|
+
import { validateSchema as validateArmorTypeSchema } from "./types/equipment/ArmorType.js";
|
|
17
21
|
import { validateSchema as validateEquipmentPackageSchema } from "./types/equipment/EquipmentPackage.js";
|
|
22
|
+
import { validateSchema as validateItemGroupSchema } from "./types/equipment/ItemGroup.js";
|
|
23
|
+
import { validateSchema as validateReachSchema } from "./types/equipment/Reach.js";
|
|
18
24
|
import { validateSchema as validateExperienceLevelSchema } from "./types/ExperienceLevel.js";
|
|
19
25
|
import { validateSchema as validateEyeColorSchema } from "./types/EyeColor.js";
|
|
20
26
|
import { validateSchema as validateFamiliarsTrickSchema } from "./types/FamiliarsTrick.js";
|
|
21
|
-
import { validateSchema as validateAnimalTypeSchema } from "./types/FamiliarsTrick_AnimalType.js";
|
|
22
27
|
import { validateSchema as validateHairColorSchema } from "./types/HairColor.js";
|
|
23
28
|
import { validateSchema as validateKirchenpraegungSchema } from "./types/Kirchenpraegung.js";
|
|
24
29
|
import { validateSchema as validateCurriculumSchema } from "./types/Lessons_Curriculum.js";
|
|
@@ -42,6 +47,7 @@ import { validateSchema as validatePactCategorySchema } from "./types/PactCatego
|
|
|
42
47
|
import { validateSchema as validatePatronSchema } from "./types/Patron.js";
|
|
43
48
|
import { validateSchema as validatePatronCategorySchema } from "./types/PatronCategory.js";
|
|
44
49
|
import { validateSchema as validatePersonalityTraitSchema } from "./types/PersonalityTrait.js";
|
|
50
|
+
import { validateSchema as validatePoisonSchema } from "./types/Poison.js";
|
|
45
51
|
import { validateSchema as validateProfessionSchema } from "./types/Profession.js";
|
|
46
52
|
import { validateSchema as validatePropertySchema } from "./types/Property.js";
|
|
47
53
|
import { validateSchema as validateRaceSchema } from "./types/Race.js";
|
|
@@ -116,6 +122,7 @@ import { validateSchema as validateToyEnchantmentSchema } from "./types/traditio
|
|
|
116
122
|
import { validateSchema as validateTrinkhornzauberSchema } from "./types/traditionArtifacts/Trinkhornzauber.js";
|
|
117
123
|
import { validateSchema as validateWandEnchantmentSchema } from "./types/traditionArtifacts/WandEnchantment.js";
|
|
118
124
|
import { validateSchema as validateWeaponEnchantmentSchema } from "./types/traditionArtifacts/WeaponEnchantment.js";
|
|
125
|
+
import { validateSchema as validateUISchema } from "./types/UI.js";
|
|
119
126
|
export const typeValidatorMap = {
|
|
120
127
|
advancedCombatSpecialAbilities: validateAdvancedCombatSpecialAbilitySchema,
|
|
121
128
|
advancedKarmaSpecialAbilities: validateAdvancedKarmaSpecialAbilitySchema,
|
|
@@ -123,14 +130,17 @@ export const typeValidatorMap = {
|
|
|
123
130
|
advancedSkillSpecialAbilities: validateAdvancedSkillSpecialAbilitySchema,
|
|
124
131
|
advantages: validateAdvantageSchema,
|
|
125
132
|
ancestorGlyphs: validateAncestorGlyphSchema,
|
|
133
|
+
animalDiseases: validateAnimalDiseaseSchema,
|
|
126
134
|
animalShapePaths: validateAnimalShapePathSchema,
|
|
127
135
|
animalShapes: validateAnimalShapeSchema,
|
|
128
136
|
animalShapeSizes: validateAnimalShapeSizeSchema,
|
|
137
|
+
animalTypes: validateAnimalTypeSchema,
|
|
129
138
|
animistPowers: validateAnimistPowerSchema,
|
|
130
139
|
animistPowerTribes: validateTribeSchema,
|
|
131
140
|
arcaneBardTraditions: validateArcaneBardTraditionSchema,
|
|
132
141
|
arcaneDancerTraditions: validateArcaneDancerTraditionSchema,
|
|
133
142
|
arcaneOrbEnchantments: validateArcaneOrbEnchantmentSchema,
|
|
143
|
+
armorTypes: validateArmorTypeSchema,
|
|
134
144
|
aspects: validateAspectSchema,
|
|
135
145
|
attireEnchantments: validateAttireEnchantmentSchema,
|
|
136
146
|
attributes: validateAttributeSchema,
|
|
@@ -156,6 +166,7 @@ export const typeValidatorMap = {
|
|
|
156
166
|
daggerRituals: validateDaggerRitualSchema,
|
|
157
167
|
derivedCharacteristics: validateDerivedCharacteristicSchema,
|
|
158
168
|
disadvantages: validateDisadvantageSchema,
|
|
169
|
+
diseases: validateDiseaseSchema,
|
|
159
170
|
dominationRituals: validateDominationRitualSchema,
|
|
160
171
|
elements: validateElementSchema,
|
|
161
172
|
elvenMagicalSongs: validateElvenMagicalSongSchema,
|
|
@@ -163,7 +174,6 @@ export const typeValidatorMap = {
|
|
|
163
174
|
experienceLevels: validateExperienceLevelSchema,
|
|
164
175
|
eyeColors: validateEyeColorSchema,
|
|
165
176
|
familiarSpecialAbilities: validateFamiliarSpecialAbilitySchema,
|
|
166
|
-
familiarsTrickAnimalTypes: validateAnimalTypeSchema,
|
|
167
177
|
familiarsTricks: validateFamiliarsTrickSchema,
|
|
168
178
|
fatePointSexSpecialAbilities: validateFatePointSexSpecialAbilitySchema,
|
|
169
179
|
fatePointSpecialAbilities: validateFatePointSpecialAbilitySchema,
|
|
@@ -174,6 +184,7 @@ export const typeValidatorMap = {
|
|
|
174
184
|
geodeRituals: validateGeodeRitualSchema,
|
|
175
185
|
hairColors: validateHairColorSchema,
|
|
176
186
|
instrumentEnchantments: validateInstrumentEnchantmentSchema,
|
|
187
|
+
itemGroups: validateItemGroupSchema,
|
|
177
188
|
jesterTricks: validateJesterTrickSchema,
|
|
178
189
|
karmaSpecialAbilities: validateKarmaSpecialAbilitySchema,
|
|
179
190
|
kirchenpraegungen: validateKirchenpraegungSchema,
|
|
@@ -200,12 +211,14 @@ export const typeValidatorMap = {
|
|
|
200
211
|
patronCategories: validatePatronCategorySchema,
|
|
201
212
|
patrons: validatePatronSchema,
|
|
202
213
|
personalityTraits: validatePersonalityTraitSchema,
|
|
214
|
+
poisons: validatePoisonSchema,
|
|
203
215
|
professions: validateProfessionSchema,
|
|
204
216
|
properties: validatePropertySchema,
|
|
205
217
|
protectiveWardingCircleSpecialAbilities: validateProtectiveWardingCircleSpecialAbilitySchema,
|
|
206
218
|
publications: validatePublicationSchema,
|
|
207
219
|
races: validateRaceSchema,
|
|
208
220
|
rangedCombatTechniques: validateRangedCombatTechniqueSchema,
|
|
221
|
+
reaches: validateReachSchema,
|
|
209
222
|
regions: validateRegionSchema,
|
|
210
223
|
ringEnchantments: validateRingEnchantmentSchema,
|
|
211
224
|
rituals: validateRitualSchema,
|
|
@@ -230,6 +243,7 @@ export const typeValidatorMap = {
|
|
|
230
243
|
toyEnchantments: validateToyEnchantmentSchema,
|
|
231
244
|
tradeSecrets: validateTradeSecretSchema,
|
|
232
245
|
trinkhornzauber: validateTrinkhornzauberSchema,
|
|
246
|
+
ui: validateUISchema,
|
|
233
247
|
vampiricGifts: validateVampiricGiftSchema,
|
|
234
248
|
visions: validateVisionSchema,
|
|
235
249
|
wandEnchantments: validateWandEnchantmentSchema,
|
package/lib/main.js
CHANGED
|
@@ -22,12 +22,11 @@ const readdirRecursive = async (dirPath) => {
|
|
|
22
22
|
return flattenedRecursivePaths.flat();
|
|
23
23
|
};
|
|
24
24
|
const registerAllJsonSchemaDocuments = async (validator) => {
|
|
25
|
-
const allJsonSchemaFilePaths = await readdirRecursive(jsonSchemaDir);
|
|
26
25
|
const readFileAsUtf8 = (path) => readFile(path, "utf-8");
|
|
27
26
|
const readFilesAsUtf8 = (paths) => Promise.all(paths.map(readFileAsUtf8));
|
|
28
27
|
const parseJson = (json) => JSON.parse(json);
|
|
29
28
|
const registerSchemaInValidator = (jsonSchema) => { validator.addSchema(jsonSchema); };
|
|
30
|
-
(await readFilesAsUtf8(
|
|
29
|
+
(await readFilesAsUtf8(await readdirRecursive(jsonSchemaDir)))
|
|
31
30
|
.map(parseJson)
|
|
32
31
|
.forEach(registerSchemaInValidator);
|
|
33
32
|
};
|
|
@@ -48,14 +47,11 @@ const validateAllFromType = async (validator, typeName, path) => {
|
|
|
48
47
|
const isFile = (await lstat(path)).isFile();
|
|
49
48
|
const typeValidator = typeValidatorMap[typeName];
|
|
50
49
|
if (isFile) {
|
|
51
|
-
return
|
|
50
|
+
return { [path]: typeValidator(validator, await readFile(path, "utf-8"), path) };
|
|
52
51
|
}
|
|
53
52
|
else {
|
|
54
53
|
const dataFiles = await readDataFileAssocsFromDirectory(path);
|
|
55
|
-
return [
|
|
56
|
-
typeName,
|
|
57
|
-
Object.fromEntries(dataFiles.map(([filePath, fileContent]) => [filePath, typeValidator(validator, fileContent, filePath)]))
|
|
58
|
-
];
|
|
54
|
+
return Object.fromEntries(dataFiles.map(([filePath, fileContent]) => [filePath, typeValidator(validator, fileContent, filePath)]));
|
|
59
55
|
}
|
|
60
56
|
};
|
|
61
57
|
const rawResultMapToResult = (rawResultMap) => Object.entries(rawResultMap).reduce((result, [typeName, typeResults]) => Object.entries(typeResults).reduce((outerResult, [filePath, fileResult]) => {
|
|
@@ -93,11 +89,14 @@ const rawResultMapToResult = (rawResultMap) => Object.entries(rawResultMap).redu
|
|
|
93
89
|
value: {}
|
|
94
90
|
}));
|
|
95
91
|
export const validate = async (entityDirPaths, checkIntegrity) => {
|
|
96
|
-
const validator = new Ajv();
|
|
92
|
+
const validator = new Ajv({ allErrors: true });
|
|
97
93
|
addFormats(validator);
|
|
98
94
|
await registerAllJsonSchemaDocuments(validator);
|
|
99
95
|
const rawResultMap = Object.fromEntries((await Promise.all(Object.entries(entityDirPaths)
|
|
100
|
-
.map(async ([typeName, path]) =>
|
|
96
|
+
.map(async ([typeName, path]) => [
|
|
97
|
+
typeName,
|
|
98
|
+
await validateAllFromType(validator, typeName, path)
|
|
99
|
+
]))));
|
|
101
100
|
return rawResultMapToResult(rawResultMap);
|
|
102
101
|
};
|
|
103
102
|
export const printErrors = (errorsByFile) => Object.entries(errorsByFile)
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @main AnimalDisease
|
|
3
|
+
*/
|
|
4
|
+
import { Errata } from "./source/_Erratum.js";
|
|
5
|
+
import { PublicationRefs } from "./source/_PublicationRef.js";
|
|
6
|
+
/**
|
|
7
|
+
* @title Animal Disease
|
|
8
|
+
*/
|
|
9
|
+
export declare type AnimalDisease = {
|
|
10
|
+
/**
|
|
11
|
+
* The animal disease's identifier. An unique, increasing integer.
|
|
12
|
+
* @integer
|
|
13
|
+
* @minimum 1
|
|
14
|
+
*/
|
|
15
|
+
id: number;
|
|
16
|
+
/**
|
|
17
|
+
* The animal disease's level.
|
|
18
|
+
* @integer
|
|
19
|
+
* @minimum 1
|
|
20
|
+
*/
|
|
21
|
+
level: number;
|
|
22
|
+
/**
|
|
23
|
+
* Depending on the disease, apply Spirit or Toughness as a penalty to the
|
|
24
|
+
* disease roll. It may also happen that the lower of both is applied as a
|
|
25
|
+
* penalty.
|
|
26
|
+
*/
|
|
27
|
+
resistance: {
|
|
28
|
+
tag: "Spirit";
|
|
29
|
+
} | {
|
|
30
|
+
tag: "Toughness";
|
|
31
|
+
} | {
|
|
32
|
+
tag: "LowerOfSpiritAndToughness";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* What causes the disease? The GM rolls 1D20 to see if a character gets
|
|
36
|
+
* infected. If the infection check succeeds, the GM makes a disease check to
|
|
37
|
+
* determine the severity of the infection.
|
|
38
|
+
* @minItems 1
|
|
39
|
+
*/
|
|
40
|
+
cause: {
|
|
41
|
+
/**
|
|
42
|
+
* The chance to get infected by this cause, in percent.
|
|
43
|
+
* @integer
|
|
44
|
+
* @minimum 5
|
|
45
|
+
* @multipleOf 5
|
|
46
|
+
* @maximum 100
|
|
47
|
+
*/
|
|
48
|
+
chance?: number;
|
|
49
|
+
/**
|
|
50
|
+
* All translations for the entry, identified by IETF language tag (BCP47).
|
|
51
|
+
* @minProperties 1
|
|
52
|
+
*/
|
|
53
|
+
translations: {
|
|
54
|
+
/**
|
|
55
|
+
* @patternProperties ^[a-z]{2}-[A-Z]{2}$
|
|
56
|
+
*/
|
|
57
|
+
[localeId: string]: {
|
|
58
|
+
/**
|
|
59
|
+
* The name of the cause.
|
|
60
|
+
* @minLength 1
|
|
61
|
+
*/
|
|
62
|
+
name: string;
|
|
63
|
+
/**
|
|
64
|
+
* The chance to get infected by this cause. If present for this
|
|
65
|
+
* language, this overrides the universal `chance` field; they cannot be
|
|
66
|
+
* used at the same time.
|
|
67
|
+
* @minLength 1
|
|
68
|
+
*/
|
|
69
|
+
chance?: string;
|
|
70
|
+
/**
|
|
71
|
+
* An additional note about this cause.
|
|
72
|
+
* @minLength 1
|
|
73
|
+
*/
|
|
74
|
+
note?: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}[];
|
|
78
|
+
/**
|
|
79
|
+
* The animal types this disease applies to.
|
|
80
|
+
*/
|
|
81
|
+
animal_types: {
|
|
82
|
+
tag: "All";
|
|
83
|
+
} | {
|
|
84
|
+
tag: "Specific";
|
|
85
|
+
/**
|
|
86
|
+
* The list of specific animal types this disease applies to.
|
|
87
|
+
* @minItems 1
|
|
88
|
+
*/
|
|
89
|
+
list: {
|
|
90
|
+
/**
|
|
91
|
+
* The animal type's identifier.
|
|
92
|
+
* @integer
|
|
93
|
+
* @minimum 1
|
|
94
|
+
*/
|
|
95
|
+
id: number;
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
98
|
+
communicability_to_intelligent_creatures: {
|
|
99
|
+
tag: "NonCommunicable";
|
|
100
|
+
} | {
|
|
101
|
+
tag: "Communicable";
|
|
102
|
+
/**
|
|
103
|
+
* What causes the communication? The GM rolls 1D20 to see if a character
|
|
104
|
+
* gets infected. If the infection check succeeds, the GM makes a disease
|
|
105
|
+
* check to determine the severity of the infection.
|
|
106
|
+
* @minItems 1
|
|
107
|
+
*/
|
|
108
|
+
cause: {
|
|
109
|
+
/**
|
|
110
|
+
* The chance to get infected by this cause, in percent.
|
|
111
|
+
* @integer
|
|
112
|
+
* @minimum 5
|
|
113
|
+
* @multipleOf 5
|
|
114
|
+
* @maximum 100
|
|
115
|
+
*/
|
|
116
|
+
chance?: number;
|
|
117
|
+
/**
|
|
118
|
+
* All translations for the entry, identified by IETF language tag
|
|
119
|
+
* (BCP47).
|
|
120
|
+
* @minProperties 1
|
|
121
|
+
*/
|
|
122
|
+
translations: {
|
|
123
|
+
/**
|
|
124
|
+
* @patternProperties ^[a-z]{2}-[A-Z]{2}$
|
|
125
|
+
*/
|
|
126
|
+
[localeId: string]: {
|
|
127
|
+
/**
|
|
128
|
+
* The name of the cause.
|
|
129
|
+
* @minLength 1
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* The chance to get infected by this cause. If present for this
|
|
134
|
+
* language, this overrides the universal `chance` field; they
|
|
135
|
+
* cannot be used at the same time.
|
|
136
|
+
* @minLength 1
|
|
137
|
+
*/
|
|
138
|
+
chance?: string;
|
|
139
|
+
/**
|
|
140
|
+
* An additional note about this communication cause.
|
|
141
|
+
* @minLength 1
|
|
142
|
+
*/
|
|
143
|
+
note?: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
src: PublicationRefs;
|
|
149
|
+
/**
|
|
150
|
+
* All translations for the entry, identified by IETF language tag (BCP47).
|
|
151
|
+
* @minProperties 1
|
|
152
|
+
*/
|
|
153
|
+
translations: {
|
|
154
|
+
/**
|
|
155
|
+
* @patternProperties ^[a-z]{2}-[A-Z]{2}$
|
|
156
|
+
*/
|
|
157
|
+
[localeId: string]: {
|
|
158
|
+
/**
|
|
159
|
+
* The name of the animal disease.
|
|
160
|
+
* @minLength 1
|
|
161
|
+
*/
|
|
162
|
+
name: string;
|
|
163
|
+
/**
|
|
164
|
+
* A list of alternative names.
|
|
165
|
+
* @minItems 1
|
|
166
|
+
*/
|
|
167
|
+
alternative_names?: {
|
|
168
|
+
/**
|
|
169
|
+
* An alternative name of the animal disease.
|
|
170
|
+
* @minLength 1
|
|
171
|
+
*/
|
|
172
|
+
name: string;
|
|
173
|
+
/**
|
|
174
|
+
* The region where this alternative name is used.
|
|
175
|
+
* @minLength 1
|
|
176
|
+
*/
|
|
177
|
+
region?: string;
|
|
178
|
+
}[];
|
|
179
|
+
/**
|
|
180
|
+
* The disease’s progress, in detail.
|
|
181
|
+
* @markdown
|
|
182
|
+
* @minLength 1
|
|
183
|
+
*/
|
|
184
|
+
progress: string;
|
|
185
|
+
/**
|
|
186
|
+
* After infection, how much time passes before symptoms appear?
|
|
187
|
+
* @minLength 1
|
|
188
|
+
*/
|
|
189
|
+
incubation_time: string;
|
|
190
|
+
/**
|
|
191
|
+
* The damage caused by the disease. If the disease check fails, apply the
|
|
192
|
+
* lessened effects.
|
|
193
|
+
*/
|
|
194
|
+
damage: {
|
|
195
|
+
/**
|
|
196
|
+
* The disease’s default damage. In the source, it's the text before the
|
|
197
|
+
* slash.
|
|
198
|
+
* @markdown
|
|
199
|
+
* @minLength 1
|
|
200
|
+
*/
|
|
201
|
+
default: string;
|
|
202
|
+
/**
|
|
203
|
+
* The disease’s lessened damage. In the source, it's the text after the
|
|
204
|
+
* slash.
|
|
205
|
+
* @markdown
|
|
206
|
+
* @minLength 1
|
|
207
|
+
*/
|
|
208
|
+
lessened?: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The duration of the disease. If the disease check fails, use the
|
|
212
|
+
* lessened duration.
|
|
213
|
+
*/
|
|
214
|
+
duration: {
|
|
215
|
+
/**
|
|
216
|
+
* The default duration of the disease. In the source, it's the text
|
|
217
|
+
* before the slash.
|
|
218
|
+
* @markdown
|
|
219
|
+
* @minLength 1
|
|
220
|
+
*/
|
|
221
|
+
default: string;
|
|
222
|
+
/**
|
|
223
|
+
* The lessened duration of the disease. In the source, it's the text
|
|
224
|
+
* after the slash.
|
|
225
|
+
* @markdown
|
|
226
|
+
* @minLength 1
|
|
227
|
+
*/
|
|
228
|
+
lessened?: string;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Special information about the disease.
|
|
232
|
+
* @markdown
|
|
233
|
+
* @minLength 1
|
|
234
|
+
*/
|
|
235
|
+
special?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Methods known to lessen the disease’s progress or relieve symptoms.
|
|
238
|
+
* @markdown
|
|
239
|
+
* @minLength 1
|
|
240
|
+
*/
|
|
241
|
+
treatment: string;
|
|
242
|
+
/**
|
|
243
|
+
* Known remedies for the disease.
|
|
244
|
+
* @markdown
|
|
245
|
+
* @minLength 1
|
|
246
|
+
*/
|
|
247
|
+
cure: string;
|
|
248
|
+
errata?: Errata;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
export declare const validateSchema: import("../validation/schema.js").TypeValidator<AnimalDisease>;
|
|
File without changes
|
|
File without changes
|