optolith-database-schema 0.4.1 → 0.5.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/lib/config.d.ts +2 -0
  3. package/lib/config.js +2 -0
  4. package/lib/main.d.ts +6 -3
  5. package/lib/main.js +55 -28
  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 +21 -22
  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/CombatStyleSpecialAbility.d.ts +2 -1
  58. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +2 -1
  59. package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +2 -1
  60. package/lib/types/specialAbility/MagicalTradition.d.ts +2 -3
  61. package/lib/types/specialAbility/PactGift.d.ts +1 -1
  62. package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +2 -1
  63. package/lib/types/specialAbility/sub/_LanguageScript.d.ts +2 -4
  64. package/lib/validation/schema.d.ts +5 -2
  65. package/lib/validation/schema.js +8 -6
  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 +5 -181
  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 +1284 -1049
  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/CombatStyleSpecialAbility.schema.json +511 -1
  112. package/schema/specialAbility/LiturgicalStyleSpecialAbility.schema.json +511 -1
  113. package/schema/specialAbility/MagicStyleSpecialAbility.schema.json +511 -1
  114. package/schema/specialAbility/MagicalTradition.schema.json +1 -2
  115. package/schema/specialAbility/PactGift.schema.json +1 -1
  116. package/schema/specialAbility/SkillStyleSpecialAbility.schema.json +511 -1
  117. package/schema/specialAbility/sub/_LanguageScript.schema.json +1 -3
  118. package/schema/_CommonnessRatedAdvantageDisadvantage.schema.json +0 -22
@@ -1,4 +1,4 @@
1
- import { ActivatableIdentifier, RequirableSelectOptionIdentifier } from "../../_Identifier.js";
1
+ import { ActivatableIdentifier, RequirableSelectOptionIdentifier } from "../../_IdentifierGroup.js";
2
2
  import { Preconditions } from "../ConditionalPrerequisites.js";
3
3
  import { DisplayOption } from "../DisplayOption.js";
4
4
  /**
@@ -29,64 +29,3 @@ export declare type ActivatablePrerequisite = {
29
29
  display_option?: DisplayOption;
30
30
  when?: Preconditions;
31
31
  };
32
- /**
33
- * Requires a specific advantage, disadvantage or special ability from a given
34
- * set of entries.
35
- * @title Activatable Set Prerequisite
36
- */
37
- export declare type ActivatableSetPrerequisite = {
38
- /**
39
- * The possible activatable entries' identifiers.
40
- * @minItems 2
41
- */
42
- id: ActivatableIdentifier[];
43
- /**
44
- * If the required entry should be required to be active or inactive.
45
- */
46
- active: boolean;
47
- /**
48
- * The required minimum level of the entry.
49
- * @integer
50
- * @minimum 1
51
- */
52
- level?: number;
53
- /**
54
- * Required select options. Order is important. Typically, you only need the
55
- * first array index, though.
56
- * @minItems 1
57
- */
58
- options?: RequirableSelectOptionIdentifier[];
59
- display_option?: DisplayOption;
60
- };
61
- /**
62
- * Requires one option from a set of options from a specific advantage,
63
- * disadvantage or special ability.
64
- * @title Activatable Option Set Prerequisite
65
- */
66
- export declare type ActivatableOptionSetPrerequisite = {
67
- /**
68
- * The activatable entry's identifier.
69
- */
70
- id: ActivatableIdentifier;
71
- /**
72
- * If the required entry should be required to be active or inactive.
73
- */
74
- active: boolean;
75
- /**
76
- * The required minimum level of the entry.
77
- * @integer
78
- * @minimum 1
79
- */
80
- level?: number;
81
- /**
82
- * The possible set of first options.
83
- * @minItems 2
84
- */
85
- first_option: RequirableSelectOptionIdentifier[];
86
- /**
87
- * Required other select options. Order is important.
88
- * @minItems 1
89
- */
90
- other_options?: RequirableSelectOptionIdentifier[];
91
- display_option?: DisplayOption;
92
- };
@@ -1,3 +1,4 @@
1
+ import { AnimistPowerIdentifier } from "../../_Identifier.js";
1
2
  import { DisplayOption } from "../DisplayOption.js";
