optolith-database-schema 0.4.0 → 0.5.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 (119) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/config.d.ts +2 -0
  3. package/lib/config.js +2 -0
  4. package/lib/main.d.ts +1 -1
  5. package/lib/main.js +28 -19
  6. package/lib/types/Cantrip.d.ts +2 -3
  7. package/lib/types/Culture.d.ts +8 -11
  8. package/lib/types/Lessons_Curriculum.d.ts +5 -4
  9. package/lib/types/Lessons_Guideline.d.ts +1 -1
  10. package/lib/types/Patron.d.ts +28 -4
  11. package/lib/types/Profession.d.ts +7 -6
  12. package/lib/types/Race.d.ts +12 -14
  13. package/lib/types/TargetCategory.d.ts +2 -3
  14. package/lib/types/_Activatable.d.ts +22 -26
  15. package/lib/types/_ActivatableSelectOptionCategory.d.ts +1 -1
  16. package/lib/types/_ActivatableSkillCost.d.ts +28 -1
  17. package/lib/types/_ActivatableSkillDuration.d.ts +1 -1
  18. package/lib/types/_ActivatableSkillRange.d.ts +3 -0
  19. package/lib/types/_CommonnessRatedAdvantageDisadvantage.d.ts +2 -4
  20. package/lib/types/_DiseasePoison.d.ts +3 -3
  21. package/lib/types/_Identifier.d.ts +1175 -247
  22. package/lib/types/_Identifier.js +0 -228
  23. package/lib/types/_IdentifierGroup.d.ts +27 -0
  24. package/lib/types/_IdentifierGroup.js +1 -0
  25. package/lib/types/_Prerequisite.d.ts +38 -36
  26. package/lib/types/_ResponsiveText.d.ts +1 -1
  27. package/lib/types/_SimpleReferences.d.ts +50 -253
  28. package/lib/types/equipment/EquipmentPackage.d.ts +1 -1
  29. package/lib/types/equipment/item/Elixir.d.ts +75 -0
  30. package/lib/types/equipment/item/Elixir.js +5 -0
  31. package/lib/types/equipment/item/EquipmentOfBlessedOnes.d.ts +1 -1
  32. package/lib/types/equipment/item/Poison.d.ts +220 -47
  33. package/lib/types/equipment/item/Poison.js +10 -0
  34. package/lib/types/equipment/item/ToolOfTheTrade.d.ts +6 -2
  35. package/lib/types/equipment/item/_Herbary.d.ts +31 -0
  36. package/lib/types/equipment/item/_Herbary.js +22 -0
  37. package/lib/types/equipment/item/_MeleeWeapon.d.ts +2 -9
  38. package/lib/types/equipment/item/_RangedWeapon.d.ts +2 -3
  39. package/lib/types/magicalActions/AnimistPower.d.ts +0 -1
  40. package/lib/types/magicalActions/MagicalRune.d.ts +22 -3
  41. package/lib/types/magicalActions/_SkillReference.d.ts +3 -2
  42. package/lib/types/magicalActions/_SkillReference.js +5 -5
  43. package/lib/types/prerequisites/PrerequisiteGroups.d.ts +2 -20
  44. package/lib/types/prerequisites/single/ActivatablePrerequisite.d.ts +1 -62
  45. package/lib/types/prerequisites/single/AnimistPowerPrerequisite.d.ts +2 -3
  46. package/lib/types/prerequisites/single/CulturePrerequisite.d.ts +5 -2
  47. package/lib/types/prerequisites/single/EnhancementPrerequisite.d.ts +1 -1
  48. package/lib/types/prerequisites/single/InfluencePrerequisite.d.ts +2 -3
  49. package/lib/types/prerequisites/single/RacePrerequisite.d.ts +5 -2
  50. package/lib/types/prerequisites/single/RatedPrerequisite.d.ts +1 -18
  51. package/lib/types/prerequisites/single/RulePrerequisite.d.ts +1 -1
  52. package/lib/types/prerequisites/single/SocialStatusPrerequisite.d.ts +2 -4
  53. package/lib/types/prerequisites/single/StatePrerequisite.d.ts +2 -2
  54. package/lib/types/rule/CoreRule.d.ts +4 -7
  55. package/lib/types/source/_PublicationRef.d.ts +2 -3
  56. package/lib/types/specialAbility/BlessedTradition.d.ts +1 -1
  57. package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +1 -1
  58. package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +2 -1
  59. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +2 -1
  60. package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +2 -1
  61. package/lib/types/specialAbility/MagicalTradition.d.ts +2 -3
  62. package/lib/types/specialAbility/PactGift.d.ts +1 -1
  63. package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +2 -1
  64. package/lib/types/specialAbility/sub/_LanguageScript.d.ts +2 -4
  65. package/lib/validation/schema.js +1 -1
  66. package/package.json +2 -2
  67. package/schema/Cantrip.schema.json +1 -2
  68. package/schema/Culture.schema.json +51 -10
  69. package/schema/Lessons_Curriculum.schema.json +8 -12
  70. package/schema/Lessons_Guideline.schema.json +1 -1
  71. package/schema/Patron.schema.json +24 -6
  72. package/schema/Profession.schema.json +57 -15
  73. package/schema/Race.schema.json +121 -13
  74. package/schema/TargetCategory.schema.json +1 -2
  75. package/schema/_Activatable.schema.json +7 -183
  76. package/schema/_ActivatableSelectOptionCategory.schema.json +4 -4
  77. package/schema/_ActivatableSkillCost.schema.json +61 -0
  78. package/schema/_ActivatableSkillDuration.schema.json +1 -3
  79. package/schema/_ActivatableSkillRange.schema.json +19 -0
  80. package/schema/_DiseasePoison.schema.json +0 -2
  81. package/schema/_Identifier.schema.json +2099 -347
  82. package/schema/_IdentifierGroup.schema.json +601 -0
  83. package/schema/_Prerequisite.schema.json +1298 -1072
  84. package/schema/_ResponsiveText.schema.json +2 -2
  85. package/schema/_SimpleReferences.schema.json +54 -130
  86. package/schema/equipment/EquipmentPackage.schema.json +1 -1
  87. package/schema/equipment/item/Elixir.schema.json +123 -0
  88. package/schema/equipment/item/EquipmentOfBlessedOnes.schema.json +4 -1
  89. package/schema/equipment/item/Poison.schema.json +431 -68
  90. package/schema/equipment/item/ToolOfTheTrade.schema.json +15 -4
  91. package/schema/equipment/item/_Herbary.schema.json +42 -0
  92. package/schema/equipment/item/_MeleeWeapon.schema.json +1 -13
  93. package/schema/equipment/item/_RangedWeapon.schema.json +1 -2
  94. package/schema/magicalActions/AnimistPower.schema.json +0 -1
  95. package/schema/magicalActions/MagicalRune.schema.json +38 -3
  96. package/schema/magicalActions/_SkillReference.schema.json +15 -3
  97. package/schema/prerequisites/PrerequisiteGroups.schema.json +0 -96
  98. package/schema/prerequisites/single/ActivatablePrerequisite.schema.json +2 -87
  99. package/schema/prerequisites/single/AnimistPowerPrerequisite.schema.json +1 -2
  100. package/schema/prerequisites/single/CulturePrerequisite.schema.json +2 -1
  101. package/schema/prerequisites/single/EnhancementPrerequisite.schema.json +1 -1
  102. package/schema/prerequisites/single/InfluencePrerequisite.schema.json +1 -2
  103. package/schema/prerequisites/single/RacePrerequisite.schema.json +2 -1
  104. package/schema/prerequisites/single/RatedPrerequisite.schema.json +1 -28
  105. package/schema/prerequisites/single/RulePrerequisite.schema.json +1 -1
  106. package/schema/prerequisites/single/SocialStatusPrerequisite.schema.json +1 -3
  107. package/schema/prerequisites/single/StatePrerequisite.schema.json +1 -1
  108. package/schema/rule/CoreRule.schema.json +3 -5
  109. package/schema/source/_PublicationRef.schema.json +1 -2
  110. package/schema/specialAbility/BlessedTradition.schema.json +2 -2
  111. package/schema/specialAbility/CeremonialItemSpecialAbility.schema.json +0 -1
  112. package/schema/specialAbility/CombatStyleSpecialAbility.schema.json +511 -1
  113. package/schema/specialAbility/LiturgicalStyleSpecialAbility.schema.json +511 -1
  114. package/schema/specialAbility/MagicStyleSpecialAbility.schema.json +511 -1
  115. package/schema/specialAbility/MagicalTradition.schema.json +1 -2
  116. package/schema/specialAbility/PactGift.schema.json +1 -1
  117. package/schema/specialAbility/SkillStyleSpecialAbility.schema.json +511 -1
  118. package/schema/specialAbility/sub/_LanguageScript.schema.json +1 -3
  119. package/schema/_CommonnessRatedAdvantageDisadvantage.schema.json +0 -22
