@optolith/database-schema 0.76.0 → 0.77.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 (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/gen/types.d.ts +250 -0
  3. package/lib/main.js +2 -0
  4. package/lib/types/Attribute.js +1 -3
  5. package/lib/types/DerivedCharacteristic.js +1 -3
  6. package/lib/types/Locale.d.ts +7 -0
  7. package/lib/types/Locale.js +7 -0
  8. package/lib/types/SkillGroup.js +1 -3
  9. package/lib/types/SocialStatus.js +1 -0
  10. package/lib/types/Talisman.js +1 -1
  11. package/lib/types/_Identifier.d.ts +2 -0
  12. package/lib/types/_Identifier.js +4 -0
  13. package/lib/types/equipment/item/BandageOrRemedy.js +1 -1
  14. package/lib/types/equipment/item/CeremonialItem.js +1 -1
  15. package/lib/types/equipment/item/Clothes.js +1 -1
  16. package/lib/types/equipment/item/Container.js +1 -1
  17. package/lib/types/equipment/item/EquipmentCategory.d.ts +121 -0
  18. package/lib/types/equipment/item/EquipmentCategory.js +131 -0
  19. package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +1 -1
  20. package/lib/types/equipment/item/IlluminationLightSource.js +1 -1
  21. package/lib/types/equipment/item/IlluminationRefillOrSupply.js +1 -1
  22. package/lib/types/equipment/item/Item.d.ts +287 -0
  23. package/lib/types/equipment/item/Item.js +167 -0
  24. package/lib/types/equipment/item/Liebesspielzeug.js +1 -1
  25. package/lib/types/equipment/item/LuxuryGood.js +1 -1
  26. package/lib/types/equipment/item/MagicalArtifact.js +1 -1
  27. package/lib/types/equipment/item/MusicalInstrument.js +1 -1
  28. package/lib/types/equipment/item/TravelGearOrTool.js +1 -1
  29. package/lib/types/equipment/item/Weapon.js +1 -1
  30. package/lib/types/equipment/item/WeaponAccessory.js +1 -1
  31. package/lib/types/equipment/item/_Item.js +1 -1
  32. package/lib/types/equipment/item/_Weapon.d.ts +2 -2
  33. package/lib/types/equipment/item/_Weapon.js +7 -4
  34. package/lib/types/equipment/item/sub/Reach.js +1 -3
  35. package/lib/types/index.d.ts +2 -0
  36. package/lib/types/index.js +2 -0
  37. package/package.json +9 -9
@@ -41,7 +41,7 @@ export const TravelGearOrTool = DB.Entity(import.meta.url, {
41
41
  return checkWeaponCombatTechniqueIntegrity({
42
42
  ...rest,
43
43
  instanceContent: instanceContent.combat_use.Weapon,
44
- }, { secondary: true });
44
+ });
45
45
  }
46
46
  return [];
47
47
  },
@@ -97,7 +97,7 @@ export const Weapon = DB.Entity(import.meta.url, {
97
97
  keyPathInEntityMap: "name",
98
98
  },
99
99
  ],
100
- customConstraints: params => checkWeaponCombatTechniqueIntegrity(params, { secondary: false }),
100
+ customConstraints: params => checkWeaponCombatTechniqueIntegrity(params),
101
101
  });
102
102
  export const ImprovisedWeapon = DB.TypeAlias(import.meta.url, {
103
103
  name: "ImprovisedWeapon",
@@ -41,7 +41,7 @@ export const WeaponAccessory = DB.Entity(import.meta.url, {
41
41
  return checkWeaponCombatTechniqueIntegrity({
42
42
  ...rest,
43
43
  instanceContent: instanceContent.combat_use.Weapon,
44
- }, { secondary: true });
44
+ });
45
45
  }
46
46
  return [];
47
47
  },
