@optolith/database-schema 0.91.0 → 0.93.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 (47) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/gen/types.d.ts +35 -34
  3. package/lib/cache/activatableSelectOptions.d.ts +1 -1
  4. package/lib/cache/activatableSelectOptions.js +39 -0
  5. package/lib/types/Advantage.d.ts +3 -0
  6. package/lib/types/Disadvantage.d.ts +3 -0
  7. package/lib/types/Profession.d.ts +252 -161
  8. package/lib/types/Profession.js +18 -21
  9. package/lib/types/Talisman.d.ts +1 -1
  10. package/lib/types/Talisman.js +1 -1
  11. package/lib/types/_ActivatableSelectOptionCategory.d.ts +3 -0
  12. package/lib/types/_ActivatableSelectOptionCategory.js +13 -1
  13. package/lib/types/_ActivatableSelectOptions.d.ts +6 -0
  14. package/lib/types/equipment/item/Poison.d.ts +0 -6
  15. package/lib/types/equipment/item/Poison.js +0 -6
  16. package/lib/types/equipment/item/Weapon.d.ts +2 -2
  17. package/lib/types/equipment/item/Weapon.js +2 -2
  18. package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +3 -0
  19. package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +3 -0
  20. package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +3 -0
  21. package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +3 -0
  22. package/lib/types/specialAbility/AncestorGlyph.d.ts +3 -0
  23. package/lib/types/specialAbility/BlessedTradition.d.ts +3 -0
  24. package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +3 -0
  25. package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +3 -0
  26. package/lib/types/specialAbility/CombatSpecialAbility.d.ts +3 -0
  27. package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +3 -0
  28. package/lib/types/specialAbility/CommandSpecialAbility.d.ts +3 -0
  29. package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +3 -0
  30. package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +3 -0
  31. package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +3 -0
  32. package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +3 -0
  33. package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +3 -0
  34. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +3 -0
  35. package/lib/types/specialAbility/LycantropicGift.d.ts +3 -0
  36. package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +3 -0
  37. package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +3 -0
  38. package/lib/types/specialAbility/MagicalTradition.d.ts +3 -0
  39. package/lib/types/specialAbility/PactGift.d.ts +3 -0
  40. package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +3 -0
  41. package/lib/types/specialAbility/Sermon.d.ts +3 -0
  42. package/lib/types/specialAbility/SexSpecialAbility.d.ts +3 -0
  43. package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +3 -0
  44. package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +3 -0
  45. package/lib/types/specialAbility/VampiricGift.d.ts +3 -0
  46. package/lib/types/specialAbility/Vision.d.ts +3 -0
  47. package/package.json +1 -1
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 [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.93.0](https://github.com/Optolith/database-schema/compare/v0.92.0...v0.93.0) (2026-10-11)
6
+
7
+ ### ⚠ BREAKING CHANGES
8
+
9
+ * allow text option for special abilities
10
+ * derived advantages select option category
11
+ * optional weapon cost and weight for improvised weapons
12
+ * remove demonic poison notes in favor of base poison notes
13
+
14
+ ### Features
15
+
16
+ * allow text option for special abilities ([ce81dc2](https://github.com/Optolith/database-schema/commit/ce81dc248ea62c8a08d9d631b50290b173ad3571)), closes [#200](https://github.com/Optolith/database-schema/issues/200)
17
+ * derived advantages select option category ([7e36546](https://github.com/Optolith/database-schema/commit/7e365469c4d7920528ac42a5418fa37c6406dd06)), closes [#82](https://github.com/Optolith/database-schema/issues/82)
18
+ * optional weapon cost and weight for improvised weapons ([8941125](https://github.com/Optolith/database-schema/commit/894112599982105b46fdbb9525cb0ad13e942f6f))
19
+ * remove demonic poison notes in favor of base poison notes ([e91b3dd](https://github.com/Optolith/database-schema/commit/e91b3ddddfd02722afa3a0affe0d49f262741dd7)), closes [#183](https://github.com/Optolith/database-schema/issues/183)
20
+
21
+ ## [0.92.0](https://github.com/Optolith/database-schema/compare/v0.91.0...v0.92.0) (2026-10-10)
22
+
23
+ ### ⚠ BREAKING CHANGES
24
+
25
+ * some talismans do not have a specified or existing tradition
26
+
27
+ ### Features
28
+
29
+ * some talismans do not have a specified or existing tradition ([faeacb1](https://github.com/Optolith/database-schema/commit/faeacb1e6d9adb083bb8560d64c7b58f72fbea77))
30
+
5
31
  ## [0.91.0](https://github.com/Optolith/database-schema/compare/v0.90.1...v0.91.0) (2026-10-10)
6
32
 
7
33
  ### ⚠ BREAKING CHANGES
package/gen/types.d.ts CHANGED
@@ -503,6 +503,7 @@ export type TypeAliasMap = {
503
503
  AdvancedSpecialAbilityDerivedFromExternalOptionMapping: AdvancedSpecialAbilityDerivedFromExternalOptionMapping<unknown>
504
504
  AdvantageAnimalPower: AdvantageAnimalPower
505
505
  AdvantageDisadvantagePrerequisites: AdvantageDisadvantagePrerequisites
506
+ AdvantagesSelectOptionCategory: AdvantagesSelectOptionCategory
506
507
  AdventurePointsDependingOnActive: AdventurePointsDependingOnActive
507
508
  AdventurePointsDependingOnActiveInstancesExpression: AdventurePointsDependingOnActiveInstancesExpression
508
509
  AdventurePointsDependingOnActiveInstancesExpressionExpression: AdventurePointsDependingOnActiveInstancesExpressionExpression
@@ -602,7 +603,6 @@ export type TypeAliasMap = {
602
603
  ConstantDemonicPoisonLevel: ConstantDemonicPoisonLevel
603
604
  ConstantIntoxicantAddictionInterval: ConstantIntoxicantAddictionInterval
604
605
  ConstantMagicalSignCost: ConstantMagicalSignCost
605
- ConstantProfessionSpecialAbility: ConstantProfessionSpecialAbility
606
606
  CostRange: CostRange
607
607
  CulturalPackageItem: CulturalPackageItem
608
608
  CultureLanguage: CultureLanguage
@@ -854,7 +854,7 @@ export type TypeAliasMap = {
854
854
  ProfessionPrerequisite: ProfessionPrerequisite
855
855
  ProfessionPrerequisites: ProfessionPrerequisites
856
856
  ProfessionSpecialAbilitySelection: ProfessionSpecialAbilitySelection
857
- ProfessionSpecialAbilitySelectionItem: ProfessionSpecialAbilitySelectionItem
857
+ ProfessionSpecialAbilityTextOption: ProfessionSpecialAbilityTextOption
858
858
  ProfessionSpellworkIdentifier: ProfessionSpellworkIdentifier
859
859
  ProfessionVariantPackageOptions: ProfessionVariantPackageOptions
860
860
  ProfessionVariantPrerequisites: ProfessionVariantPrerequisites
@@ -926,6 +926,7 @@ export type TypeAliasMap = {
926
926
  SingleMagicalRuneCost: SingleMagicalRuneCost
927
927
  SinglePenalty: SinglePenalty
928
928
  SinglePrimaryAttributeDamageThreshold: SinglePrimaryAttributeDamageThreshold
929
+ SingleProfessionSpecialAbility: SingleProfessionSpecialAbility
929
930
  SingleResistance: SingleResistance
930
931
  SkillAdjustment: SkillAdjustment
931
932
  SkillAnimalPower: SkillAnimalPower
@@ -1259,6 +1260,10 @@ export type SelectOptionCategory =
1259
1260
  kind: "TargetCategories"
1260
1261
  TargetCategories: TargetCategoriesSelectOptionCategory
1261
1262
  }
1263
+ | {
1264
+ kind: "Advantages"
1265
+ Advantages: AdvantagesSelectOptionCategory
1266
+ }
1262
1267
 
1263
1268
  export interface BlessedTraditionsSelectOptionCategory {
1264
1269
  /**
@@ -6345,20 +6350,6 @@ export interface DemonicPoison {
6345
6350
  * The poison’s level.
6346
6351
  */
6347
6352
  level: DemonicPoisonLevel
6348
-
6349
- /**
6350
- * All translations for the entry, identified by IETF language tag (BCP47).
6351
- */
6352
- translations?: {
6353
- [localeId: string]: DemonicPoisonTranslation
6354
- }
6355
- }
6356
-
6357
- export interface DemonicPoisonTranslation {
6358
- /**
6359
- * A note, if any.
6360
- */
6361
- note?: string
6362
6353
  }
6363
6354
 
6364
6355
  export type DemonicPoisonLevel =
@@ -12545,12 +12536,12 @@ export interface Weapon {
12545
12536
  /**
12546
12537
  * The cost in silverthalers.
12547
12538
  */
12548
- cost: Cost
12539
+ cost?: Cost
12549
12540
 
12550
12541
  /**
12551
12542
  * The weight in kg.
12552
12543
  */
12553
- weight: Weight
12544
+ weight?: Weight
12554
12545
 
12555
12546
  /**
12556
12547
  * The complexity of crafting the item.
@@ -18633,14 +18624,14 @@ export type VariantSpecialAbilityAction =
18633
18624
  export type ProfessionSpecialAbility =
18634
18625
  | {
18635
18626
  kind: "Constant"
18636
- Constant: ConstantProfessionSpecialAbility
18627
+ Constant: SingleProfessionSpecialAbility
18637
18628
  }
18638
18629
  | {
18639
18630
  kind: "Selection"
18640
18631
  Selection: ProfessionSpecialAbilitySelection
18641
18632
  }
18642
18633
 
18643
- export interface ConstantProfessionSpecialAbility {
18634
+ export interface SingleProfessionSpecialAbility {
18644
18635
  /**
18645
18636
  * The identifier of the special ability to grant.
18646
18637
  */
@@ -18884,32 +18875,35 @@ export type ProfessionSpecialAbilityOption =
18884
18875
  kind: "Identifier"
18885
18876
  Identifier: RequirableSelectOptionIdentifier
18886
18877
  }
18878
+ | {
18879
+ kind: "Text"
18880
+ Text: ProfessionSpecialAbilityTextOption
18881
+ }
18887
18882
  | {
18888
18883
  kind: "Select"
18889
18884
  }
18890
18885
 
18891
- export interface ProfessionSpecialAbilitySelection {
18886
+ export interface ProfessionSpecialAbilityTextOption {
18892
18887
  /**
18893
- * The list of special abilities to choose from. Must contain at least two entries.
18888
+ * All translations for the entry, identified by IETF language tag (BCP47).
18894
18889
  */
18895
- options: ProfessionSpecialAbilitySelectionItem[]
18890
+ translations: {
18891
+ [localeId: string]: ProfessionSpecialAbilityTextOptionTranslation
18892
+ }
18896
18893
  }
18897
18894
 
18898
- export interface ProfessionSpecialAbilitySelectionItem {
18895
+ export interface ProfessionSpecialAbilityTextOptionTranslation {
18899
18896
  /**
18900
- * The identifier of the special ability to grant.
18897
+ * The text of the option.
18901
18898
  */
18902
- id: ProfessionSpecialAbilityIdentifier
18903
-
18904
- /**
18905
- * The level of the received special ability. If not specified and the special ability has levels, level 1 is used automatically.
18906
- */
18907
- level?: number
18899
+ text: string
18900
+ }
18908
18901
 
18902
+ export interface ProfessionSpecialAbilitySelection {
18909
18903
  /**
18910
- * Received select options. Order is important. Typically, you only need the first array index, though.
18904
+ * The list of special abilities to choose from. Must contain at least two entries.
18911
18905
  */
18912
- options?: RequirableSelectOptionIdentifier[]
18906
+ options: SingleProfessionSpecialAbility[]
18913
18907
  }
18914
18908
 
18915
18909
  export interface CombatTechniqueRating {
@@ -23193,6 +23187,13 @@ export type AdvantageDisadvantagePrerequisiteGroup =
23193
23187
  PersonalityTrait: PersonalityTraitPrerequisite
23194
23188
  }
23195
23189
 
23190
+ export interface AdvantagesSelectOptionCategory {
23191
+ /**
23192
+ * A list of advantages of which the generated advantages must depend on at least one of them each.
23193
+ */
23194
+ dependingOn: Advantage_ID[]
23195
+ }
23196
+
23196
23197
  /**
23197
23198
  * Rules for how options can be selected and relate to each other. Defaults to a single predefined option if the entry has select options defined, otherwise undefined.
23198
23199
  */
@@ -27938,7 +27939,7 @@ export interface Talisman {
27938
27939
  /**
27939
27940
  * The tradition(s) the talisman belongs to.
27940
27941
  */
27941
- tradition: BlessedTradition_ID[]
27942
+ tradition?: BlessedTradition_ID[]
27942
27943
 
27943
27944
  /**
27944
27945
  * The talisman type, if any.
@@ -2,7 +2,7 @@ import { Case } from "tsondb/schema/gen";
2
2
  import type { ActivatableIdentifier as ActivatableIdentifierType, GeneralSelectOption, RequirableSelectOptionIdentifier, TradeSecretAdventurePointsValue } from "../../gen/types.js";
3
3
  import type { CacheBuilder } from "./internal.ts";
4
4
  import type { ResolvedNewSkillApplication, ResolvedSkillUse } from "./newApplicationsAndUses.ts";
5
- export type ResolvedSelectOptionIdentifier = RequirableSelectOptionIdentifier | Case<"Blessing" | "Cantrip" | "Script" | "Culture" | "SexPractice" | "HomunculusType" | "BlessedTradition" | "Disease" | "Poison" | "TargetCategory", string>;
5
+ export type ResolvedSelectOptionIdentifier = RequirableSelectOptionIdentifier | Case<"Blessing" | "Cantrip" | "Script" | "Culture" | "SexPractice" | "HomunculusType" | "BlessedTradition" | "Disease" | "Poison" | "TargetCategory" | "Advantage", string>;
6
6
  export type ResolvedSelectOption = {
7
7
  id: ResolvedSelectOptionIdentifier;
8
8
  content: Omit<GeneralSelectOption, "ap_value"> & {
@@ -733,6 +733,45 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database) => {
733
733
  .getAllInstanceContainersOfEntity("TargetCategory")
734
734
  .map(tc => mapToResolvedSelectOption(tc));
735
735
  }
736
+ case "Advantages": {
737
+ const mapToResolvedSelectOption = ({ id, content, }) => ({
738
+ id: Case("Advantage", id),
739
+ content: {
740
+ parent: entryId,
741
+ ap_value: content.ap_value,
742
+ translations: mapObject(content.translations, t10n => ({
743
+ name: t10n.name,
744
+ })),
745
+ },
746
+ newApplications: [],
747
+ uses: [],
748
+ });
749
+ const { dependingOn } = selectOptionCategory.Advantages;
750
+ const matchesDependingOn = (prereq) => prereq.kind === "Activatable" &&
751
+ prereq.Activatable.active &&
752
+ prereq.Activatable.id.kind === "Advantage" &&
753
+ dependingOn.includes(prereq.Activatable.id.Advantage);
754
+ return database
755
+ .getAllInstanceContainersOfEntity("Advantage")
756
+ .filter(({ content }) => content.ap_value.kind === "Fixed" &&
757
+ (content.prerequisites?.some(p => {
758
+ if (p.level !== 1) {
759
+ return false;
760
+ }
761
+ switch (p.prerequisite.kind) {
762
+ case "Disjunction":
763
+ return p.prerequisite.Disjunction.list.every(matchesDependingOn);
764
+ case "Group":
765
+ return p.prerequisite.Group.list.some(matchesDependingOn);
766
+ case "Single":
767
+ return matchesDependingOn(p.prerequisite.Single);
768
+ default:
769
+ return assertExhaustive(p.prerequisite);
770
+ }
771
+ }) ??
772
+ false))
773
+ .map(mapToResolvedSelectOption);
774
+ }
736
775
  default:
737
776
  return assertExhaustive(selectOptionCategory);
738
777
  }
@@ -850,6 +850,9 @@ export declare const Advantage: DB.Entity<"Advantage", {
850
850
  volume: DB.MemberDecl<DB.Integer, false>;
851
851
  }>, []>>>, true>;
852
852
  }>, []>>>;
853
+ Advantages: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"AdvantagesSelectOptionCategory", DB.Object<{
854
+ dependingOn: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, true>;
855
+ }>, []>>>;
853
856
  }, []>>, false>;
854
857
  rules: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRules", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRule", DB.Object<{
855
858
  value: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleValue", {
@@ -850,6 +850,9 @@ export declare const Disadvantage: DB.Entity<"Disadvantage", {
850
850
  volume: DB.MemberDecl<DB.Integer, false>;
851
851
  }>, []>>>, true>;
852
852
  }>, []>>>;
853
+ Advantages: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"AdvantagesSelectOptionCategory", DB.Object<{
854
+ dependingOn: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, true>;
855
+ }>, []>>>;
853
856
  }, []>>, false>;
854
857
  rules: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRules", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRule", DB.Object<{
855
858
  value: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleValue", {