optolith-database-schema 0.27.1 → 0.28.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
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.28.0](https://github.com/elyukai/optolith-database-schema/compare/v0.27.1...v0.28.0) (2026-02-01)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * remodel reversalis
11
+
12
+ ### Features
13
+
14
+ * remodel reversalis ([99d3bc4](https://github.com/elyukai/optolith-database-schema/commit/99d3bc425cac0693237860d0eedde790e60da0d3))
15
+
5
16
  ## [0.27.1](https://github.com/elyukai/optolith-database-schema/compare/v0.27.0...v0.27.1) (2026-02-01)
6
17
 
7
18
 
package/gen/types.d.ts CHANGED
@@ -740,6 +740,8 @@ export type TypeAliasMap = {
740
740
  RestrictedToMagicalTraditions: RestrictedToMagicalTraditions
741
741
  RestrictedToProfessions: RestrictedToProfessions
742
742
  RestrictedToRaces: RestrictedToRaces
743
+ Reversalis: Reversalis
744
+ ReversalisEffect: ReversalisEffect
743
745
  RulePrerequisite: RulePrerequisite
744
746
  RulePrerequisites: RulePrerequisites
745
747
  SecondaryArmor: SecondaryArmor
@@ -6968,11 +6970,6 @@ export interface Spell {
6968
6970
  */
6969
6971
  property: Property_ID
6970
6972
 
6971
- /**
6972
- * The associated property of the reversed spell.
6973
- */
6974
- propertyReversalis?: Property_ID
6975
-
6976
6973
  /**
6977
6974
  * The tradition(s) the spell is available for. It may be *generally* available to all traditions or it may be only familiar in specific traditions.
6978
6975
  */
@@ -6988,6 +6985,11 @@ export interface Spell {
6988
6985
  */
6989
6986
  prerequisites?: SpellworkPrerequisites
6990
6987
 
6988
+ /**
6989
+ * Possible effects of the reversed spell.
6990
+ */
6991
+ reversalis?: Reversalis
6992
+
6991
6993
  /**
6992
6994
  * References to where in which publications this entry has been defined. Entries may also be added or removed in later printings.
6993
6995
  */
@@ -7019,11 +7021,6 @@ export interface SpellTranslation {
7019
7021
  */
7020
7022
  effect: ActivatableSkillEffect
7021
7023
 
7022
- /**
7023
- * The effect of the reversed spell.
7024
- */
7025
- effectReversalis?: string
7026
-
7027
7024
  casting_time?: OldParameter
7028
7025
 
7029
7026
  cost?: OldParameter
@@ -7419,11 +7416,6 @@ export interface Ritual {
7419
7416
  */
7420
7417
  property: Property_ID
7421
7418
 
7422
- /**
7423
- * The associated property of the reversed spell.
7424
- */
7425
- propertyReversalis?: Property_ID
7426
-
7427
7419
  /**
7428
7420
  * The tradition(s) the ritual is available for. It may be *generally* available to all traditions or it may be only familiar in specific traditions.
7429
7421
  */
@@ -7439,6 +7431,11 @@ export interface Ritual {
7439
7431
  */
7440
7432
  prerequisites?: SpellworkPrerequisites
7441
7433
 
7434
+ /**
7435
+ * Possible effects of the reversed spell.
7436
+ */
7437
+ reversalis?: Reversalis
7438
+
7442
7439
  /**
7443
7440
  * References to where in which publications this entry has been defined. Entries may also be added or removed in later printings.
7444
7441
  */
@@ -7470,11 +7467,6 @@ export interface RitualTranslation {
7470
7467
  */
7471
7468
  effect: ActivatableSkillEffect
7472
7469
 
7473
- /**
7474
- * The effect of the reversed spell.
7475
- */
7476
- effectReversalis?: string
7477
-
7478
7470
  casting_time?: OldParameter
7479
7471
 
7480
7472
  cost?: OldParameter
@@ -7516,6 +7508,35 @@ export interface SlowSkillNonModifiableCastingTime {
7516
7508
 
7517
7509
  export type SlowSustainedPerformanceParameters = SustainedPerformanceParameters<SlowCastingTime>
7518
7510
 
7511
+ /**
7512
+ * Possible effects of the reversed spell.
7513
+ */
7514
+ export type Reversalis = ReversalisEffect[]
7515
+
7516
+ /**
7517
+ * A single possible effect of the reversed spell. A reversed spell can have a different property than the original spell.
7518
+ */
7519
+ export interface ReversalisEffect {
7520
+ /**
7521
+ * The associated property of the reversed spell.
7522
+ */
7523
+ property: Property_ID
7524
+
7525
+ /**
7526
+ * All translations for the entry, identified by IETF language tag (BCP47).
7527
+ */
7528
+ translations: {
7529
+ [localeId: string]: ReversalisEffectTranslation
7530
+ }
7531
+ }
7532
+
7533
+ export interface ReversalisEffectTranslation {
7534
+ /**
7535
+ * The effect description of the reversed spell.
7536
+ */
7537
+ effect: string
7538
+ }
7539
+
7519
7540
  export interface Ceremony {
7520
7541
  /**
7521
7542
  * Lists the linked three attributes used to make a skill check.
@@ -475,7 +475,6 @@ export declare const Ritual: Entity<"Ritual", {
475
475
  }>, false>;
476
476
  }>, []>>>, []>>, true>;
477
477
  property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
478
- propertyReversalis: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, false>;
479
478
  traditions: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").EnumDecl<"SpellworkTraditions", {
480
479
  General: import("tsondb/schema/def").EnumCaseDecl<null>;
481
480
  Specific: import("tsondb/schema/def").EnumCaseDecl<import("tsondb/schema/def").ArrayType<import("tsondb/schema/def").ReferenceIdentifierType>>;
@@ -510,6 +509,12 @@ export declare const Ritual: Entity<"Ritual", {
510
509
  }>, true>;
511
510
  }>, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>>;
512
511
  }, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>>, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>, []>>, false>;
512
+ reversalis: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"Reversalis", import("tsondb/schema/def").ArrayType<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"ReversalisEffect", Object<{
513
+ property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
514
+ translations: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<"ReversalisEffectTranslation", {
515
+ effect: import("tsondb/schema/def").MemberDecl<String, true>;
516
+ }>, true>;
517
+ }>, []>>>, []>>, false>;
513
518
  src: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"PublicationRefs", import("tsondb/schema/def").ArrayType<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"PublicationRef", Object<{
514
519
  id: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
515
520
  occurrences: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<string, {
@@ -567,7 +572,6 @@ export declare const Ritual: Entity<"Ritual", {
567
572
  text_after: import("tsondb/schema/def").MemberDecl<String, false>;
568
573
  }>, []>>>;
569
574
  }, []>>, true>;
570
- effectReversalis: import("tsondb/schema/def").MemberDecl<String, false>;
571
575
  casting_time: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"OldParameter", Object<{
572
576
  full: import("tsondb/schema/def").MemberDecl<String, true>;
573
577
  abbr: import("tsondb/schema/def").MemberDecl<String, true>;
@@ -7,7 +7,7 @@ import { PropertyIdentifier } from "./_Identifier.js";
7
7
  import { ImprovementCost } from "./_ImprovementCost.js";
8
8
  import { SpellworkPrerequisites } from "./_Prerequisite.js";
9
9
  import { SkillCheck, SkillCheckPenalty } from "./_SkillCheck.js";
10
- import { checkReversalis, ReversalisEffect, ReversalisProperty, SpellworkTraditions, } from "./_Spellwork.js";
10
+ import { reversalis, SpellworkTraditions } from "./_Spellwork.js";
11
11
  import { NestedTranslationMap } from "./Locale.js";
12
12
  import { Errata } from "./source/_Erratum.js";
13
13
  import { src } from "./source/_PublicationRef.js";
@@ -35,7 +35,6 @@ export const Ritual = Entity(import.meta.url, {
35
35
  comment: "The associated property.",
36
36
  type: PropertyIdentifier(),
37
37
  }),
38
- propertyReversalis: ReversalisProperty(),
39
38
  traditions: Required({
40
39
  comment: "The tradition(s) the ritual is available for. It may be *generally* available to all traditions or it may be only familiar in specific traditions.",
41
40
  type: IncludeIdentifier(SpellworkTraditions),
@@ -48,6 +47,7 @@ export const Ritual = Entity(import.meta.url, {
48
47
  comment: "The prerequisites for the ritual.",
49
48
  type: IncludeIdentifier(SpellworkPrerequisites),
50
49
  }),
50
+ reversalis,
51
51
  src,
52
52
  translations: NestedTranslationMap(Required, "Ritual", Object({
53
53
  name: Required({
@@ -58,7 +58,6 @@ export const Ritual = Entity(import.meta.url, {
58
58
  comment: "The effect description may be either a plain text or a text that is divided by a list of effects for each quality level. It may also be a list for each two quality levels.",
59
59
  type: IncludeIdentifier(ActivatableSkillEffect),
60
60
  }),
61
- effectReversalis: ReversalisEffect(),
62
61
  casting_time: Optional({
63
62
  isDeprecated: true,
64
63
  type: IncludeIdentifier(OldParameter),
@@ -94,5 +93,4 @@ export const Ritual = Entity(import.meta.url, {
94
93
  keyPathInEntityMap: "name",
95
94
  },
96
95
  ],
97
- customConstraints: ({ instanceContent }) => checkReversalis(instanceContent),
98
96
  });
@@ -475,7 +475,6 @@ export declare const Spell: Entity<"Spell", {
475
475
  }>, false>;
476
476
  }>, []>>>, []>>, true>;
477
477
  property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
478
- propertyReversalis: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, false>;
479
478
  traditions: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").EnumDecl<"SpellworkTraditions", {
480
479
  General: import("tsondb/schema/def").EnumCaseDecl<null>;
481
480
  Specific: import("tsondb/schema/def").EnumCaseDecl<import("tsondb/schema/def").ArrayType<import("tsondb/schema/def").ReferenceIdentifierType>>;
@@ -510,6 +509,12 @@ export declare const Spell: Entity<"Spell", {
510
509
  }>, true>;
511
510
  }>, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>>;
512
511
  }, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>>, [T: import("tsondb/schema/def").TypeParameter<"T", import("tsondb/schema/def").Type>]>>, []>>, false>;
512
+ reversalis: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"Reversalis", import("tsondb/schema/def").ArrayType<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"ReversalisEffect", Object<{
513
+ property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
514
+ translations: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<"ReversalisEffectTranslation", {
515
+ effect: import("tsondb/schema/def").MemberDecl<String, true>;
516
+ }>, true>;
517
+ }>, []>>>, []>>, false>;
513
518
  src: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"PublicationRefs", import("tsondb/schema/def").ArrayType<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"PublicationRef", Object<{
514
519
  id: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
515
520
  occurrences: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<string, {
@@ -567,7 +572,6 @@ export declare const Spell: Entity<"Spell", {
567
572
  text_after: import("tsondb/schema/def").MemberDecl<String, false>;
568
573
  }>, []>>>;
569
574
  }, []>>, true>;
570
- effectReversalis: import("tsondb/schema/def").MemberDecl<String, false>;
571
575
  casting_time: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], import("tsondb/schema/def").TypeAliasDecl<"OldParameter", Object<{
572
576
  full: import("tsondb/schema/def").MemberDecl<String, true>;
573
577
  abbr: import("tsondb/schema/def").MemberDecl<String, true>;
@@ -7,7 +7,7 @@ import { PropertyIdentifier } from "./_Identifier.js";
7
7
  import { ImprovementCost } from "./_ImprovementCost.js";
8
8
  import { SpellworkPrerequisites } from "./_Prerequisite.js";
9
9
  import { SkillCheck, SkillCheckPenalty } from "./_SkillCheck.js";
10
- import { checkReversalis, ReversalisEffect, ReversalisProperty, SpellworkTraditions, } from "./_Spellwork.js";
10
+ import { reversalis, SpellworkTraditions } from "./_Spellwork.js";
11
11
  import { NestedTranslationMap } from "./Locale.js";
12
12
  import { Errata } from "./source/_Erratum.js";
13
13
  import { src } from "./source/_PublicationRef.js";
@@ -35,7 +35,6 @@ export const Spell = Entity(import.meta.url, {
35
35
  comment: "The associated property.",
36
36
  type: PropertyIdentifier(),
37
37
  }),
38
- propertyReversalis: ReversalisProperty(),
39
38
  traditions: Required({
40
39
  comment: "The tradition(s) the spell is available for. It may be *generally* available to all traditions or it may be only familiar in specific traditions.",
41
40
  type: IncludeIdentifier(SpellworkTraditions),
@@ -48,6 +47,7 @@ export const Spell = Entity(import.meta.url, {
48
47
  comment: "The prerequisites for the spell.",
49
48
  type: IncludeIdentifier(SpellworkPrerequisites),
50
49
  }),
50
+ reversalis,
51
51
  src,
52
52
  translations: NestedTranslationMap(Required, "Spell", Object({
53
53
  name: Required({
@@ -58,7 +58,6 @@ export const Spell = Entity(import.meta.url, {
58
58
  comment: "The effect description may be either a plain text or a text that is divided by a list of effects for each quality level. It may also be a list for each two quality levels.",
59
59
  type: IncludeIdentifier(ActivatableSkillEffect),
60
60
  }),
61
- effectReversalis: ReversalisEffect(),
62
61
  casting_time: Optional({
63
62
  isDeprecated: true,
64
63
  type: IncludeIdentifier(OldParameter),
@@ -94,5 +93,4 @@ export const Spell = Entity(import.meta.url, {
94
93
  keyPathInEntityMap: "name",
95
94
  },
96
95
  ],
97
- customConstraints: ({ instanceContent }) => checkReversalis(instanceContent),
98
96
  });
@@ -1,15 +1,17 @@
1
- import { Array, Enum, EnumCase, String } from "tsondb/schema/def";
1
+ import { Array, Enum, EnumCase, IncludeIdentifier, Object, String, TypeAlias } from "tsondb/schema/def";
2
2
  export declare const SpellworkTraditions: Enum<"SpellworkTraditions", {
3
3
  General: EnumCase<null>;
4
4
  Specific: EnumCase<Array<import("tsondb/schema/def").ReferenceIdentifierType>>;
5
5
  }, []>;
6
- export declare const ReversalisProperty: () => import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, false>;
7
- export declare const ReversalisEffect: () => import("tsondb/schema/def").MemberDecl<String, false>;
8
- export declare const checkReversalis: (object: {
9
- propertyReversalis?: string;
10
- translations: {
11
- [locale: string]: {
12
- effectReversalis?: string;
13
- };
14
- };
15
- }) => string[];
6
+ export declare const Reversalis: TypeAlias<"Reversalis", Array<IncludeIdentifier<[], TypeAlias<"ReversalisEffect", Object<{
7
+ property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
8
+ translations: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<"ReversalisEffectTranslation", {
9
+ effect: import("tsondb/schema/def").MemberDecl<String, true>;
10
+ }>, true>;
11
+ }>, []>>>, []>;
12
+ export declare const reversalis: import("tsondb/schema/def").MemberDecl<IncludeIdentifier<[], TypeAlias<"Reversalis", Array<IncludeIdentifier<[], TypeAlias<"ReversalisEffect", Object<{
13
+ property: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").ReferenceIdentifierType, true>;
14
+ translations: import("tsondb/schema/def").MemberDecl<import("tsondb/schema/def").NestedEntityMapType<"ReversalisEffectTranslation", {
15
+ effect: import("tsondb/schema/def").MemberDecl<String, true>;
16
+ }>, true>;
17
+ }>, []>>>, []>>, false>;
@@ -1,5 +1,6 @@
1
- import { Array, Enum, EnumCase, Optional, String } from "tsondb/schema/def";
1
+ import { Array, Enum, EnumCase, IncludeIdentifier, Object, Optional, Required, String, TypeAlias, } from "tsondb/schema/def";
2
2
  import { MagicalTraditionIdentifier, PropertyIdentifier } from "./_Identifier.js";
3
+ import { NestedTranslationMap } from "./Locale.js";
3
4
  export const SpellworkTraditions = Enum(import.meta.url, {
4
5
  name: "SpellworkTraditions",
5
6
  comment: "The tradition(s) the spell or ritual is available for. It may be *generally* available to all traditions or it may be only familiar in specific traditions.",
@@ -11,24 +12,28 @@ export const SpellworkTraditions = Enum(import.meta.url, {
11
12
  }),
12
13
  }),
13
14
  });
14
- export const ReversalisProperty = () => Optional({
15
- comment: "The associated property of the reversed spell.",
16
- type: PropertyIdentifier(),
15
+ export const Reversalis = TypeAlias(import.meta.url, {
16
+ name: "Reversalis",
17
+ comment: "Possible effects of the reversed spell.",
18
+ type: () => Array(IncludeIdentifier(ReversalisEffect), { minItems: 1 }),
17
19
  });
18
- export const ReversalisEffect = () => Optional({
19
- comment: "The effect of the reversed spell.",
20
- type: String({ minLength: 1, isMarkdown: true }),
20
+ export const reversalis = Optional({
21
+ comment: "Possible effects of the reversed spell.",
22
+ type: IncludeIdentifier(Reversalis),
23
+ });
24
+ const ReversalisEffect = TypeAlias(import.meta.url, {
25
+ name: "ReversalisEffect",
26
+ comment: "A single possible effect of the reversed spell. A reversed spell can have a different property than the original spell.",
27
+ type: () => Object({
28
+ property: Required({
29
+ comment: "The associated property of the reversed spell.",
30
+ type: PropertyIdentifier(),
31
+ }),
32
+ translations: NestedTranslationMap(Required, "ReversalisEffect", Object({
33
+ effect: Required({
34
+ comment: "The effect description of the reversed spell.",
35
+ type: String({ minLength: 1, isMarkdown: true }),
36
+ }),
37
+ })),
38
+ }),
21
39
  });
22
- export const checkReversalis = (object) => {
23
- const hasProperty = object.propertyReversalis !== undefined;
24
- const hasAnyEffect = Object.values(object.translations).some(t => t.effectReversalis !== undefined);
25
- if (hasProperty && !hasAnyEffect) {
26
- return [
27
- "If 'propertyReversalis' is set, at least one translation must have 'effectReversalis' defined.",
28
- ];
29
- }
30
- if (!hasProperty && hasAnyEffect) {
31
- return ["If any translation has 'effectReversalis' defined, 'propertyReversalis' must be set."];
32
- }
33
- return [];
34
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optolith-database-schema",
3
- "version": "0.27.1",
3
+ "version": "0.28.0",
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",