2
3
  /**
3
4
  * Requires a specific animist power to be on a minimum value.
@@ -6,10 +7,8 @@ import { DisplayOption } from "../DisplayOption.js";
6
7
  export declare type AnimistPowerPrerequisite = {
7
8
  /**
8
9
  * The animist power's identifier.
9
- * @integer
10
- * @minimum 1
11
10
  */
12
- id: number;
11
+ id: AnimistPowerIdentifier;
13
12
  /**
14
13
  * The level to which the minimum value applies.
15
14
  * @integer
@@ -1,10 +1,13 @@
1
- import { OneOrManyNumericIdentifiers } from "../../_Identifier.js";
1
+ import { CultureIdentifier } from "../../_Identifier.js";
2
2
  import { DisplayOption } from "../DisplayOption.js";
3
3
  /**
4
4
  * Requires a specific culture or one of a specific set of cultures.
5
5
  * @title Culture Prerequisite
6
6
  */
7
7
  export declare type CulturePrerequisite = {
8
- id: OneOrManyNumericIdentifiers;
8
+ /**
9
+ * The culture's identifier.
10
+ */
11
+ id: CultureIdentifier;
9
12
  display_option?: DisplayOption;
10
13
  };
@@ -1,4 +1,4 @@
1
- import { SkillWithEnhancementsIdentifier } from "../../_Identifier.js";
1
+ import { SkillWithEnhancementsIdentifier } from "../../_IdentifierGroup.js";
2
2
  import { DisplayOption } from "../DisplayOption.js";
3
3
  /**
4
4
  * Requires a specific enhancement from a skill. This should **not** be used
@@ -1,3 +1,4 @@
1
+ import { InfluenceIdentifier } from "../../_Identifier.js";
1
2
  import { DisplayOption } from "../DisplayOption.js";
2
3
  /**
3
4
  * @title Influence Prerequisite
@@ -5,10 +6,8 @@ import { DisplayOption } from "../DisplayOption.js";
5
6
  export declare type InfluencePrerequisite = {
6
7
  /**
7
8
  * The influence's identifier.
8
- * @integer
9
- * @minimum 1
10
9
  */
11
- id: number;
10
+ id: InfluenceIdentifier;
12
11
  /**
13
12
  * If the referenced influence must or must not be chosen.
14
13
  */
@@ -1,4 +1,4 @@
1
- import { OneOrManyNumericIdentifiers } from "../../_Identifier.js";
1
+ import { RaceIdentifier } from "../../_Identifier.js";
2
2
  import { DisplayOption } from "../DisplayOption.js";
3
3
  /**
4
4
  * Requires a specific race or one of a specific set of races. You can also
@@ -7,7 +7,10 @@ import { DisplayOption } from "../DisplayOption.js";
7
7
  * @title Race Prerequisite
8
8
  */
9
9
  export declare type RacePrerequisite = {
10
- id: OneOrManyNumericIdentifiers;
10
+ /**
11
+ * The race's identifier.
12
+ */
13
+ id: RaceIdentifier;
11
14
  active: boolean;
12
15
  display_option?: DisplayOption;
13
16
  };
@@ -1,4 +1,4 @@
1
- import { RatedIdentifier } from "../../_Identifier.js";
1
+ import { RatedIdentifier } from "../../_IdentifierGroup.js";
2
2
  import { AspectReference, PropertyReference, SkillReference } from "../../_SimpleReferences.js";
3
3
  import { DisplayOption } from "../DisplayOption.js";
4
4
  /**
@@ -17,23 +17,6 @@ export declare type RatedPrerequisite = {
17
17
  value: number;
18
18
  display_option?: DisplayOption;
19
19
  };
20
- /**
21
- * @title Rated Set Prerequisite
22
- */
23
- export declare type RatedSetPrerequisite = {
24
- /**
25
- * The possible rated entries' identifiers.
26
- * @minItems 2
27
- */
28
- id: RatedIdentifier[];
29
- /**
30
- * The required minimum value.
31
- * @integer
32
- * @minimum 0
33
- */
34
- value: number;
35
- display_option?: DisplayOption;
36
- };
37
20
  /**
38
21
  * @title Rated Minimum Number Prerequisite
39
22
  */
@@ -1,4 +1,4 @@
1
- import { ExtensionRuleIdentifier } from "../../_Identifier.js";
1
+ import { ExtensionRuleIdentifier } from "../../_IdentifierGroup.js";
2
2
  import { DisplayOption } from "../DisplayOption.js";
