@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.
- package/CHANGELOG.md +16 -0
- package/gen/types.d.ts +250 -0
- package/lib/main.js +2 -0
- package/lib/types/Attribute.js +1 -3
- package/lib/types/DerivedCharacteristic.js +1 -3
- package/lib/types/Locale.d.ts +7 -0
- package/lib/types/Locale.js +7 -0
- package/lib/types/SkillGroup.js +1 -3
- package/lib/types/SocialStatus.js +1 -0
- package/lib/types/Talisman.js +1 -1
- package/lib/types/_Identifier.d.ts +2 -0
- package/lib/types/_Identifier.js +4 -0
- package/lib/types/equipment/item/BandageOrRemedy.js +1 -1
- package/lib/types/equipment/item/CeremonialItem.js +1 -1
- package/lib/types/equipment/item/Clothes.js +1 -1
- package/lib/types/equipment/item/Container.js +1 -1
- package/lib/types/equipment/item/EquipmentCategory.d.ts +121 -0
- package/lib/types/equipment/item/EquipmentCategory.js +131 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +1 -1
- package/lib/types/equipment/item/IlluminationLightSource.js +1 -1
- package/lib/types/equipment/item/IlluminationRefillOrSupply.js +1 -1
- package/lib/types/equipment/item/Item.d.ts +287 -0
- package/lib/types/equipment/item/Item.js +167 -0
- package/lib/types/equipment/item/Liebesspielzeug.js +1 -1
- package/lib/types/equipment/item/LuxuryGood.js +1 -1
- package/lib/types/equipment/item/MagicalArtifact.js +1 -1
- package/lib/types/equipment/item/MusicalInstrument.js +1 -1
- package/lib/types/equipment/item/TravelGearOrTool.js +1 -1
- package/lib/types/equipment/item/Weapon.js +1 -1
- package/lib/types/equipment/item/WeaponAccessory.js +1 -1
- package/lib/types/equipment/item/_Item.js +1 -1
- package/lib/types/equipment/item/_Weapon.d.ts +2 -2
- package/lib/types/equipment/item/_Weapon.js +7 -4
- package/lib/types/equipment/item/sub/Reach.js +1 -3
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/package.json +9 -9
|
@@ -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
|
|
100
|
+
customConstraints: params => checkWeaponCombatTechniqueIntegrity(params),
|
|
101
101
|
});
|
|
102
102
|
export const ImprovisedWeapon = DB.TypeAlias(import.meta.url, {
|
|
103
103
|
name: "ImprovisedWeapon",
|
|
@@ -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, }
|
|
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 &&
|
|
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",
|
package/lib/types/index.d.ts
CHANGED
|
@@ -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";
|
package/lib/types/index.js
CHANGED
|
@@ -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.
|
|
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.
|
|
43
|
-
"yaml": "^2.9.
|
|
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.
|
|
48
|
-
"commit-and-tag-version": "^13.1
|
|
49
|
-
"eslint": "^10.
|
|
50
|
-
"globals": "^17.
|
|
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.
|
|
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.
|
|
55
|
+
"typescript-eslint": "^8.71.0"
|
|
56
56
|
},
|
|
57
57
|
"repository": "github:Optolith/database-schema",
|
|
58
58
|
"bugs": {
|