optolith-database-schema 0.15.3 → 0.15.4
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 +14 -0
- package/lib/cache/activatableSelectOptions.d.ts +80 -0
- package/lib/cache/activatableSelectOptions.js +924 -0
- package/lib/cache/newApplicationsAndUses.d.ts +4 -1
- package/lib/cache/newApplicationsAndUses.js +59 -1
- package/lib/cacheConfig.d.ts +2 -2
- package/lib/config/cache.d.ts +4 -1
- package/lib/config/cache.js +2 -0
- package/lib/helpers/nullable.d.ts +35 -0
- package/lib/helpers/nullable.js +31 -0
- package/lib/helpers/nullable.test.d.ts +1 -0
- package/lib/helpers/nullable.test.js +46 -0
- package/lib/helpers/object.d.ts +5 -0
- package/lib/helpers/object.js +16 -0
- package/lib/helpers/object.test.d.ts +1 -0
- package/lib/helpers/object.test.js +15 -0
- package/lib/helpers/typeSafety.d.ts +10 -2
- package/lib/helpers/typeSafety.js +10 -2
- package/lib/helpers/typeSafety.test.d.ts +1 -0
- package/lib/helpers/typeSafety.test.js +10 -0
- package/lib/main.js +13 -8
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +6 -6
- package/lib/types/_Identifier.d.ts +72 -0
- package/lib/types/_IdentifierGroup.d.ts +3 -2
- package/package.json +2 -2
- package/schema/_ActivatableSelectOptionCategory.schema.json +2 -2
- package/schema/_Identifier.schema.json +144 -0
- package/schema/_IdentifierGroup.schema.json +109 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.15.4](https://github.com/elyukai/optolith-database-schema/compare/v0.15.3...v0.15.4) (2024-01-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add possible and requirable select option identifiers ([0ee088a](https://github.com/elyukai/optolith-database-schema/commit/0ee088a01b98e2f8828303d43f40ac8143db1eac))
|
|
11
|
+
* add pre-generated select options for activatable entries as cache ([3fdcaf2](https://github.com/elyukai/optolith-database-schema/commit/3fdcaf2a95623e751993c1e696f2b269acbc7594))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* add missing vampiric gift identifier to activatable identifier group ([98316b6](https://github.com/elyukai/optolith-database-schema/commit/98316b63a9b9e7dd00939d596621a3b5782e2d2e))
|
|
17
|
+
* wrong identifier references in select option config ([a70a7ea](https://github.com/elyukai/optolith-database-schema/commit/a70a7ea4a02ecbcb5167ab13b1e3a1d75c327e3f))
|
|
18
|
+
|
|
5
19
|
### [0.15.3](https://github.com/elyukai/optolith-database-schema/compare/v0.15.2...v0.15.3) (2024-01-09)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { CacheConfig } from "../cacheConfig.js";
|
|
2
|
+
import { TypeMap } from "../config/types.js";
|
|
3
|
+
import { SelectOptions, SkillApplications, SkillUses } from "../types/_Activatable.js";
|
|
4
|
+
import { SelectOptionIdentifier } from "../types/_IdentifierGroup.js";
|
|
5
|
+
import { LocaleMap } from "../types/_LocaleMap.js";
|
|
6
|
+
import { GeneralPrerequisites } from "../types/_Prerequisite.js";
|
|
7
|
+
import { Errata } from "../types/source/_Erratum.js";
|
|
8
|
+
import { PublicationRefs } from "../types/source/_PublicationRef.js";
|
|
9
|
+
export type ResolvedSelectOption = {
|
|
10
|
+
id: SelectOptionIdentifier;
|
|
11
|
+
/**
|
|
12
|
+
* Sometimes, professions use specific text selections that are not
|
|
13
|
+
* contained in described lists. This ensures you can use them for
|
|
14
|
+
* professions only. They are not going to be displayed as options to the
|
|
15
|
+
* user.
|
|
16
|
+
*/
|
|
17
|
+
profession_only?: true;
|
|
18
|
+
/**
|
|
19
|
+
* Registers new applications, which get enabled once this entry is
|
|
20
|
+
* activated with its respective select option. It specifies an entry-unique
|
|
21
|
+
* identifier and the skill it belongs to. A translation can be left out if
|
|
22
|
+
* its name equals the name of the origin select option.
|
|
23
|
+
*/
|
|
24
|
+
skill_applications?: SkillApplications;
|
|
25
|
+
/**
|
|
26
|
+
* Registers uses, which get enabled once this entry is activated with its
|
|
27
|
+
* respective select option. It specifies an entry-unique identifier and the
|
|
28
|
+
* skill it belongs to. A translation can be left out if its name equals the
|
|
29
|
+
* name of the origin select option.
|
|
30
|
+
*/
|
|
31
|
+
skill_uses?: SkillUses;
|
|
32
|
+
prerequisites?: GeneralPrerequisites;
|
|
33
|
+
/**
|
|
34
|
+
* Specific binding cost for the select option. Only has an effect if the
|
|
35
|
+
* associated entry supports binding costs.
|
|
36
|
+
*/
|
|
37
|
+
binding_cost?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Specific volume for the select option. Only has an effect if the
|
|
40
|
+
* associated entry supports volume values.
|
|
41
|
+
*/
|
|
42
|
+
volume?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Specific AP cost for the select option.
|
|
45
|
+
*/
|
|
46
|
+
ap_value?: number;
|
|
47
|
+
src?: PublicationRefs;
|
|
48
|
+
/**
|
|
49
|
+
* All translations for the entry, identified by IETF language tag (BCP47).
|
|
50
|
+
*/
|
|
51
|
+
translations: LocaleMap<ResolvedSelectOptionTranslation>;
|
|
52
|
+
};
|
|
53
|
+
export type ResolvedSelectOptionTranslation = {
|
|
54
|
+
/**
|
|
55
|
+
* The name of the select option.
|
|
56
|
+
*/
|
|
57
|
+
name: string;
|
|
58
|
+
/**
|
|
59
|
+
* The name of the select option when displayed in a generated
|
|
60
|
+
* profession text.
|
|
61
|
+
*/
|
|
62
|
+
name_in_profession?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The description of the select option. Useful for Bad Habits, Trade
|
|
65
|
+
* Secrets and other entries where a description is available.
|
|
66
|
+
*/
|
|
67
|
+
description?: string;
|
|
68
|
+
errata?: Errata;
|
|
69
|
+
};
|
|
70
|
+
export type ActivatableSelectOptionsCacheKeys = {
|
|
71
|
+
[K in keyof TypeMap]: TypeMap[K] extends {
|
|
72
|
+
select_options?: SelectOptions;
|
|
73
|
+
} ? K : never;
|
|
74
|
+
}[keyof TypeMap];
|
|
75
|
+
export type ActivatableSelectOptionsCache = {
|
|
76
|
+
[K in ActivatableSelectOptionsCacheKeys]: {
|
|
77
|
+
[id: number]: ResolvedSelectOption[];
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare const config: CacheConfig<ActivatableSelectOptionsCache>;
|