3
3
  /**
4
4
  * @title Rule Prerequisite
@@ -1,3 +1,4 @@
1
+ import { SocialStatusIdentifier } from "../../_Identifier.js";
1
2
  import { DisplayOption } from "../DisplayOption.js";
2
3
  /**
3
4
  * Requires a minimum social status.
@@ -6,10 +7,7 @@ import { DisplayOption } from "../DisplayOption.js";
6
7
  export declare type SocialStatusPrerequisite = {
7
8
  /**
8
9
  * The minimum social status' identifier.
9
- * @integer
10
- * @minimum 2
11
- * @maximum 5
12
10
  */
13
- id: number;
11
+ id: SocialStatusIdentifier;
14
12
  display_option?: DisplayOption;
15
13
  };
@@ -1,10 +1,10 @@
1
- import { OneOrManyNumericIdentifiers } from "../../_Identifier.js";
1
+ import { StateIdentifier } from "../../_Identifier.js";
2
2
  import { DisplayOption } from "../DisplayOption.js";
3
3
  /**
4
4
  * Requires a specific state or one of a specific set of states.
5
5
  * @title State Prerequisite
6
6
  */
7
7
  export declare type StatePrerequisite = {
8
- id: OneOrManyNumericIdentifiers;
8
+ id: StateIdentifier;
9
9
  display_option?: DisplayOption;
10
10
  };
@@ -3,7 +3,8 @@
3
3
  */
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
- import { CoreRuleDerivableContentIdentifier } from "../_Identifier.js";
6
+ import { CoreRuleIdentifier } from "../_Identifier.js";
7
+ import { CoreRuleDerivableContentIdentifier } from "../_IdentifierGroup.js";
7
8
  import { LocaleMap } from "../_LocaleMap.js";
8
9
  import { NonEmptyMarkdown, NonEmptyString } from "../_NonEmptyString.js";
9
10
  /**
@@ -12,10 +13,8 @@ import { NonEmptyMarkdown, NonEmptyString } from "../_NonEmptyString.js";
12
13
  export declare type CoreRule = {
13
14
  /**
14
15
  * The core rule's identifier. An unique, increasing integer.
15
- * @integer
16
- * @minimum 1
17
16
  */
18
- id: number;
17
+ id: CoreRuleIdentifier;
19
18
  /**
20
19
  * @minItems 1
21
20
  */
