@optolith/database-schema 0.102.1 → 0.103.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 +17 -0
- package/gen/types.d.ts +10 -0
- package/lib/cache/tradeSecrets.js +1 -0
- package/lib/main.d.ts +2 -0
- package/lib/main.js +1 -61
- package/lib/types/CombatTechnique.d.ts +5 -0
- package/lib/types/CombatTechnique.js +4 -0
- package/lib/types/equipment/item/AnimalCare.d.ts +72 -0
- package/lib/types/equipment/item/AnimalCare.js +5 -1
- package/lib/types/equipment/item/_Weapon.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
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.103.1](https://github.com/Optolith/database-schema/compare/v0.103.0...v0.103.1) (2026-10-15)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add optional complexity to animal care ([cff0eea](https://github.com/Optolith/database-schema/commit/cff0eea7bdfd60b8a8409776c076f456e4794bbe))
|
|
10
|
+
|
|
11
|
+
## [0.103.0](https://github.com/Optolith/database-schema/compare/v0.102.1...v0.103.0) (2026-10-15)
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* close combat technique can validate presence of attack modifier
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* close combat technique can validate presence of attack modifier ([e9cef1b](https://github.com/Optolith/database-schema/commit/e9cef1b22987ef4137588e666125c914f402a4f1))
|
|
20
|
+
* prepare future migration stages ([7719ecc](https://github.com/Optolith/database-schema/commit/7719eccbcb188c7bb2f9fcb377c598605d8855cc))
|
|
21
|
+
|
|
5
22
|
## [0.102.1](https://github.com/Optolith/database-schema/compare/v0.102.0...v0.102.1) (2026-10-15)
|
|
6
23
|
|
|
7
24
|
## [0.102.0](https://github.com/Optolith/database-schema/compare/v0.101.0...v0.102.0) (2026-10-15)
|
package/gen/types.d.ts
CHANGED
|
@@ -5371,6 +5371,11 @@ export interface CloseCombatTechniqueTranslation {
|
|
|
5371
5371
|
* Special rules for the combat technique that apply to all weapons in this category.
|
|
5372
5372
|
*/
|
|
5373
5373
|
export interface CloseCombatTechniqueSpecialRules {
|
|
5374
|
+
/**
|
|
5375
|
+
* Do weapons of this combat technique have an attack modifier?
|
|
5376
|
+
*/
|
|
5377
|
+
hasAttackModifier: WeaponCombatTechniqueValueRule
|
|
5378
|
+
|
|
5374
5379
|
/**
|
|
5375
5380
|
* Is parrying possible with this combat technique?
|
|
5376
5381
|
*/
|
|
@@ -23731,6 +23736,11 @@ export interface AnimalCare {
|
|
|
23731
23736
|
*/
|
|
23732
23737
|
type: AnimalCareType
|
|
23733
23738
|
|
|
23739
|
+
/**
|
|
23740
|
+
* The complexity of crafting the item.
|
|
23741
|
+
*/
|
|
23742
|
+
complexity?: Complexity
|
|
23743
|
+
|
|
23734
23744
|
/**
|
|
23735
23745
|
* References to where in which publications this entry has been defined. Entries may also be added or removed in later printings.
|
|
23736
23746
|
*/
|
package/lib/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MigrationStage } from "tsondb";
|
|
1
2
|
import { Schema } from "tsondb/schema";
|
|
2
3
|
import type { ChildEntityMap, EntityMap, EnumMap, SingletonEntityMap, TypeAliasMap } from "../gen/types.js";
|
|
3
4
|
declare module "tsondb/schema/gen" {
|
|
@@ -17,3 +18,4 @@ export interface TSONDBTypes {
|
|
|
17
18
|
typeAliasMap: TypeAliasMap;
|
|
18
19
|
}
|
|
19
20
|
export declare const schema: Schema<TSONDBTypes>;
|
|
21
|
+
export declare const migrationStages: MigrationStage<TSONDBTypes>[];
|
package/lib/main.js
CHANGED
|
@@ -179,64 +179,4 @@ export const schema = new Schema((await import("../package.json", { with: { type
|
|
|
179
179
|
Types.WorkingSupernaturalCreature,
|
|
180
180
|
Types.ZibiljaRitual,
|
|
181
181
|
], Types.Locale);
|
|
182
|
-
|
|
183
|
-
// * A dictionary of cache types and their associated location.
|
|
184
|
-
// */
|
|
185
|
-
// export type CachePaths = {
|
|
186
|
-
// [K in keyof CacheMap]: string
|
|
187
|
-
// }
|
|
188
|
-
// export type CacheOptions = {
|
|
189
|
-
// /**
|
|
190
|
-
// * Whether to pretty-print the JSON. Default is `false`.
|
|
191
|
-
// */
|
|
192
|
-
// pretty?: boolean
|
|
193
|
-
// }
|
|
194
|
-
// /**
|
|
195
|
-
// * Builds the cache and writes it to the specified paths in JSON format.
|
|
196
|
-
// * @param cachePaths The absolute paths to write each cache to.
|
|
197
|
-
// * @param validResults The data to build the cache from. Usually the result of
|
|
198
|
-
// * `getAllValidData`.
|
|
199
|
-
// * @param options Configuration options for building the cache.
|
|
200
|
-
// */
|
|
201
|
-
// export const buildCache = async (
|
|
202
|
-
// cachePaths: CachePaths,
|
|
203
|
-
// validResults: ValidResults,
|
|
204
|
-
// options: CacheOptions = {}
|
|
205
|
-
// ): Promise<void> => {
|
|
206
|
-
// const { pretty = false } = options
|
|
207
|
-
// const activatableSelectOptionsCache = cacheMap.activatableSelectOptions.builder(validResults)
|
|
208
|
-
// const ancestorBloodAdvantagesCache = cacheMap.ancestorBloodAdvantages.builder(validResults)
|
|
209
|
-
// const magicalAndBlessedAdvantagesAndDisadvantagesCache =
|
|
210
|
-
// cacheMap.magicalAndBlessedAdvantagesAndDisadvantages.builder(validResults)
|
|
211
|
-
// const newApplicationsAndUsesCache = cacheMap.newApplicationsAndUses.builder(
|
|
212
|
-
// validResults,
|
|
213
|
-
// activatableSelectOptionsCache
|
|
214
|
-
// )
|
|
215
|
-
// const cacheData: CacheMap = {
|
|
216
|
-
// activatableSelectOptions: activatableSelectOptionsCache,
|
|
217
|
-
// ancestorBloodAdvantages: ancestorBloodAdvantagesCache,
|
|
218
|
-
// magicalAndBlessedAdvantagesAndDisadvantages: magicalAndBlessedAdvantagesAndDisadvantagesCache,
|
|
219
|
-
// newApplicationsAndUses: newApplicationsAndUsesCache,
|
|
220
|
-
// }
|
|
221
|
-
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
222
|
-
// await mkdir(dirname(cachePath), { recursive: true })
|
|
223
|
-
// await writeFile(
|
|
224
|
-
// cachePath,
|
|
225
|
-
// JSON.stringify(cacheData[cacheName as keyof CachePaths], null, pretty ? 2 : undefined),
|
|
226
|
-
// "utf-8"
|
|
227
|
-
// )
|
|
228
|
-
// }
|
|
229
|
-
// }
|
|
230
|
-
// /**
|
|
231
|
-
// * Reads the cache from the specified paths in JSON format.
|
|
232
|
-
// * @param cachePaths The absolute paths to read each cache from.
|
|
233
|
-
// * @returns
|
|
234
|
-
// */
|
|
235
|
-
// export const getCache = async (cachePaths: CachePaths): Promise<CacheMap> => {
|
|
236
|
-
// const cache: Partial<CacheMap> = {}
|
|
237
|
-
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
238
|
-
// const cacheData = JSON.parse(await readFile(cachePath, "utf-8"))
|
|
239
|
-
// cache[cacheName as keyof CacheMap] = cacheData
|
|
240
|
-
// }
|
|
241
|
-
// return cache as CacheMap
|
|
242
|
-
// }
|
|
182
|
+
export const migrationStages = [];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as DB from "tsondb/schema/dsl";
|
|
2
2
|
export declare const CloseCombatTechnique: DB.Entity<"CloseCombatTechnique", {
|
|
3
3
|
special: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"CloseCombatTechniqueSpecialRules", DB.Object<{
|
|
4
|
+
hasAttackModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"WeaponCombatTechniqueValueRule", {
|
|
5
|
+
Required: DB.EnumCase<null>;
|
|
6
|
+
Optional: DB.EnumCase<null>;
|
|
7
|
+
Prohibited: DB.EnumCase<null>;
|
|
8
|
+
}, []>>, true>;
|
|
4
9
|
can_parry: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"WeaponCombatTechniqueValueRule", {
|
|
5
10
|
Required: DB.EnumCase<null>;
|
|
6
11
|
Optional: DB.EnumCase<null>;
|
|
@@ -69,6 +69,10 @@ const CloseCombatTechniqueSpecialRules = DB.TypeAlias(import.meta.url, {
|
|
|
69
69
|
name: "CloseCombatTechniqueSpecialRules",
|
|
70
70
|
comment: "Special rules for the combat technique that apply to all weapons in this category.",
|
|
71
71
|
type: () => DB.Object({
|
|
72
|
+
hasAttackModifier: DB.Required({
|
|
73
|
+
comment: "Do weapons of this combat technique have an attack modifier?",
|
|
74
|
+
type: DB.IncludeIdentifier(WeaponCombatTechniqueValueRule),
|
|
75
|
+
}),
|
|
72
76
|
can_parry: DB.Required({
|
|
73
77
|
comment: "Is parrying possible with this combat technique?",
|
|
74
78
|
type: DB.IncludeIdentifier(WeaponCombatTechniqueValueRule),
|
|
@@ -37,6 +37,78 @@ export declare const AnimalCare: DB.Entity<"AnimalCare", {
|
|
|
37
37
|
}, []>>, true>;
|
|
38
38
|
}>, []>>>;
|
|
39
39
|
}, []>>, true>;
|
|
40
|
+
complexity: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Complexity", {
|
|
41
|
+
Primitive: DB.EnumCase<null>;
|
|
42
|
+
Simple: DB.EnumCase<null>;
|
|
43
|
+
Complex: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ComplexComplexity", DB.Object<{
|
|
44
|
+
ap_value: DB.MemberDecl<DB.Integer, true>;
|
|
45
|
+
prerequisites: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PlainGeneralPrerequisites", DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"PlainPrerequisites", DB.Array<DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.Enum<"PrerequisitesElement", {
|
|
46
|
+
Single: DB.EnumCase<DB.TypeArgument<DB.Param<"T", DB.Type>>>;
|
|
47
|
+
Disjunction: DB.EnumCase<DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"PrerequisitesDisjunction", DB.Object<{
|
|
48
|
+
list: DB.MemberDecl<DB.Array<DB.TypeArgument<DB.Param<"T", DB.Type>>>, true>;
|
|
49
|
+
display_option: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"DisplayOption", {
|
|
50
|
+
Hide: DB.EnumCase<null>;
|
|
51
|
+
ReplaceWith: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ReplacementDisplayOption", DB.Object<{
|
|
52
|
+
sentence_type: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SentenceType", {
|
|
53
|
+
Standalone: DB.EnumCase<null>;
|
|
54
|
+
Connected: DB.EnumCase<null>;
|
|
55
|
+
}, []>>, false>;
|
|
56
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"ReplacementDisplayOptionTranslation", {
|
|
57
|
+
replacement: DB.MemberDecl<DB.String, true>;
|
|
58
|
+
}>, true>;
|
|
59
|
+
}>, []>>>;
|
|
60
|
+
}, []>>, false>;
|
|
61
|
+
}>, [T: DB.Param<"T", DB.Type>]>>>;
|
|
62
|
+
Group: DB.EnumCase<DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"PrerequisiteGroup", DB.Object<{
|
|
63
|
+
list: DB.MemberDecl<DB.Array<DB.TypeArgument<DB.Param<"T", DB.Type>>>, true>;
|
|
64
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"PrerequisiteGroupTranslation", {
|
|
65
|
+
text: DB.MemberDecl<DB.String, true>;
|
|
66
|
+
}>, true>;
|
|
67
|
+
}>, [T: DB.Param<"T", DB.Type>]>>>;
|
|
68
|
+
}, [T: DB.Param<"T", DB.Type>]>>>, [T: DB.Param<"T", DB.Type>]>>, []>>, false>;
|
|
69
|
+
src: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRefs", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRef", DB.Object<{
|
|
70
|
+
id: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
71
|
+
occurrences: DB.MemberDecl<DB.NestedEntityMap<string, {
|
|
72
|
+
initial: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"InitialOccurrence", DB.Object<{
|
|
73
|
+
printing: DB.MemberDecl<DB.Integer, false>;
|
|
74
|
+
pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
|
|
75
|
+
first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
|
|
76
|
+
InsideCoverFront: DB.EnumCase<null>;
|
|
77
|
+
InsideCoverBack: DB.EnumCase<null>;
|
|
78
|
+
Numbered: DB.EnumCase<DB.Integer>;
|
|
79
|
+
}, []>>, true>;
|
|
80
|
+
last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
|
|
81
|
+
InsideCoverFront: DB.EnumCase<null>;
|
|
82
|
+
InsideCoverBack: DB.EnumCase<null>;
|
|
83
|
+
Numbered: DB.EnumCase<DB.Integer>;
|
|
84
|
+
}, []>>, false>;
|
|
85
|
+
}>, []>>>, true>;
|
|
86
|
+
isRemoved: DB.MemberDecl<DB.Boolean, false>;
|
|
87
|
+
}>, []>>, true>;
|
|
88
|
+
revisions: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"Revision", {
|
|
89
|
+
Since: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Since", DB.Object<{
|
|
90
|
+
printing: DB.MemberDecl<DB.Integer, true>;
|
|
91
|
+
pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
|
|
92
|
+
first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
|
|
93
|
+
InsideCoverFront: DB.EnumCase<null>;
|
|
94
|
+
InsideCoverBack: DB.EnumCase<null>;
|
|
95
|
+
Numbered: DB.EnumCase<DB.Integer>;
|
|
96
|
+
}, []>>, true>;
|
|
97
|
+
last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
|
|
98
|
+
InsideCoverFront: DB.EnumCase<null>;
|
|
99
|
+
InsideCoverBack: DB.EnumCase<null>;
|
|
100
|
+
Numbered: DB.EnumCase<DB.Integer>;
|
|
101
|
+
}, []>>, false>;
|
|
102
|
+
}>, []>>>, true>;
|
|
103
|
+
}>, []>>>;
|
|
104
|
+
Deprecated: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Deprecation", DB.Object<{
|
|
105
|
+
printing: DB.MemberDecl<DB.Integer, true>;
|
|
106
|
+
}>, []>>>;
|
|
107
|
+
}, []>>>, false>;
|
|
108
|
+
}>, true>;
|
|
109
|
+
}>, []>>>, []>>, false>;
|
|
110
|
+
}>, []>>>;
|
|
111
|
+
}, []>>, false>;
|
|
40
112
|
src: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRefs", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRef", DB.Object<{
|
|
41
113
|
id: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
42
114
|
occurrences: DB.MemberDecl<DB.NestedEntityMap<string, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as DB from "tsondb/schema/dsl";
|
|
2
2
|
import { src } from "../../source/_PublicationRef.js";
|
|
3
|
-
import { Cost, DefaultItemTranslations, FixedCost, Weight } from "./_Item.js";
|
|
3
|
+
import { Complexity, Cost, DefaultItemTranslations, FixedCost, Weight } from "./_Item.js";
|
|
4
4
|
export const AnimalCare = DB.Entity(import.meta.url, {
|
|
5
5
|
name: "AnimalCare",
|
|
6
6
|
namePlural: "AnimalCare",
|
|
@@ -9,6 +9,10 @@ export const AnimalCare = DB.Entity(import.meta.url, {
|
|
|
9
9
|
comment: "Values depending on whether the animal care is feed.",
|
|
10
10
|
type: DB.IncludeIdentifier(AnimalCareType),
|
|
11
11
|
}),
|
|
12
|
+
complexity: DB.Optional({
|
|
13
|
+
comment: "The complexity of crafting the item.",
|
|
14
|
+
type: DB.IncludeIdentifier(Complexity),
|
|
15
|
+
}),
|
|
12
16
|
src,
|
|
13
17
|
translations: DefaultItemTranslations("AnimalCare"),
|
|
14
18
|
}),
|
|
@@ -62,6 +62,7 @@ export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstan
|
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
|
|
63
63
|
const ct = getInstanceById("CloseCombatTechnique", ctId);
|
|
64
64
|
return [
|
|
65
|
+
checkPart(ct.special.hasAttackModifier, meleeUse.attackModifier, "an attack modifier", "close", ctId),
|
|
65
66
|
checkPart(ct.special.can_parry, meleeUse.parryModifier, "a parry modifier", "close", ctId),
|
|
66
67
|
checkPart(ct.special.has_damage_threshold, meleeUse.damage_threshold, "a damage threshold", "close", ctId),
|
|
67
68
|
checkPart(ct.special.has_length, meleeUse.length, "a length", "close", ctId),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optolith/database-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.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",
|