@@ -48,7 +48,7 @@ export const DefaultItem = (sourceUrl, singularName, pluralName) => DB.Entity(so
48
48
  return checkWeaponCombatTechniqueIntegrity({
49
49
  ...rest,
50
50
  instanceContent: combatUse.Weapon,
51
- }, { secondary: true });
51
+ });
52
52
  }
53
53
  return [];
54
54
  },
@@ -16,10 +16,10 @@ export declare const Length: DB.TypeAlias<"Length", DB.Integer, []>;
16
16
  export declare const checkWeaponCombatTechniqueIntegrity: ({ instanceContent, getInstanceById, getDisplayNameAndId, }: {
17
17
  instanceContent: {
18
18
  melee_uses?: Record<string, GenMeleeWeapon<unknown>>;
19
+ meleeUses?: Record<string, GenMeleeWeapon<unknown>>;
19
20
  ranged_uses?: Record<string, GenRangedWeapon<unknown>>;
21
+ rangedUses?: Record<string, GenRangedWeapon<unknown>>;
20
22
  };
21
23
  getInstanceById: GetInstanceById;
22
24
  getDisplayNameAndId: GetDisplayNameAndId;
23
- }, { secondary: _secondary }: {
24
- secondary: boolean;
25
25
  }) => string[];
@@ -47,15 +47,18 @@ export const Length = DB.TypeAlias(import.meta.url, {
47
47
  comment: "The length of the weapon in cm/halffingers.",
48
48
  type: () => DB.Integer({ minimum: 1 }),
49
49
  });