@@ -56,10 +55,8 @@ export declare type ContentNode = {
56
55
  export declare type ChildNode = {
57
56
  /**
58
57
  * The nested core rule's identifier.
59
- * @integer
60
- * @minimum 1
61
58
  */
62
- id: number;
59
+ id: CoreRuleIdentifier;
63
60
  /**
64
61
  * If the nested core rule's content should be integrated into this core rule
65
62
  * and a proper heading should be added. Otherwise create a link to a separate
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @main PublicationRefs
3
3
  */
4
+ import { PublicationIdentifier } from "../_Identifier.js";
4
5
  import { LocaleMap } from "../_LocaleMap.js";
5
6
  /**
6
7
  * The publications where you can find the entry.
@@ -17,10 +18,8 @@ export declare type PublicationRefs = PublicationRef[];
17
18
  export declare type PublicationRef = {
18
19
  /**
19
20
  * The publication's identifier.
20
- * @integer
21
- * @minimum 1
22
21
  */
23
- id: number;
22
+ id: PublicationIdentifier;
24
23
  /**
25
24
  * All occurrences of the entry, identified by IETF language tag (BCP47).
26
25
  */
@@ -70,7 +70,7 @@ export declare type RestrictedBlessings = {
70
70
  three: ThreeRestrictedBlessings;
71
71
  } | {
72
72
  tag: "Six";
73
- three: SixRestrictedBlessings;
73
+ six: SixRestrictedBlessings;
74
74
  };
75
75
  /**
76
76
  * @uniqueItems
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
+ import { AdvancedCombatSpecialAbilityIdentifier } from "../_Identifier.js";
7
8
  import { LocaleMap } from "../_LocaleMap.js";
8
9
  import { GeneralPrerequisites } from "../_Prerequisite.js";
9
10
  /**
@@ -21,7 +22,7 @@ export declare type CombatStyleSpecialAbility = {
21
22
  skill_applications?: Activatable.SkillApplications;
22
23
  skill_uses?: Activatable.SkillUses;
23
24
  maximum?: Activatable.Maximum;
24
- advanced: Activatable.AdvancedSpecialAbilities;
25
+ advanced: Activatable.AdvancedSpecialAbilities<AdvancedCombatSpecialAbilityIdentifier>;
25
26
  prerequisites?: GeneralPrerequisites;
26
27
  combat_techniques: Activatable.ApplicableCombatTechniques;
27
28
  ap_value: Activatable.AdventurePointsValue;
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
+ import { AdvancedKarmaSpecialAbilityIdentifier } from "../_Identifier.js";
7
8
  import { LocaleMap } from "../_LocaleMap.js";
8
9
  import { GeneralPrerequisites } from "../_Prerequisite.js";
9
10
  /**
@@ -16,7 +17,7 @@ export declare type LiturgicalStyleSpecialAbility = {
16
17
  skill_applications?: Activatable.SkillApplications;
17
18
  skill_uses?: Activatable.SkillUses;
18
19
  maximum?: Activatable.Maximum;
19
- advanced: Activatable.AdvancedSpecialAbilities;
20
+ advanced: Activatable.AdvancedSpecialAbilities<AdvancedKarmaSpecialAbilityIdentifier>;
20
21
  prerequisites?: GeneralPrerequisites;
21
22
  ap_value: Activatable.AdventurePointsValue;
22
23
  src: PublicationRefs;
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
+ import { AdvancedMagicalSpecialAbilityIdentifier } from "../_Identifier.js";
7
8
  import { LocaleMap } from "../_LocaleMap.js";
8
9
  import { GeneralPrerequisites } from "../_Prerequisite.js";
9
10
  /**
@@ -16,7 +17,7 @@ export declare type MagicStyleSpecialAbility = {
16
17
  skill_applications?: Activatable.SkillApplications;
17
18
  skill_uses?: Activatable.SkillUses;
18
19
  maximum?: Activatable.Maximum;
19
- advanced: Activatable.AdvancedSpecialAbilities;
20
+ advanced: Activatable.AdvancedSpecialAbilities<AdvancedMagicalSpecialAbilityIdentifier>;
20
21
  prerequisites?: GeneralPrerequisites;
21
22
  ap_value: Activatable.AdventurePointsValue;
22
23
  src: PublicationRefs;
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
+ import { AttributeIdentifier } from "../_Identifier.js";
7
8
  import { Influence } from "../_Influence.js";
8
9
  import { LocaleMap } from "../_LocaleMap.js";
9
10
  import { GeneralPrerequisites } from "../_Prerequisite.js";
@@ -83,10 +84,8 @@ export declare type MagicalTradition = {
83
84
  export declare type PrimaryAttribute = {
84
85
  /**
85
86
  * The attribute's identifier.
86
- * @integer
87
- * @minimum 1
88
87
  */
89
- id: number;
88
+ id: AttributeIdentifier;
90
89
  /**
91
90
  * Typically, the value of the primary attribute (if one exists) is added
92
91
  * onto the base of 20 AE to get the actual AE. But sometimes, only half the
@@ -4,7 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
- import { ActivatableIdentifier } from "../_Identifier.js";
7
+ import { ActivatableIdentifier } from "../_IdentifierGroup.js";
8
8
  import { LocaleMap } from "../_LocaleMap.js";
9
9
  import { GeneralPrerequisites } from "../_Prerequisite.js";
10
10
  /**
@@ -4,6 +4,7 @@
4
4
  import { Errata } from "../source/_Erratum.js";
5
5
  import { PublicationRefs } from "../source/_PublicationRef.js";
6
6
  import * as Activatable from "../_Activatable.js";
7
+ import { AdvancedSkillSpecialAbilityIdentifier } from "../_Identifier.js";
7
8
  import { LocaleMap } from "../_LocaleMap.js";
8
9
  import { GeneralPrerequisites } from "../_Prerequisite.js";
9
10
  /**
@@ -14,7 +15,7 @@ export declare type SkillStyleSpecialAbility = {
14
15
  levels?: Activatable.Levels;
15
16
  select_options?: Activatable.SelectOptions;
16
17
  maximum?: Activatable.Maximum;
17
- advanced: Activatable.AdvancedSpecialAbilities;
18
+ advanced: Activatable.AdvancedSpecialAbilities<AdvancedSkillSpecialAbilityIdentifier>;
18
19
  prerequisites?: GeneralPrerequisites;
19
20
  ap_value: Activatable.AdventurePointsValue;
20
21
  src: PublicationRefs;
@@ -1,11 +1,9 @@
1
+ import { ContinentIdentifier } from "../../_Identifier.js";
1
2
  export declare type AssociatedContinent = {
2
3
  /**
3
4
  * The continent's identifier.
4
- * @integer
5
- * @minimum 1
6
- * @maximum 3
7
5
  */
8
- id: number;
6
+ id: ContinentIdentifier;
9
7
  /**
10
8
  * Is the language considered virtually extinct in this continent?
11
9
  */
@@ -4,13 +4,16 @@ export declare type FileNameError = {
4
4
  instancePath: string;
5
5
  message: string;
6
6
  };
7
- export declare type TypeValidationError = DefinedError | FileNameError;
8
7
  export declare type TypeValidationResult<T> = {
9
8
  tag: "Ok";
10
9
  value: T;
11
10
  } | {
12
11
  tag: "Error";
13
- errors: TypeValidationError[];
12
+ errors: TypeValidationResultErrors;
13
+ };
14
+ export declare type TypeValidationResultErrors = {
15
+ fileNameError?: FileNameError;
16
+ schemaErrors: DefinedError[];
14
17
  };
15
18
  export declare type TypeValidator<T> = (validator: Ajv, data: unknown, filePath: string) => TypeValidationResult<T>;
16
19
  export declare type TypeValidatorOptions = {
@@ -6,7 +6,7 @@ const fileNameError = (fileName) => ({
6
6
  instancePath: "",
7
7
  message: `the file name "${fileName}" does not match the pattern ^[1-9][0-9]*_[A-Z][a-z]*(?:-[a-zA-Z][a-z]*)\\.yml$`
8
8
  });
9
- const baseNamePattern = /^[1-9][0-9]*_[A-Z][a-z]*(?:-[a-zA-Z][a-z]*)\.yml$/;
9
+ const baseNamePattern = /^[1-9][0-9]*_[A-Z][a-z]*(?:-[a-zA-Z][a-z]*)*\.yml$/;
10
10
  const changeFileExtension = (path, ext) => join(dirname(path), basename(path, extname(path)) + ext);
11
11
  const schemaIdFromSourcePath = (sourcePath) => {
12
12
  const relativePathOfType = relative(libDir, fileURLToPath(sourcePath));
@@ -22,11 +22,13 @@ export const validateSchemaCreator = (importMetaUrl, { ignoreFileNamePattern = f
22
22
  return { tag: "Ok", value: data };
23
23
  }
24
24
  else {
25
- const errors = [
26
- ...(validator.errors ?? []),
27
- ...(!correctFileName ? [fileNameError(fileName)] : [])
28
- ];
29
- return { tag: "Error", errors };
25
+ return {
26
+ tag: "Error",
27
+ errors: {
28
+ fileNameError: correctFileName ? undefined : fileNameError(fileName),
29
+ schemaErrors: validator.errors ?? [],
30
+ }
31
+ };
30
32
  }
31
33
  };
32
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optolith-database-schema",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "Definitions and utilities for the flat-file database of Optolith, a character creation tool for the Pen and Paper RPG “The Dark Eye 5”, and its external integrations into other software.",
5
5
  "keywords": [
6
6
  "tde",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^18.0.0",
31
- "optolith-tsjsonschemamd": "^0.5.16",
31
+ "optolith-tsjsonschemamd": "^0.5.19",
32
32
  "standard-version": "^9.5.0",
33
33
  "typescript": "^4.7.4"
34
34
  },
@@ -169,8 +169,7 @@
169
169
  "properties": {
170
170
  "id": {
171
171
  "description": "The magical tradition's identifier.",
172
- "type": "integer",
173
- "minimum": 1
172
+ "$ref": "./_Identifier.schema.json#/$defs/MagicalTraditionIdentifier"
174
173
  },
175
174
  "translations": {
176
175
  "description": "All translations for the entry, identified by IETF language tag (BCP47).",
@@ -48,7 +48,18 @@
48
48
  "description": "A list of common advantages.",
49
49
  "type": "array",
50
50
  "items": {
51
- "$ref": "./_CommonnessRatedAdvantageDisadvantage.schema.json#/$defs/CommonnessRatedAdvantageDisadvantage"
51
+ "title": "Commonness-rated Advantage/Disadvantage",
52
+ "description": "Reference to a commonness-rated advantage or disadvantage. Commonness-rating terms used in the source books are strongly recommended, common, uncommon, suggested and unsuitable.",
53
+ "type": "object",
54
+ "properties": {
55
+ "id": {
56
+ "$ref": "./_Identifier.schema.json#/$defs/AdvantageIdentifier"
57
+ }
58
+ },
59
+ "required": [
60
+ "id"
61
+ ],
62
+ "additionalProperties": false
52
63
  },
53
64
  "minItems": 1
54
65
  },
@@ -56,7 +67,18 @@
56
67
  "description": "A list of common disadvantages.",
57
68
  "type": "array",
58
69
  "items": {
59
- "$ref": "./_CommonnessRatedAdvantageDisadvantage.schema.json#/$defs/CommonnessRatedAdvantageDisadvantage"
70
+ "title": "Commonness-rated Advantage/Disadvantage",
71
+ "description": "Reference to a commonness-rated advantage or disadvantage. Commonness-rating terms used in the source books are strongly recommended, common, uncommon, suggested and unsuitable.",
72
+ "type": "object",
73
+ "properties": {
74
+ "id": {
75
+ "$ref": "./_Identifier.schema.json#/$defs/DisadvantageIdentifier"
76
+ }
77
+ },
78
+ "required": [
79
+ "id"
80
+ ],
81
+ "additionalProperties": false
60
82
  },
61
83
  "minItems": 1
62
84
  },
@@ -64,7 +86,18 @@
64
86
  "description": "A list of uncommon advantages.",
65
87
  "type": "array",
66
88
  "items": {
67
- "$ref": "./_CommonnessRatedAdvantageDisadvantage.schema.json#/$defs/CommonnessRatedAdvantageDisadvantage"
89
+ "title": "Commonness-rated Advantage/Disadvantage",
90
+ "description": "Reference to a commonness-rated advantage or disadvantage. Commonness-rating terms used in the source books are strongly recommended, common, uncommon, suggested and unsuitable.",
91
+ "type": "object",
92
+ "properties": {
93
+ "id": {
94
+ "$ref": "./_Identifier.schema.json#/$defs/AdvantageIdentifier"
95
+ }
96
+ },
97
+ "required": [
98
+ "id"
99
+ ],
100
+ "additionalProperties": false
68
101
  },
69
102
  "minItems": 1
70
103
  },
@@ -72,7 +105,18 @@
72
105
  "description": "A list of uncommon disadvantages.",
73
106
  "type": "array",
74
107
  "items": {
75
- "$ref": "./_CommonnessRatedAdvantageDisadvantage.schema.json#/$defs/CommonnessRatedAdvantageDisadvantage"
108
+ "title": "Commonness-rated Advantage/Disadvantage",
109
+ "description": "Reference to a commonness-rated advantage or disadvantage. Commonness-rating terms used in the source books are strongly recommended, common, uncommon, suggested and unsuitable.",
110
+ "type": "object",
111
+ "properties": {
112
+ "id": {
113
+ "$ref": "./_Identifier.schema.json#/$defs/DisadvantageIdentifier"
114
+ }
115
+ },
116
+ "required": [
117
+ "id"
118
+ ],
119
+ "additionalProperties": false
76
120
  },
77
121
  "minItems": 1
78
122
  },
@@ -168,8 +212,7 @@
168
212
  "properties": {
169
213
  "id": {
170
214
  "description": "The profession's identifier.",
171
- "type": "integer",
172
- "minimum": 1
215
+ "$ref": "./_Identifier.schema.json#/$defs/ProfessionIdentifier"
173
216
  },
174
217
  "weighted_variants": {
175
218
  "description": "Some professions or profession variants are more common than others. There\nmay be cultures where some professions or profession variants are not\nrepresented at all.",
@@ -217,8 +260,7 @@
217
260
  "properties": {
218
261
  "id": {
219
262
  "description": "The magical tradition's identifier.",
220
- "type": "integer",
221
- "minimum": 1
263
+ "$ref": "./_Identifier.schema.json#/$defs/MagicalTraditionIdentifier"
222
264
  },
223
265
  "weighted_professions": {
224
266
  "description": "Some professions or profession variants are more common than others. There\nmay be cultures where some professions or profession variants are not\nrepresented at all.",
@@ -510,8 +552,7 @@
510
552
  "properties": {
511
553
  "id": {
512
554
  "description": "The skill's identifier.",
513
- "type": "integer",
514
- "minimum": 1
555
+ "$ref": "./_Identifier.schema.json#/$defs/SkillIdentifier"
515
556
  },
516
557
  "points": {
517
558
  "description": "The skill points for the respective skill you get for buying the cultural\npackage.",
@@ -129,7 +129,7 @@
129
129
  "type": "object",
130
130
  "properties": {
131
131
  "id": {
132
- "$ref": "./_Identifier.schema.json#/$defs/SpellworkIdentifier"
132
+ "$ref": "./_IdentifierGroup.schema.json#/$defs/SpellworkIdentifier"
133
133
  },
134
134
  "restriction": {
135
135
  "description": "The elective spellwork may only take effect if a certain condition is met.\nThe condition may be related to professions or profession variants, but it\nis designed so that it can work without a specific profession, as multiple\nmay belong to an institute, but with referencing other entities instead.",
@@ -150,9 +150,7 @@
150
150
  },
151
151
  "id": {
152
152
  "description": "The element's identifier.",
153
- "type": "integer",
154
- "maximum": 6,
155
- "minimum": 1
153
+ "$ref": "./_Identifier.schema.json#/$defs/ElementIdentifier"
156
154
  }
157
155
  },
158
156
  "required": [
@@ -195,7 +193,7 @@
195
193
  "const": "Spellwork"
196
194
  },
197
195
  "spellwork": {
198
- "$ref": "./_Identifier.schema.json#/$defs/SpellworkIdentifier"
196
+ "$ref": "./_IdentifierGroup.schema.json#/$defs/SpellworkIdentifier"
199
197
  }
200
198
  },
201
199
  "required": [
@@ -268,14 +266,13 @@
268
266
  "properties": {
269
267
  "id": {
270
268
  "description": "The identifier of the property that spellworks are disallowed from.",
271
- "type": "integer",
272
- "minimum": 1
269
+ "$ref": "./_Identifier.schema.json#/$defs/PropertyIdentifier"
273
270
  },
274
271
  "exclude": {
275
272
  "description": "Exclude specific spellworks from the restriction.",
276
273
  "type": "array",
277
274
  "items": {
278
- "$ref": "./_Identifier.schema.json#/$defs/SpellworkIdentifier"
275
+ "$ref": "./_IdentifierGroup.schema.json#/$defs/SpellworkIdentifier"
279
276
  },
280
277
  "minItems": 1
281
278
  },
@@ -435,7 +432,7 @@
435
432
  "type": "object",
436
433
  "properties": {
437
434
  "id": {
438
- "$ref": "./_Identifier.schema.json#/$defs/CombatTechniqueIdentifier"
435
+ "$ref": "./_IdentifierGroup.schema.json#/$defs/CombatTechniqueIdentifier"
439
436
  },
440
437
  "points": {
441
438
  "description": "The combat technique points that will be added to the current combat\ntechnique rating.",
@@ -455,8 +452,7 @@
455
452
  "properties": {
456
453
  "id": {
457
454
  "description": "The skill's identifier.",
458
- "type": "integer",
459
- "minimum": 1
455
+ "$ref": "./_Identifier.schema.json#/$defs/SkillIdentifier"
460
456
  },
461
457
  "points": {
462
458
  "description": "The skill points that will be added to the current skill rating.",
@@ -475,7 +471,7 @@
475
471
  "type": "object",
476
472
  "properties": {
477
473
  "id": {
478
- "$ref": "./_Identifier.schema.json#/$defs/SpellworkIdentifier"
474
+ "$ref": "./_IdentifierGroup.schema.json#/$defs/SpellworkIdentifier"
479
475
  },
480
476
  "points": {
481
477
  "description": "The skill points that will be added to the current skill rating. If a\nspell gets to a skill rating of 0 because of this, it will be removed\ncompletely.",