coh-content-db 2.0.0-rc.16 → 2.0.0-rc.18
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/.github/workflows/build.yml +1 -1
- package/CHANGELOG.md +3 -1
- package/dist/coh-content-db.d.ts +95 -37
- package/dist/coh-content-db.js +189 -80
- package/dist/coh-content-db.js.map +1 -1
- package/dist/coh-content-db.mjs +187 -81
- package/dist/coh-content-db.mjs.map +1 -1
- package/jest.config.mjs +1 -0
- package/package.json +1 -1
- package/src/main/api/badge-data.ts +2 -1
- package/src/main/api/contact-data.ts +2 -1
- package/src/main/api/level-range-data.ts +4 -0
- package/src/main/api/mission-data.ts +3 -29
- package/src/main/api/mission-flashback-data.ts +31 -0
- package/src/main/api/set-title-data.ts +4 -0
- package/src/main/api/zone-data.ts +24 -0
- package/src/main/api/zone-type.ts +59 -0
- package/src/main/db/badge-index.ts +3 -1
- package/src/main/db/badge.ts +3 -2
- package/src/main/db/contact.ts +4 -3
- package/src/main/db/level-range.ts +15 -0
- package/src/main/db/mission.ts +10 -9
- package/src/main/db/set-title-ids.ts +10 -0
- package/src/main/db/zone.ts +29 -0
- package/src/main/index.ts +6 -0
- package/src/test/api/zone-data.fixture.ts +1 -0
- package/src/test/db/badge.test.ts +4 -2
- package/src/test/db/contact.test.ts +2 -1
- package/src/test/db/level-range.test.ts +47 -0
- package/src/test/db/mission.test.ts +8 -6
- package/src/test/db/morality-list.test.ts +1 -1
- package/src/test/db/set-title-ids.test.ts +19 -0
- package/src/test/db/zone.test.ts +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,12 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [2.0.0-rc.
|
|
8
|
+
## [2.0.0-rc.18] - 2025-12-22
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- Introduced a simple indexing and search function for badge names, text, and acquisition info.
|
|
13
13
|
- Enabled formal support for Missions and Contacts in badge requirements.
|
|
14
|
+
- Optional level range and morality to `Zone` data.
|
|
15
|
+
- Formal objects for level range and set title ids.
|
|
14
16
|
- Badges now require a `releaseDate`.
|
|
15
17
|
- Bundle header is now mandatory and requires at least a name, version and last update time.
|
|
16
18
|
- Added GitHub Actions for continuous integration (CI).
|
package/dist/coh-content-db.d.ts
CHANGED
|
@@ -163,6 +163,11 @@ type MoralityExtended = Morality
|
|
|
163
163
|
*/
|
|
164
164
|
| 'all';
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* The id, or a pair of ids [primal, praetorian] that are used with the /settitle command to set a badge
|
|
168
|
+
*/
|
|
169
|
+
type SetTitleData = [number, number?];
|
|
170
|
+
|
|
166
171
|
interface BadgeData {
|
|
167
172
|
/**
|
|
168
173
|
* Unique key used to reference this badge.
|
|
@@ -214,7 +219,7 @@ interface BadgeData {
|
|
|
214
219
|
* The id used with the in-game `/settitle` command to apply the badge.
|
|
215
220
|
* The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
|
|
216
221
|
*/
|
|
217
|
-
readonly setTitleId?:
|
|
222
|
+
readonly setTitleId?: SetTitleData;
|
|
218
223
|
/**
|
|
219
224
|
* A description of the effect the badge will have, such as a buff or granting a temporary power.
|
|
220
225
|
*/
|
|
@@ -229,6 +234,14 @@ interface BadgeData {
|
|
|
229
234
|
readonly ignoreInTotals?: boolean;
|
|
230
235
|
}
|
|
231
236
|
|
|
237
|
+
declare const ZONE_TYPE: readonly ["city", "echo", "tutorial", "trial", "hazard", "mayhem", "safeguard", "mission", "incarnate", "co-op", "pvp", "arena", "building", "other"];
|
|
238
|
+
type ZoneType = typeof ZONE_TYPE[number];
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Can be an array of [min, max], just the [min], or a number representing the minimum value
|
|
242
|
+
*/
|
|
243
|
+
type LevelRangeData = [number, number?] | number;
|
|
244
|
+
|
|
232
245
|
interface ZoneData {
|
|
233
246
|
/**
|
|
234
247
|
* Unique key used to reference this zone.
|
|
@@ -240,6 +253,22 @@ interface ZoneData {
|
|
|
240
253
|
* The name of the zone as it appears in-game.
|
|
241
254
|
*/
|
|
242
255
|
readonly name: string;
|
|
256
|
+
/**
|
|
257
|
+
* The type of zone.
|
|
258
|
+
*/
|
|
259
|
+
readonly type: ZoneType;
|
|
260
|
+
/**
|
|
261
|
+
* The character moralities that this zone is accessible by.
|
|
262
|
+
*/
|
|
263
|
+
readonly morality?: MoralityExtended | MoralityExtended[];
|
|
264
|
+
/**
|
|
265
|
+
* The level range this zone is recommended for.
|
|
266
|
+
*/
|
|
267
|
+
readonly levelRange?: LevelRangeData;
|
|
268
|
+
/**
|
|
269
|
+
* Freeform notes or tips about the zone.
|
|
270
|
+
*/
|
|
271
|
+
readonly notes?: MarkdownString;
|
|
243
272
|
/**
|
|
244
273
|
* List of external links. Wiki, forums, etc.
|
|
245
274
|
*/
|
|
@@ -272,7 +301,7 @@ interface ContactData {
|
|
|
272
301
|
/**
|
|
273
302
|
* The level range this contact will offer missions for.
|
|
274
303
|
*/
|
|
275
|
-
readonly levelRange?:
|
|
304
|
+
readonly levelRange?: LevelRangeData;
|
|
276
305
|
/**
|
|
277
306
|
* Freeform notes or tips about the contact.
|
|
278
307
|
*/
|
|
@@ -286,6 +315,29 @@ interface ContactData {
|
|
|
286
315
|
declare const MISSION_TYPE: readonly ["story-arc", "mission", "task-force", "strike-force", "trial", "personal-story"];
|
|
287
316
|
type MissionType = typeof MISSION_TYPE[number];
|
|
288
317
|
|
|
318
|
+
interface MissionFlashbackData {
|
|
319
|
+
/**
|
|
320
|
+
* The id of the mission as seen in the Flashback menu, i.e. '14.01'.
|
|
321
|
+
*/
|
|
322
|
+
readonly id: string;
|
|
323
|
+
/**
|
|
324
|
+
* The level range this mission appears under as a Flashback.
|
|
325
|
+
*/
|
|
326
|
+
readonly levelRange?: LevelRangeData;
|
|
327
|
+
/**
|
|
328
|
+
* The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
|
|
329
|
+
*/
|
|
330
|
+
readonly name?: string;
|
|
331
|
+
/**
|
|
332
|
+
* The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
|
|
333
|
+
*/
|
|
334
|
+
readonly morality?: MoralityExtended | MoralityExtended[];
|
|
335
|
+
/**
|
|
336
|
+
* Freeform notes or tips about the Flashback version of the mission.
|
|
337
|
+
*/
|
|
338
|
+
readonly notes?: MarkdownString;
|
|
339
|
+
}
|
|
340
|
+
|
|
289
341
|
interface MissionData {
|
|
290
342
|
/**
|
|
291
343
|
* Unique key used to reference this mission.
|
|
@@ -314,7 +366,7 @@ interface MissionData {
|
|
|
314
366
|
/**
|
|
315
367
|
* The level range this mission is available for.
|
|
316
368
|
*/
|
|
317
|
-
readonly levelRange?:
|
|
369
|
+
readonly levelRange?: LevelRangeData;
|
|
318
370
|
/**
|
|
319
371
|
* Freeform notes or tips about the mission.
|
|
320
372
|
*/
|
|
@@ -328,28 +380,6 @@ interface MissionData {
|
|
|
328
380
|
*/
|
|
329
381
|
readonly flashback?: MissionFlashbackData;
|
|
330
382
|
}
|
|
331
|
-
interface MissionFlashbackData {
|
|
332
|
-
/**
|
|
333
|
-
* The id of the mission as seen in the Flashback menu, i.e. '14.01'.
|
|
334
|
-
*/
|
|
335
|
-
readonly id: string;
|
|
336
|
-
/**
|
|
337
|
-
* The level range this mission appears under as a Flashback. Leave undefined if the same as the base mission.
|
|
338
|
-
*/
|
|
339
|
-
readonly levelRange?: [number, number?];
|
|
340
|
-
/**
|
|
341
|
-
* The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
|
|
342
|
-
*/
|
|
343
|
-
readonly name?: string;
|
|
344
|
-
/**
|
|
345
|
-
* The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
|
|
346
|
-
*/
|
|
347
|
-
readonly morality?: MoralityExtended | MoralityExtended[];
|
|
348
|
-
/**
|
|
349
|
-
* Freeform notes or tips about the Flashback version of the mission.
|
|
350
|
-
*/
|
|
351
|
-
readonly notes?: MarkdownString;
|
|
352
|
-
}
|
|
353
383
|
|
|
354
384
|
/**
|
|
355
385
|
* Metadata about a content bundle.
|
|
@@ -554,6 +584,12 @@ declare class MoralityList {
|
|
|
554
584
|
has(morality?: MoralityExtended): boolean;
|
|
555
585
|
}
|
|
556
586
|
|
|
587
|
+
declare class SetTitleIds {
|
|
588
|
+
readonly primal: number;
|
|
589
|
+
readonly praetorian?: number;
|
|
590
|
+
constructor(value: SetTitleData);
|
|
591
|
+
}
|
|
592
|
+
|
|
557
593
|
declare class Badge {
|
|
558
594
|
#private;
|
|
559
595
|
/**
|
|
@@ -604,7 +640,7 @@ declare class Badge {
|
|
|
604
640
|
* The id used with the in-game `/settitle` command to apply the badge.
|
|
605
641
|
* The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
|
|
606
642
|
*/
|
|
607
|
-
readonly setTitleId?:
|
|
643
|
+
readonly setTitleId?: SetTitleIds;
|
|
608
644
|
/**
|
|
609
645
|
* A description of the effect the badge will have, such as a buff or granting a temporary power.
|
|
610
646
|
*/
|
|
@@ -737,6 +773,12 @@ declare class BundleHeader {
|
|
|
737
773
|
constructor(data: BundleHeaderData);
|
|
738
774
|
}
|
|
739
775
|
|
|
776
|
+
declare class LevelRange {
|
|
777
|
+
readonly min: number;
|
|
778
|
+
readonly max?: number;
|
|
779
|
+
constructor(value: LevelRangeData);
|
|
780
|
+
}
|
|
781
|
+
|
|
740
782
|
declare class Zone {
|
|
741
783
|
/**
|
|
742
784
|
* Unique key used to reference this zone.
|
|
@@ -748,6 +790,22 @@ declare class Zone {
|
|
|
748
790
|
* The name of the zone as it appears in-game.
|
|
749
791
|
*/
|
|
750
792
|
readonly name: string;
|
|
793
|
+
/**
|
|
794
|
+
* The type of zone.
|
|
795
|
+
*/
|
|
796
|
+
readonly type: ZoneType;
|
|
797
|
+
/**
|
|
798
|
+
* The character moralities that this zone is accessible by.
|
|
799
|
+
*/
|
|
800
|
+
readonly morality: MoralityList;
|
|
801
|
+
/**
|
|
802
|
+
* The level range this zone is recommended for.
|
|
803
|
+
*/
|
|
804
|
+
readonly levelRange?: LevelRange;
|
|
805
|
+
/**
|
|
806
|
+
* Freeform notes or tips about the zone.
|
|
807
|
+
*/
|
|
808
|
+
readonly notes?: MarkdownString;
|
|
751
809
|
/**
|
|
752
810
|
* List of external links. Wiki, forums, etc.
|
|
753
811
|
*/
|
|
@@ -773,7 +831,7 @@ declare class Contact {
|
|
|
773
831
|
/**
|
|
774
832
|
* The character moralities that this contact will interact with.
|
|
775
833
|
*/
|
|
776
|
-
readonly morality
|
|
834
|
+
readonly morality: MoralityList;
|
|
777
835
|
/**
|
|
778
836
|
* The location of this contact.
|
|
779
837
|
*/
|
|
@@ -781,7 +839,7 @@ declare class Contact {
|
|
|
781
839
|
/**
|
|
782
840
|
* The level range this contact will offer missions for.
|
|
783
841
|
*/
|
|
784
|
-
readonly levelRange?:
|
|
842
|
+
readonly levelRange?: LevelRange;
|
|
785
843
|
/**
|
|
786
844
|
* Freeform notes or tips about the contact.
|
|
787
845
|
*/
|
|
@@ -821,7 +879,7 @@ declare class Mission {
|
|
|
821
879
|
/**
|
|
822
880
|
* The level range this mission is available for.
|
|
823
881
|
*/
|
|
824
|
-
readonly levelRange?:
|
|
882
|
+
readonly levelRange?: LevelRange;
|
|
825
883
|
/**
|
|
826
884
|
* Freeform notes or tips about the mission.
|
|
827
885
|
*/
|
|
@@ -839,17 +897,17 @@ declare class Mission {
|
|
|
839
897
|
*/
|
|
840
898
|
readonly id: string;
|
|
841
899
|
/**
|
|
842
|
-
* The level range this mission appears under as a Flashback.
|
|
900
|
+
* The level range this mission appears under as a Flashback.
|
|
843
901
|
*/
|
|
844
|
-
readonly levelRange?:
|
|
902
|
+
readonly levelRange?: LevelRange;
|
|
845
903
|
/**
|
|
846
|
-
* The name as it appears in the Flashback list.
|
|
904
|
+
* The name as it appears in the Flashback list.
|
|
847
905
|
*/
|
|
848
|
-
readonly name
|
|
906
|
+
readonly name: string;
|
|
849
907
|
/**
|
|
850
|
-
* The character moralities that the mission will appear for in the Flashback list.
|
|
908
|
+
* The character moralities that the mission will appear for in the Flashback list.
|
|
851
909
|
*/
|
|
852
|
-
readonly morality
|
|
910
|
+
readonly morality: MoralityList;
|
|
853
911
|
/**
|
|
854
912
|
* Freeform notes or tips about the Flashback version of the mission.
|
|
855
913
|
*/
|
|
@@ -1000,5 +1058,5 @@ declare function zoneUri(target: string | Zone | ZoneData): string;
|
|
|
1000
1058
|
*/
|
|
1001
1059
|
declare function zoneLink(target: string | Zone | ZoneData): string;
|
|
1002
1060
|
|
|
1003
|
-
export { ALIGNMENT, AlignmentList, Alternates, Archetype, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, BadgeIndex, BadgeRequirement, BundleHeader, CohContentDatabase, Contact, ENHANCEMENT_CATEGORY, Key, Location, MISSION_TYPE, MORALITY, Mission, MoralityList, SEX, Zone, badgeLink, badgeUri, compareAlignment, compareByDefaultName, compareByReleaseDate, compareByZoneKey, compareSex, contactLink, contactUri, missionLink, missionUri, zoneLink, zoneUri };
|
|
1004
|
-
export type { Alignment, AlignmentExtended, AlternateData, ArchetypeData, BadgeData, BadgeQueryableField, BadgeRequirementData, BadgeRequirementType, BadgeSearchOptions, BadgeSort, BadgeType, BundleData, BundleHeaderData, ContactData, Coords, EnhancementCategory, Link, LocationData, LocationIcon, MarkdownString, MissionData, MissionFlashbackData, MissionType, Morality, MoralityExtended, Paged, Sex, ZoneData };
|
|
1061
|
+
export { ALIGNMENT, AlignmentList, Alternates, Archetype, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, BadgeIndex, BadgeRequirement, BundleHeader, CohContentDatabase, Contact, ENHANCEMENT_CATEGORY, Key, LevelRange, Location, MISSION_TYPE, MORALITY, Mission, MoralityList, SEX, SetTitleIds, ZONE_TYPE, Zone, badgeLink, badgeUri, compareAlignment, compareByDefaultName, compareByReleaseDate, compareByZoneKey, compareSex, contactLink, contactUri, missionLink, missionUri, zoneLink, zoneUri };
|
|
1062
|
+
export type { Alignment, AlignmentExtended, AlternateData, ArchetypeData, BadgeData, BadgeQueryableField, BadgeRequirementData, BadgeRequirementType, BadgeSearchOptions, BadgeSort, BadgeType, BundleData, BundleHeaderData, ContactData, Coords, EnhancementCategory, LevelRangeData, Link, LocationData, LocationIcon, MarkdownString, MissionData, MissionFlashbackData, MissionType, Morality, MoralityExtended, Paged, SetTitleData, Sex, ZoneData, ZoneType };
|