50
- export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstanceById, getDisplayNameAndId, }, { secondary: _secondary }) => {
50
+ export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstanceById, getDisplayNameAndId, }) => {
51
51
  const checkPart = (rule, value, name, type, id) => (rule.kind === "Prohibited") === (value === undefined) || rule.kind === "Optional"
52
52
  ? undefined
53
53
  : `${name} must${rule.kind === "Required" ? "" : " not"} be provided for ${type} combat technique ${getDisplayNameAndId(type === "close" ? "CloseCombatTechnique" : "RangedCombatTechnique", id)}`;
54
54
  return [
55
- instanceContent.melee_uses === undefined && instanceContent.ranged_uses === undefined
55
+ instanceContent.melee_uses === undefined &&
56
+ instanceContent.ranged_uses === undefined &&
57
+ instanceContent.meleeUses === undefined &&
58
+ instanceContent.rangedUses === undefined
56
59
  ? "either melee uses or ranged uses have to be provided"
57
60
  : undefined,
58
- ...Object.entries(instanceContent.melee_uses ?? {}).flatMap(([ctId, meleeUse]) => {
61
+ ...Object.entries(instanceContent.melee_uses ?? instanceContent.meleeUses ?? {}).flatMap(([ctId, meleeUse]) => {
59
62
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
60
63
  const ct = getInstanceById("CloseCombatTechnique", ctId);
61
64
  return [
@@ -66,7 +69,7 @@ export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstan
66
69
  checkPart(ct.special.has_shield_size, meleeUse.size, "a shield size", "close", ctId),
67
70
  ];
68
71
  }),
69
- ...Object.entries(instanceContent.ranged_uses ?? {}).flatMap(([ctId, rangedUse]) => {
72
+ ...Object.entries(instanceContent.ranged_uses ?? instanceContent.rangedUses ?? {}).flatMap(([ctId, rangedUse]) => {
70
73
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
71
74
  const ct = getInstanceById("RangedCombatTechnique", ctId);
72
75
  return [
@@ -16,9 +16,7 @@ export const Reach = DB.Entity(import.meta.url, {
16
16
  })),
17
17
  }),
18
18
  instanceDisplayName: {},
19
- sortOrder: {
20
- keyPath: "position",
21
- },
19
+ sortOrder: { keyPath: "position", isIndex: true },
22
20
  uniqueConstraints: [
23
21
  {
24
22
  entityMapKeyPath: "translations",
@@ -28,12 +28,14 @@ export { Clothes } from "./equipment/item/Clothes.js";
28
28
  export { ClothingPackage } from "./equipment/item/ClothingPackage.js";
29
29
  export { Container } from "./equipment/item/Container.js";
30
30
  export { Elixir } from "./equipment/item/Elixir.js";
31
+ export { EquipmentCategory } from "./equipment/item/EquipmentCategory.ts";
31
32
  export { EquipmentOfBlessedOnes } from "./equipment/item/EquipmentOfBlessedOnes.js";
32
33
  export { GemOrPreciousStone } from "./equipment/item/GemOrPreciousStone.js";
33
34
  export { HerbalAid } from "./equipment/item/HerbalAid.js";
34
35
  export { HerbalPreservation } from "./equipment/item/HerbalPreservation.js";
35
36
  export { IlluminationLightSource } from "./equipment/item/IlluminationLightSource.js";
36
37
  export { IlluminationRefillOrSupply } from "./equipment/item/IlluminationRefillOrSupply.js";
38
+ export { Item } from "./equipment/item/Item.js";
37
39
  export { Jewelry } from "./equipment/item/Jewelry.js";
38
40
  export { Laboratory } from "./equipment/item/Laboratory.js";
39
41
  export { Liebesspielzeug } from "./equipment/item/Liebesspielzeug.js";
@@ -28,12 +28,14 @@ export { Clothes } from "./equipment/item/Clothes.js";
28
28
  export { ClothingPackage } from "./equipment/item/ClothingPackage.js";
29
29
  export { Container } from "./equipment/item/Container.js";
30
30
  export { Elixir } from "./equipment/item/Elixir.js";
31
+ export { EquipmentCategory } from "./equipment/item/EquipmentCategory.js";
31
32
  export { EquipmentOfBlessedOnes } from "./equipment/item/EquipmentOfBlessedOnes.js";
32
33
  export { GemOrPreciousStone } from "./equipment/item/GemOrPreciousStone.js";
33
34
  export { HerbalAid } from "./equipment/item/HerbalAid.js";
34
35
  export { HerbalPreservation } from "./equipment/item/HerbalPreservation.js";
35
36
  export { IlluminationLightSource } from "./equipment/item/IlluminationLightSource.js";
36
37
  export { IlluminationRefillOrSupply } from "./equipment/item/IlluminationRefillOrSupply.js";
38
+ export { Item } from "./equipment/item/Item.js";
37
39
  export { Jewelry } from "./equipment/item/Jewelry.js";
38
40
  export { Laboratory } from "./equipment/item/Laboratory.js";
39
41
  export { Liebesspielzeug } from "./equipment/item/Liebesspielzeug.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optolith/database-schema",
3
- "version": "0.76.0",
3
+ "version": "0.77.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",
@@ -39,20 +39,20 @@
39
39
  "license": "MPL-2.0",
40
40
  "dependencies": {
41
41
  "@elyukai/utils": "^0.3.6",
42
- "tsondb": "^0.21.2",
43
- "yaml": "^2.9.0"
42
+ "tsondb": "^0.21.4",
43
+ "yaml": "^2.9.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@eslint/js": "^10.0.1",
47
- "@types/node": "^26.5.0",
48
- "commit-and-tag-version": "^13.1.2",
49
- "eslint": "^10.10.0",
50
- "globals": "^17.12.0",
47
+ "@types/node": "^26.6.4",
48
+ "commit-and-tag-version": "^13.2.1",
49
+ "eslint": "^10.12.0",
50
+ "globals": "^17.13.0",
51
51
  "nodemon": "^3.1.14",
52
- "prettier": "^3.9.6",
52
+ "prettier": "^3.9.9",
53
53
  "typescript": "npm:@typescript/typescript6@^6.0.2",
54
54
  "typescript-7": "npm:typescript@^7.0.2",
55
- "typescript-eslint": "^8.70.0"
55
+ "typescript-eslint": "^8.71.0"
56
56
  },
57
57
  "repository": "github:Optolith/database-schema",
58
58
  "bugs": {