package/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
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.5.0](https://github.com/elyukai/optolith-database-schema/compare/v0.4.1...v0.5.0) (2022-12-01)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * explicit identifier tags, simpler prerequisites, multiple small changes
11
+
12
+ ### Features
13
+
14
+ * equipment of blessed ones may be for multiple traditions ([3ffbfa2](https://github.com/elyukai/optolith-database-schema/commit/3ffbfa20cd40279091c71e7ef22496f6eab0f501))
15
+ * explicit identifier tags, simpler prerequisites, multiple small changes ([89ab7dd](https://github.com/elyukai/optolith-database-schema/commit/89ab7dd343db1027672b24c63216aba44f2db855))
16
+ * poisons and elixirs ([2552156](https://github.com/elyukai/optolith-database-schema/commit/2552156860ec527b568621dffa9ad6ebef1ae3e3))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * import specifiers ([fddea8b](https://github.com/elyukai/optolith-database-schema/commit/fddea8bc62a6ab4ddfef0fcea082a73749152ad4))
22
+
23
+ ### [0.4.1](https://github.com/elyukai/optolith-database-schema/compare/v0.4.0...v0.4.1) (2022-08-01)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * not all ceremonial item special abilities have an aspect ([d99fc59](https://github.com/elyukai/optolith-database-schema/commit/d99fc59d786bef8951edd45db0a0c2d43c4a5ac3))
29
+ * require nested properties of enums with associated values ([ed8046e](https://github.com/elyukai/optolith-database-schema/commit/ed8046ea07acd5ae2b98bc901f688b4612d45ba6))
30
+
5
31
  ## [0.4.0](https://github.com/elyukai/optolith-database-schema/compare/v0.3.0...v0.4.0) (2022-08-01)
6
32
 
7
33
 
package/lib/config.d.ts CHANGED
@@ -28,6 +28,7 @@ import * as Book from "./types/equipment/item/Book.js";
28
28
  import * as CeremonialItem from "./types/equipment/item/CeremonialItem.js";
29
29
  import * as Clothes from "./types/equipment/item/Clothes.js";
30
30
  import * as Container from "./types/equipment/item/Container.js";
31
+ import * as Elixir from "./types/equipment/item/Elixir.js";
31
32
  import * as EquipmentOfBlessedOnes from "./types/equipment/item/EquipmentOfBlessedOnes.js";
32
33
  import * as GemOrPreciousStone from "./types/equipment/item/GemOrPreciousStone.js";
33
34
  import * as IlluminationLightSource from "./types/equipment/item/IlluminationLightSource.js";
@@ -206,6 +207,7 @@ export declare type TypeMap = {
206
207
  diseases: Disease.Disease;
207
208
  dominationRituals: DominationRitual.DominationRitual;
208
209
  elements: Element.Element;
210
+ elixirs: Elixir.Elixir;
209
211
  elvenMagicalSongs: ElvenMagicalSong.ElvenMagicalSong;
210
212
  equipmentOfBlessedOnes: EquipmentOfBlessedOnes.EquipmentOfBlessedOnes;
211
213
  equipmentPackages: EquipmentPackage.EquipmentPackage;
package/lib/config.js CHANGED
@@ -28,6 +28,7 @@ import * as Book from "./types/equipment/item/Book.js";
28
28
  import * as CeremonialItem from "./types/equipment/item/CeremonialItem.js";
29
29
  import * as Clothes from "./types/equipment/item/Clothes.js";
30
30
  import * as Container from "./types/equipment/item/Container.js";
31
+ import * as Elixir from "./types/equipment/item/Elixir.js";
31
32
  import * as EquipmentOfBlessedOnes from "./types/equipment/item/EquipmentOfBlessedOnes.js";
32
33
  import * as GemOrPreciousStone from "./types/equipment/item/GemOrPreciousStone.js";
33
34
  import * as IlluminationLightSource from "./types/equipment/item/IlluminationLightSource.js";
@@ -205,6 +206,7 @@ export const typeValidatorMap = {
205
206
  diseases: Disease.validateSchema,
206
207
  dominationRituals: DominationRitual.validateSchema,
207
208
  elements: Element.validateSchema,
209
+ elixirs: Elixir.validateSchema,
208
210
  elvenMagicalSongs: ElvenMagicalSong.validateSchema,
209
211
  equipmentOfBlessedOnes: EquipmentOfBlessedOnes.validateSchema,
210
212
  equipmentPackages: EquipmentPackage.validateSchema,
package/lib/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DefinedError } from "ajv/dist/2020.js";
1
+ import { DefinedError } from "ajv";
2
2
  import { TypeMap } from "./config.js";
3
3
  import { TypeValidationError } from "./validation/schema.js";
4
4
  declare type Result = {
package/lib/main.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import addFormats from "ajv-formats";
2
- import Ajv from "ajv/dist/2020.js";
2
+ import Ajv2019 from "ajv/dist/2019.js";
3
+ import Ajv2020 from "ajv/dist/2020.js";
3
4
  import { lstat, readdir, readFile } from "fs/promises";
4
5
  import { join } from "path";
5
6
  import YAML from "yaml";
@@ -21,28 +22,37 @@ const readdirRecursive = async (dirPath) => {
21
22
  }));
22
23
  return flattenedRecursivePaths.flat();
23
24
  };
24
- const registerAllJsonSchemaDocuments = async (validator) => {
25
+ const registerAllJsonSchemaDocuments = async (validatorOptions) => {
25
26
  const readFileAsUtf8 = (path) => readFile(path, "utf-8");
26
27
  const readFilesAsUtf8 = (paths) => Promise.all(paths.map(readFileAsUtf8));
27
28
  const parseJson = (json) => JSON.parse(json);
29
+ const schemes = (await readFilesAsUtf8(await readdirRecursive(jsonSchemaDir))).map(parseJson);
30
+ const META_SCHEMA_ID_2020_12 = "https://json-schema.org/draft/2020-12/schema";
31
+ const validator = schemes[0]?.$schema === META_SCHEMA_ID_2020_12
32
+ ? new Ajv2020(validatorOptions)
33
+ : new Ajv2019(validatorOptions);
28
34
  const registerSchemaInValidator = (jsonSchema) => { validator.addSchema(jsonSchema); };
29
- (await readFilesAsUtf8(await readdirRecursive(jsonSchemaDir)))
30
- .map(parseJson)
31
- .forEach(registerSchemaInValidator);
35
+ schemes.forEach(registerSchemaInValidator);
36
+ return validator;
32
37
  };
33
- const readDataFileAssocsFromDirectory = async (dirPath) => await Promise.all((await readdir(dirPath)).map(async (fileName) => {
34
- const filePath = join(dirPath, fileName);
35
- try {
36
- const fileContent = YAML.parse(await readFile(join(dirPath, fileName), "utf-8"));
37
- return [filePath, fileContent];
38
- }
39
- catch (error) {
40
- if (error instanceof Error) {
41
- error.message = `in "${filePath}":\n ${error.message}`;
38
+ const collator = Intl.Collator(undefined, { numeric: true });
39
+ const readDataFileAssocsFromDirectory = async (dirPath) => {
40
+ const filenames = await readdir(dirPath);
41
+ filenames.sort(collator.compare);
42
+ return await Promise.all(filenames.map(async (fileName) => {
43
+ const filePath = join(dirPath, fileName);
44
+ try {
45
+ const fileContent = YAML.parse(await readFile(join(dirPath, fileName), "utf-8"));
46
+ return [filePath, fileContent];
42
47
  }
43
- return [filePath, null];
44
- }
45
- }));
48
+ catch (error) {
49
+ if (error instanceof Error) {
50
+ error.message = `in "${filePath}":\n ${error.message}`;
51
+ }
52
+ return [filePath, null];
53
+ }
54
+ }));
55
+ };
46
56
  const validateAllFromType = async (validator, typeName, path) => {
47
57
  const isFile = (await lstat(path)).isFile();
48
58
  const typeValidator = typeValidatorMap[typeName];
@@ -89,9 +99,8 @@ const rawResultMapToResult = (rawResultMap) => Object.entries(rawResultMap).redu
89
99
  value: {}
90
100
  }));
91
101
  export const validate = async (entityDirPaths, checkIntegrity) => {
92
- const validator = new Ajv({ allErrors: true });
102
+ const validator = await registerAllJsonSchemaDocuments({});
93
103
  addFormats(validator);
94
- await registerAllJsonSchemaDocuments(validator);
95
104
  const rawResultMap = Object.fromEntries((await Promise.all(Object.entries(entityDirPaths)
96
105
  .map(async ([typeName, path]) => [
97
106
  typeName,
@@ -8,6 +8,7 @@ import { DurationUnit } from "./_ActivatableSkillDuration.js";
8
8
  import { FixedRange } from "./_ActivatableSkillRange.js";
9
9
  import { TargetCategory } from "./_ActivatableSkillTargetCategory.js";
10
10
  import { Enhancements } from "./_Enhancements.js";
11
+ import { MagicalTraditionIdentifier } from "./_Identifier.js";
11
12
  import { LocaleMap } from "./_LocaleMap.js";
12
13
  import { ResponsiveText } from "./_ResponsiveText.js";
13
14
  import { CurriculumReference, MagicalTraditionReference, PropertyReference } from "./_SimpleReferences.js";
@@ -80,10 +81,8 @@ export declare type CommonCantripNote = {
80
81
  export declare type CommonCantripTraditionNote = {
81
82
  /**
82
83
  * The magical tradition's identifier.
83
- * @integer
84
- * @minimum 1
85
84
  */
86
- id: number;
85
+ id: MagicalTraditionIdentifier;
87
86
  /**
88
87
  * All translations for the entry, identified by IETF language tag (BCP47).
89
88
  */
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "./source/_Erratum.js";
5
5
  import { PublicationRefs } from "./source/_PublicationRef.js";
6
6
  import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
7
+ import { AdvantageIdentifier, DisadvantageIdentifier, MagicalTraditionIdentifier, ProfessionIdentifier, SkillIdentifier } from "./_Identifier.js";
7
8
  import { LocaleMap } from "./_LocaleMap.js";
8
9
  import { NonEmptyString } from "./_NonEmptyString.js";
9
10
  import { BinarySex } from "./_Sex.js";
@@ -49,22 +50,22 @@ export declare type Culture = {
49
50
  * A list of common advantages.
50
51
  * @minItems 1
51
52
  */
52
- common_advantages?: CommonnessRatedAdvantageDisadvantage[];
53
+ common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
53
54
  /**
54
55
  * A list of common disadvantages.
55
56
  * @minItems 1
56
57
  */
57
- common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
58
+ common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
58
59
  /**
59
60
  * A list of uncommon advantages.
60
61
  * @minItems 1
61
62
  */
62
- uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
63
+ uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
63
64
  /**
64
65
  * A list of uncommon disadvantages.
65
66
  * @minItems 1
66
67
  */
67
- uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
68
+ uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
68
69
  /**
69
70
  * A list of common skills.
70
71
  * @minItems 1
@@ -161,10 +162,8 @@ export declare enum Rarity {
161
162
  export declare type ProfessionConstraint = {
162
163
  /**
163
164
  * The profession's identifier.
164
- * @integer
165
- * @minimum 1
166
165
  */
167
- id: number;
166
+ id: ProfessionIdentifier;
168
167
  /**
169
168
  * Some profession variants are more common than others. There may be
170
169
  * cultures where some variants are not represented at all.
@@ -187,10 +186,8 @@ export declare enum MundaneProfessionSubgroupConstraint {
187
186
  export declare type TraditionConstraint = {
188
187
  /**
189
188
  * The magical tradition's identifier.
190
- * @integer
191
- * @minimum 1
192
189
  */
193
- id: number;
190
+ id: MagicalTraditionIdentifier;
194
191
  /**
195
192
  * Some professions are more common than others. There may be cultures
196
193
  * where some professions are not represented at all.
@@ -252,7 +249,7 @@ export declare type CulturalPackageItem = {
252
249
  * @integer
253
250
  * @minimum 1
254
251
  */
255
- id: number;
252
+ id: SkillIdentifier;
256
253
  /**
257
254
  * The skill points for the respective skill you get for buying the cultural
258
255
  * package.
@@ -3,7 +3,8 @@
3
3
  */
4
4
  import { Errata } from "./source/_Erratum.js";
5
5
  import { PublicationRefs } from "./source/_PublicationRef.js";
6
- import { CombatTechniqueIdentifier, MagicalTraditionIdentifier, SpellworkIdentifier } from "./_Identifier.js";
6
+ import { ElementIdentifier, MagicalTraditionIdentifier, PropertyIdentifier, SkillIdentifier } from "./_Identifier.js";
7
+ import { CombatTechniqueIdentifier, SpellworkIdentifier } from "./_IdentifierGroup.js";
7
8
  import { LocaleMap } from "./_LocaleMap.js";
8
9
  import { NonEmptyString } from "./_NonEmptyString.js";
9
10
  import { GuidelineReference } from "./_SimpleReferences.js";
@@ -89,7 +90,7 @@ export declare type ElectiveSpellworkRestriction = {
89
90
  * @minimum 1
90
91
  * @maximum 6
91
92
  */
92
- id: number;
93
+ id: ElementIdentifier;
93
94
  };
94
95
  /**
95
96
  * The academy's restricted spellworks package.
@@ -121,7 +122,7 @@ export declare type RestrictedProperty = {
121
122
  * @integer
122
123
  * @minimum 1
123
124
  */
124
- id: number;
125
+ id: PropertyIdentifier;
125
126
  /**
126
127
  * Exclude specific spellworks from the restriction.
127
128
  * @minItems 1
@@ -207,7 +208,7 @@ export declare type SkillAdjustment = {
207
208
  * @integer
208
209
  * @minimum 1
209
210
  */
210
- id: number;
211
+ id: SkillIdentifier;
211
212
  /**
212
213
  * The skill points that will be added to the current skill rating.
213
214
  * @integer
@@ -8,7 +8,7 @@ import { NonEmptyString } from "./_NonEmptyString.js";
8
8
  */
9
9
  export declare type Guideline = {
10
10
  /**
11
- * The region's identifier. An unique, increasing integer.
11
+ * The guideline's identifier. An unique, increasing integer.
12
12
  * @integer
13
13
  * @minimum 1
14
14
  */
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @main Patron
3
3
  */
4
+ import { AdvantageIdentifier, AttributeIdentifier, SkillIdentifier } from "./_Identifier.js";
4
5
  import { ImprovementCost } from "./_ImprovementCost.js";
5
6
  import { LocaleMap } from "./_LocaleMap.js";
6
7
  import { NonEmptyString } from "./_NonEmptyString.js";
7
- import { CultureReference, PatronCategoryReference, SkillReference } from "./_SimpleReferences.js";
8
+ import { AdvantageReference, CultureReference, DisadvantageReference, PatronCategoryReference, SkillReference, SpellworkReference } from "./_SimpleReferences.js";
8
9
  /**
9
10
  * @title Patron
10
11
  */
@@ -54,6 +55,29 @@ export declare type Patron = {
54
55
  * animal patrons.
55
56
  */
56
57
  improvement_cost?: ImprovementCost;
58
+ /**
59
+ * The patron may grant common advantages that are taken into account during
60
+ * character creation.
61
+ *
62
+ * *Source:* Geisterwald & Knochenklippen, p. 6-7
63
+ * @minLength 1
64
+ */
65
+ common_advantages?: AdvantageReference[];
66
+ /**
67
+ * The patron may grant common disadvantages that are taken into account
68
+ * during character creation.
69
+ *
70
+ * *Source:* Geisterwald & Knochenklippen, p. 6-7
71
+ * @minLength 1
72
+ */
73
+ common_disadvantages?: DisadvantageReference[];
74
+ /**
75
+ * The animist may learn spellworks common for this patron.
76
+ *
77
+ * *Source:* Geisterwald & Knochenklippen, p. 6-7
78
+ * @minLength 1
79
+ */
80
+ common_spellworks?: SpellworkReference[];
57
81
  /**
58
82
  * All translations for the entry, identified by IETF language tag (BCP47).
59
83
  */
@@ -90,7 +114,7 @@ export declare type AdvantageAnimalPower = {
90
114
  * @integer
91
115
  * @minimum 1
92
116
  */
93
- id: number;
117
+ id: AdvantageIdentifier;
94
118
  /**
95
119
  * It grants a higher level of the advantage.
96
120
  * @integer
@@ -110,7 +134,7 @@ export declare type SkillAnimalPower = {
110
134
  * @integer
111
135
  * @minimum 1
112
136
  */
113
- id: number;
137
+ id: SkillIdentifier;
114
138
  /**
115
139
  * The points that gets added to the skill's rating.
116
140
  * @integer
@@ -163,7 +187,7 @@ export declare type AttributeAnimalPower = {
163
187
  * @integer
164
188
  * @minimum 1
165
189
  */
166
- id: number;
190
+ id: AttributeIdentifier;
167
191
  /**
168
192
  * The value that gets added to the attribute.
169
193
  * @integer
@@ -4,7 +4,8 @@
4
4
  import { Errata } from "./source/_Erratum.js";
5
5
  import { PublicationRefs } from "./source/_PublicationRef.js";
6
6
  import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
7
- import { CombatTechniqueIdentifier, LiturgyIdentifier, MagicalActionIdentifier, RequirableSelectOptionIdentifier, SpecialAbilityIdentifier, SpellworkIdentifier } from "./_Identifier.js";
7
+ import { AdvantageIdentifier, DisadvantageIdentifier, SkillIdentifier } from "./_Identifier.js";
8
+ import { CombatTechniqueIdentifier, LiturgyIdentifier, MagicalActionIdentifier, RequirableSelectOptionIdentifier, SpecialAbilityIdentifier, SpellworkIdentifier } from "./_IdentifierGroup.js";
8
9
  import { LocaleMap } from "./_LocaleMap.js";
9
10
  import { NonEmptyString } from "./_NonEmptyString.js";
10
11
  import { ProfessionPrerequisites } from "./_Prerequisite.js";
@@ -158,24 +159,24 @@ export declare type ProfessionPackage = {
158
159
  * Typical advantages for the profession.
159
160
  * @minItems 1
160
161
  */
161
- suggested_advantages?: CommonnessRatedAdvantageDisadvantage[];
162
+ suggested_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
162
163
  /**
163
164
  * Typical disadvantages for the profession.
164
165
  * @minItems 1
165
166
  */
166
- suggested_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
167
+ suggested_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
167
168
  /**
168
169
  * These advantages do not fit well with this profession; to be checked with
169
170
  * the GM before taking any of them.
170
171
  * @minItems 1
171
172
  */
172
- unsuitable_advantages?: CommonnessRatedAdvantageDisadvantage[];
173
+ unsuitable_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
173
174
  /**
174
175
  * These disadvantages do not fit well with this profession; to be checked
175
176
  * with the GM before taking any of them.
176
177
  * @minItems 1
177
178
  */
178
- unsuitable_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
179
+ unsuitable_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
179
180
  /**
180
181
  * Provides examples of variants for the profession, which may include changes
181
182
  * to AP values and additional or modified skill ratings, special abilities,
@@ -375,7 +376,7 @@ export declare type SkillRating = {
375
376
  * @minimum 1
376
377
  * @maximum 59
377
378
  */
378
- id: number;
379
+ id: SkillIdentifier;
379
380
  /**
380
381
  * The rating bonus provided for the skill. If used in a profession variant,
381
382
  * it can also be used to lower the bonus of the base profession
@@ -5,6 +5,7 @@ import { Errata } from "./source/_Erratum.js";
5
5
  import { PublicationRefs } from "./source/_PublicationRef.js";
6
6
  import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
7
7
  import { Dice } from "./_Dice.js";
8
+ import { AdvantageIdentifier, DisadvantageIdentifier, ExperienceLevelIdentifier } from "./_Identifier.js";
8
9
  import { LocaleMap } from "./_LocaleMap.js";
9
10
  import { NonEmptyString } from "./_NonEmptyString.js";
10
11
  import { AdvantageReference, AttributeReference, CultureReference, EyeColorReference, HairColorReference } from "./_SimpleReferences.js";
@@ -45,40 +46,40 @@ export declare type Race = {
45
46
  * A list of strongly recommended advantages.
46
47
  * @minItems 1
47
48
  */
48
- strongly_recommended_advantages?: CommonnessRatedAdvantageDisadvantage[];
49
+ strongly_recommended_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
49
50
  /**
50
51
  * A list of strongly recommended disadvantages.
51
52
  * @minItems 1
52
53
  */
53
- strongly_recommended_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
54
+ strongly_recommended_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
54
55
  /**
55
56
  * A list of common advantages. If common advantages are defined by race
56
57
  * variants, leave this field empty. It is overridden by the same field in
57
58
  * race variants.
58
59
  * @minItems 1
59
60
  */
60
- common_advantages?: CommonnessRatedAdvantageDisadvantage[];
61
+ common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
61
62
  /**
62
63
  * A list of common disadvantages. If common disadvantages are defined by race
63
64
  * variants, leave this field empty. It is overridden by the same field in
64
65
  * race variants.
65
66
  * @minItems 1
66
67
  */
67
- common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
68
+ common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
68
69
  /**
69
70
  * A list of uncommon advantages. If uncommon advantages are defined by race
70
71
  * variants, leave this field empty. It is overridden by the same field in
71
72
  * race variants.
72
73
  * @minItems 1
73
74
  */
74
- uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
75
+ uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
75
76
  /**
76
77
  * A list of uncommon disadvantages. If uncommon disadvantages are defined by
77
78
  * race variants, leave this field empty. It is overridden by the same field
78
79
  * in race variants.
79
80
  * @minItems 1
80
81
  */
81
- uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
82
+ uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
82
83
  /**
83
84
  * Configuration for random weight generation.
84
85
  */
@@ -193,11 +194,8 @@ export declare enum WeightDiceOffsetStrategy {
193
194
  export declare type StartingAgeConfigForExperienceLevel = {
194
195
  /**
195
196
  * The selected experience level's identifier.
196
- * @integer
197
- * @minimum 1
198
- * @maximum 7
199
197
  */
200
- experience_level_id: number;
198
+ experience_level_id: ExperienceLevelIdentifier;
201
199
  /**
202
200
  * The base value for the selected experience level.
203
201
  * @integer
@@ -271,22 +269,22 @@ export declare type RaceVariant = {
271
269
  * A list of common advantages. If common advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
272
270
  * @minItems 1
273
271
  */
274
- common_advantages?: CommonnessRatedAdvantageDisadvantage[];
272
+ common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
275
273
  /**
276
274
  * A list of common disadvantages. If common disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
277
275
  * @minItems 1
278
276
  */
279
- common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
277
+ common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
280
278
  /**
281
279
  * A list of uncommon advantages. If uncommon advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
282
280
  * @minItems 1
283
281
  */
284
- uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
282
+ uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
285
283
  /**
286
284
  * A list of uncommon disadvantages. If uncommon disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
287
285
  * @minItems 1
288
286
  */
289
- uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
287
+ uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
290
288
  /**
291
289
  * An array containing 20 (numeric) hair color identifiers. The array also represents the 20-sided die for a random hair color.
292
290
  * @minItems 20
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @main TargetCategory
3
3
  */
4
+ import { TargetCategoryIdentifier } from "./_Identifier.js";
4
5
  import { LocaleMap } from "./_LocaleMap.js";
5
6
  import { NonEmptyString } from "./_NonEmptyString.js";
6
7
  /**
@@ -28,10 +29,8 @@ export declare type TargetCategory = {
28
29
  export declare type TargetCategoryParent = {
29
30
  /**
30
31
  * The identifier of the superordinate target category.
31
- * @integer
32
- * @minimum 1
33
32
  */
34
- id: number;
33
+ id: TargetCategoryIdentifier;
35
34
  };
36
35
  export declare type TargetCategoryTranslation = {
37
36
  /**
@@ -7,7 +7,8 @@ import { Errata } from "./source/_Erratum.js";
7
7
  import { PublicationRefs } from "./source/_PublicationRef.js";
8
8
  import { SelectOptionCategory, SkillApplicationOrUse } from "./_ActivatableSelectOptionCategory.js";
9
9
  import { DurationUnitValue } from "./_ActivatableSkillDuration.js";
10
- import { AdvancedSpecialAbilityRestrictedOptionIdentifier, CombatRelatedSpecialAbilityIdentifier, CombatTechniqueIdentifier, MagicalTraditionIdentifier, PatronIdentifier, VolumePointsOptionReferenceIdentifier } from "./_Identifier.js";
10
+ import { MagicalTraditionIdentifier, PatronIdentifier, SkillIdentifier } from "./_Identifier.js";
11
+ import { AdvancedSpecialAbilityRestrictedOptionIdentifier, CombatRelatedSpecialAbilityIdentifier, CombatTechniqueIdentifier, VolumePointsOptionReferenceIdentifier } from "./_IdentifierGroup.js";
11
12
  import { LocaleMap } from "./_LocaleMap.js";
12
13
  import { NonEmptyMarkdown, NonEmptyString } from "./_NonEmptyString.js";
13
14
  import { GeneralPrerequisites } from "./_Prerequisite.js";
@@ -162,7 +163,7 @@ export declare type ExplicitSkillSelectOption = {
162
163
  * @integer
163
164
  * @minimum 1
164
165
  */
165
- id: number;
166
+ id: SkillIdentifier;
166
167
  /**
167
168
  * Registers new applications, which get enabled once this entry is
168
169
  * activated with its respective select option. It specifies an entry-unique
@@ -540,7 +541,7 @@ export declare type ArcaneEnergyCost = {
540
541
  disjunction: ArcaneEnergyCostDisjunction;
541
542
  } | {
542
543
  tag: "None";
543
- none?: NoArcaneEnergyCost;
544
+ none: NoArcaneEnergyCost;
544
545
  } | {
545
546
  tag: "Variable";
546
547
  variable: {};
@@ -723,9 +724,6 @@ export declare type ArcaneEnergyCostDisjunctionOptionTranslation = {
723
724
  */
724
725
  note?: ResponsiveTextOptional;
725
726
  };
726
- /**
727
- * @minProperties 1
728
- */
729
727
  export declare type NoArcaneEnergyCost = {
730
728
  /**
731
729
  * All translations for the entry, identified by IETF language tag
@@ -1029,26 +1027,24 @@ export declare type Aspect = AspectReference;
1029
1027
  /**
1030
1028
  * A reference to an advanced special ability.
1031
1029
  */
1032
- export declare type AdvancedSpecialAbility = {
1030
+ export declare type AdvancedSpecialAbility<Identifier> = {
1033
1031
  tag: "General";
1034
- general: AdvancedSpecialAbilityReference;
1032
+ general: AdvancedSpecialAbilityReference<Identifier>;
1035
1033
  } | {
1036
1034
  tag: "RestrictOptions";
1037
- restrict_options: RestrictAdvancedSpecialAbilityOptions;
1035
+ restrict_options: RestrictAdvancedSpecialAbilityOptions<Identifier>;
1038
1036
  } | {
1039
1037
  tag: "OneOf";
1040
- one_of: OneOfAdvancedSpecialAbilityOptions;
1038
+ one_of: OneOfAdvancedSpecialAbilityOptions<Identifier>;
1041
1039
  } | {
1042
1040
  tag: "DeriveFromExternalOption";
1043
- derive_from_external_option: AdvancedSpecialAbilityDerivedFromExternalOption;
1041
+ derive_from_external_option: AdvancedSpecialAbilityDerivedFromExternalOption<Identifier>;
1044
1042
  };
1045
- export declare type RestrictAdvancedSpecialAbilityOptions = {
1043
+ export declare type RestrictAdvancedSpecialAbilityOptions<Identifier> = {
1046
1044
  /**
1047
- * The advanced special ability's numeric identifier.
1048
- * @integer
1049
- * @minimum 1
1045
+ * The advanced special abilitys identifier.
1050
1046
  */
1051
- id: number;
1047
+ id: Identifier;
1052
1048
  /**
1053
1049
  * Specify the select option(s) that only are allowed for the referenced
1054
1050
  * advanced special ability; others are disallowed.
@@ -1056,11 +1052,11 @@ export declare type RestrictAdvancedSpecialAbilityOptions = {
1056
1052
  */
1057
1053
  option: AdvancedSpecialAbilityRestrictedOptionIdentifier[];
1058
1054
  };
1059
- export declare type OneOfAdvancedSpecialAbilityOptions = {
1055
+ export declare type OneOfAdvancedSpecialAbilityOptions<Identifier> = {
1060
1056
  /**
1061
1057
  * The possible advanced special abilities.
1062
1058
  */
1063
- options: AdvancedSpecialAbilityReference;
1059
+ options: AdvancedSpecialAbilityReference<Identifier>;
1064
1060
  /**
1065
1061
  * Do have to choose the advanced special ability when buying the style
1066
1062
  * special ability? Otherwise the decision can be made later.
@@ -1068,7 +1064,7 @@ export declare type OneOfAdvancedSpecialAbilityOptions = {
1068
1064
  is_selection_required_on_purchase: boolean;
1069
1065
  display_option?: DisplayOption;
1070
1066
  };
1071
- export declare type AdvancedSpecialAbilityDerivedFromExternalOption = {
1067
+ export declare type AdvancedSpecialAbilityDerivedFromExternalOption<Identifier> = {
1072
1068
  /**
1073
1069
  * The possible advanced special abilities.
1074
1070
  */
@@ -1077,7 +1073,7 @@ export declare type AdvancedSpecialAbilityDerivedFromExternalOption = {
1077
1073
  * Map options from the external entry to allowed advanced special abilities.
1078
1074
  * @minItems 1
1079
1075
  */
1080
- map: AdvancedSpecialAbilityDerivedFromExternalOptionMapping[];
1076
+ map: AdvancedSpecialAbilityDerivedFromExternalOptionMapping<Identifier>[];
1081
1077
  display_option?: DisplayOption;
1082
1078
  };
1083
1079
  /**
@@ -1085,7 +1081,7 @@ export declare type AdvancedSpecialAbilityDerivedFromExternalOption = {
1085
1081
  * ability.
1086
1082
  * @minItems 1
1087
1083
  */
1088
- export declare type AdvancedSpecialAbilityDerivedFromExternalOptionMapping = {
1084
+ export declare type AdvancedSpecialAbilityDerivedFromExternalOptionMapping<Identifier> = {
1089
1085
  /**
1090
1086
  * The select option's identifier.
1091
1087
  */
@@ -1093,7 +1089,7 @@ export declare type AdvancedSpecialAbilityDerivedFromExternalOptionMapping = {
1093
1089
  /**
1094
1090
  * The advanced special ability's identifier.
1095
1091
  */
1096
- to_advanced: AdvancedSpecialAbilityReference;
1092
+ to_advanced: AdvancedSpecialAbilityReference<Identifier>;
1097
1093
  };
1098
1094
  export declare type AdvancedSpecialAbilityDerivedExternalEntryId = MagicalTraditionIdentifier;
1099
1095
  export declare type AdvancedSpecialAbilityDerivedExternalEntryOptionId = PatronIdentifier;
@@ -1104,10 +1100,10 @@ export declare type AdvancedSpecialAbilityDerivedExternalEntryOptionId = PatronI
1104
1100
  * be that you can choose from a set of special abilities, but then you can't
1105
1101
  * specify an option.
1106
1102
  */
1107
- export declare type AdvancedSpecialAbilities = [
1108
- AdvancedSpecialAbility,
1109
- AdvancedSpecialAbility,
1110
- AdvancedSpecialAbility
1103
+ export declare type AdvancedSpecialAbilities<Identifier> = [
1104
+ AdvancedSpecialAbility<Identifier>,
1105
+ AdvancedSpecialAbility<Identifier>,
1106
+ AdvancedSpecialAbility<Identifier>
1111
1107
  ];
1112
1108
  export declare type ApplicableCombatTechniques = {
1113
1109
  tag: "None";
@@ -1,4 +1,4 @@
1
- import { ActivatableIdentifier, CombatTechniqueIdentifier, SkillIdentifier } from "./_Identifier.js";
1
+ import { ActivatableIdentifier, CombatTechniqueIdentifier, SkillIdentifier } from "./_IdentifierGroup.js";
2
2
  import { LocaleMap } from "./_LocaleMap.js";
3
3
  import { CeremonyReference, CloseCombatTechniqueReference, ElementReference, LiturgicalChantReference, RangedCombatTechniqueReference, RitualReference, SkillGroupReference, SpellReference } from "./_SimpleReferences.js";
4
4
  export declare type SelectOptionCategory = {