coh-content-db 2.0.0-rc.6 → 2.0.0-rc.7

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 (65) hide show
  1. package/README.md +3 -3
  2. package/dist/coh-content-db.d.ts +384 -181
  3. package/dist/coh-content-db.js +604 -348
  4. package/dist/coh-content-db.js.map +1 -1
  5. package/dist/coh-content-db.mjs +592 -347
  6. package/dist/coh-content-db.mjs.map +1 -1
  7. package/eslint.config.mjs +1 -0
  8. package/package.json +1 -1
  9. package/src/main/api/alignment.ts +18 -2
  10. package/src/main/api/badge-data.ts +12 -42
  11. package/src/main/api/badge-requirement-data.ts +17 -35
  12. package/src/main/api/badge-requirement-type.ts +28 -7
  13. package/src/main/api/badge-type.ts +15 -15
  14. package/src/main/api/contact-data.ts +7 -5
  15. package/src/main/api/content-bundle.ts +6 -0
  16. package/src/main/api/enhancement-category.ts +26 -26
  17. package/src/main/api/location-data.ts +28 -0
  18. package/src/main/api/mission-data.ts +83 -0
  19. package/src/main/api/mission-type.ts +2 -0
  20. package/src/main/api/morality.ts +31 -0
  21. package/src/main/api/sex.ts +8 -1
  22. package/src/main/api/zone-data.ts +1 -1
  23. package/src/main/changelog.ts +5 -4
  24. package/src/main/db/alignment-list.ts +54 -0
  25. package/src/main/db/alternates.ts +15 -32
  26. package/src/main/db/badge-index.ts +11 -36
  27. package/src/main/db/badge-requirement.ts +22 -43
  28. package/src/main/db/badge-search-options.ts +4 -4
  29. package/src/main/db/badge.ts +53 -54
  30. package/src/main/db/coh-content-database.ts +28 -24
  31. package/src/main/db/contact.ts +17 -14
  32. package/src/main/db/location.ts +30 -0
  33. package/src/main/db/mission.ts +107 -0
  34. package/src/main/db/morality-list.ts +99 -0
  35. package/src/main/db/zone.ts +1 -1
  36. package/src/main/index.ts +8 -3
  37. package/src/main/util.ts +43 -3
  38. package/src/test/api/alignment.test.ts +38 -4
  39. package/src/test/api/badge-data.fixture.ts +1 -17
  40. package/src/test/api/badge-data.test.ts +3 -3
  41. package/src/test/api/badge-requirement-data.fixture.ts +1 -11
  42. package/src/test/api/badge-requirement-type.test.ts +3 -3
  43. package/src/test/api/badge-type.test.ts +5 -5
  44. package/src/test/api/contact-data.fixture.ts +0 -6
  45. package/src/test/api/content-bundle.fixture.ts +1 -17
  46. package/src/test/api/enhancement-category.test.ts +5 -5
  47. package/src/test/api/mission-data.fixture.ts +12 -0
  48. package/src/test/api/sex.test.ts +33 -1
  49. package/src/test/api/zone-data.fixture.ts +1 -1
  50. package/src/test/db/alignment-list.test.ts +200 -0
  51. package/src/test/db/alternates.test.ts +60 -56
  52. package/src/test/db/badge-index.test.ts +82 -72
  53. package/src/test/db/badge-requirement.test.ts +35 -70
  54. package/src/test/db/badge.test.ts +185 -64
  55. package/src/test/db/coh-content-database.test.ts +58 -69
  56. package/src/test/db/contact.test.ts +25 -24
  57. package/src/test/db/location.test.ts +51 -0
  58. package/src/test/db/mission.test.ts +171 -0
  59. package/src/test/db/morality-list.test.ts +457 -0
  60. package/src/test/db/zone.test.ts +4 -4
  61. package/src/test/util.test.ts +54 -1
  62. package/src/main/api/plaque-type.ts +0 -6
  63. package/src/main/db/alignments.ts +0 -17
  64. package/src/test/api/alignments.test.ts +0 -40
  65. package/src/test/api/plaque-type.test.ts +0 -31
@@ -1,8 +1,19 @@
1
- declare const ALIGNMENT: readonly ["H", "V", "P"];
1
+ declare const ALIGNMENT: readonly ["hero", "villain", "praetorian"];
2
2
  type Alignment = typeof ALIGNMENT[number];
3
+ type AlignmentExtended = Alignment
4
+ /**
5
+ * The alignments available for Primal Earth characters - Hero and Villain.
6
+ */
7
+ | 'primal'
8
+ /**
9
+ * All the alignments.
10
+ */
11
+ | 'all';
12
+ declare function compareAlignment(a?: Alignment, b?: Alignment): number;
3
13
 
4
14
  declare const SEX: readonly ["M", "F"];
5
15
  type Sex = typeof SEX[number];
16
+ declare function compareSex(a?: Sex, b?: Sex): number;
6
17
 
7
18
  /**
8
19
  * Some badge values differ based on the alignment or sex of the character.
@@ -28,15 +39,12 @@ interface ArchetypeData {
28
39
  readonly description?: string;
29
40
  }
30
41
 
31
- declare const ENHANCEMENT_CATEGORY: readonly ["DEFENSE_DEBUFF", "TO_HIT_DEBUFF", "TAUNT", "CONFUSE", "HEALING", "DEFENSE_BUFF", "RESIST_DAMAGE", "INTANGIBILITY", "SLEEP", "SLOW", "HOLD", "STUN", "IMMOBILIZE", "FEAR", "ENDURANCE_MODIFICATION", "ENDURANCE_REDUCTION", "RECHARGE_REDUCTION", "INTERRUPT_DURATION", "ACCURACY", "TO_HIT_BUFF", "DAMAGE", "KNOCKBACK", "RUN_SPEED", "JUMP", "FLY_SPEED", "RANGE"];
42
+ declare const ENHANCEMENT_CATEGORY: readonly ["defense-debuff", "to-hit-debuff", "taunt", "confuse", "healing", "defense-buff", "resist-damage", "intangibility", "sleep", "slow", "hold", "stun", "immobilize", "fear", "endurance-modification", "endurance-reduction", "recharge-reduction", "interrupt-duration", "accuracy", "to-hit-buff", "damage", "knockback", "run-speed", "jump", "fly-speed", "range"];
32
43
  type EnhancementCategory = typeof ENHANCEMENT_CATEGORY[number];
33
44
 
34
- declare const BADGE_REQUIREMENT_TYPE: readonly ["PLAQUE", "BADGE", "INVENTION", "MISSION", "ARC", "TASK_FORCE", "INVENTION_PLUS_ONE"];
45
+ declare const BADGE_REQUIREMENT_TYPE: readonly ["badge", "invention", "invention-plus-one", "location", "monument", "mission", "task"];
35
46
  type BadgeRequirementType = typeof BADGE_REQUIREMENT_TYPE[number];
36
47
 
37
- declare const PLAQUE_TYPE: string[];
38
- type PlaqueType = typeof PLAQUE_TYPE[number];
39
-
40
48
  /**
41
49
  * Tage type to indicate that a string will accept {@link https://www.markdownguide.org/|Markdown} format.
42
50
  */
@@ -47,61 +55,71 @@ interface Link {
47
55
  href: string;
48
56
  }
49
57
 
50
- interface BadgeRequirementData {
58
+ interface LocationData {
51
59
  /**
52
- * Key.
60
+ * Key of the {@link Zone} that the location references.
53
61
  */
54
- readonly key: string;
62
+ readonly zoneKey?: string;
55
63
  /**
56
- * Type of requirement.
64
+ * In-game `/loc` coordinates of the location.
57
65
  */
58
- readonly type: BadgeRequirementType;
66
+ readonly coords?: Coords;
59
67
  /**
60
- * Zone the requirement is located in.
68
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
61
69
  */
62
- readonly zoneKey?: string;
70
+ readonly icon?: LocationIcon;
63
71
  /**
64
- * /loc coordinates.
72
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
65
73
  */
66
- readonly loc?: number[];
74
+ readonly iconText?: string;
75
+ }
76
+ /**
77
+ * Coordinates as they appear using the in-game `/loc` command.
78
+ */
79
+ type Coords = [number, number, number];
80
+ type LocationIcon = 'badge' | 'plaque' | 'pedestal' | 'object';
81
+
82
+ interface BadgeRequirementData {
67
83
  /**
68
- * Is it a wall plaque or a physical monument?
84
+ * Unique key used to reference this badge requirement.
85
+ *
86
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
69
87
  */
70
- readonly plaqueType?: PlaqueType;
88
+ readonly key: string;
71
89
  /**
72
- * Plaque inscription.
90
+ * The requirement type.
73
91
  */
74
- readonly plaqueInscription?: string;
92
+ readonly type: BadgeRequirementType;
75
93
  /**
76
- * The number or letter the plaque appears as on Vidiot Maps.
94
+ * If the requirement involves a location, where it is.
77
95
  */
78
- readonly vidiotMapKey?: string;
96
+ readonly location?: LocationData | LocationData[];
79
97
  /**
80
- * The key of the badge for this requirement.
98
+ * If the requirement involves a badge, the badge key.
81
99
  */
82
100
  readonly badgeKey?: string;
83
101
  /**
84
- * Mission name.
102
+ * If the requirement involves a mission, the mission key.
85
103
  */
86
- readonly missionName?: string;
104
+ readonly missionKey?: string;
87
105
  /**
88
- * {@link Contact} key for the story arc.
106
+ * If the requirement involves a monument, the text that is displayed thereon.
89
107
  */
90
- readonly contactKey?: string;
108
+ readonly monumentText?: string;
91
109
  /**
92
- * Level of the invention required.
110
+ * If the requirement involves crafting an invention, the Level of the invention required.
93
111
  */
94
112
  readonly inventionLevel?: number;
95
113
  /**
96
- * The types of enhancements required to be crafted.
114
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
97
115
  */
98
116
  readonly inventionTypes?: EnhancementCategory[];
99
117
  /**
100
- * Number of invention crafts required.
118
+ * Number of times the task needs to be repeated.
101
119
  */
102
- readonly inventionCount?: number;
120
+ readonly count?: number;
103
121
  /**
104
- * Any additional notes.
122
+ * Additional information about the requirement.
105
123
  */
106
124
  readonly notes?: MarkdownString;
107
125
  /**
@@ -110,14 +128,46 @@ interface BadgeRequirementData {
110
128
  readonly links?: Link[];
111
129
  }
112
130
 
113
- declare const BADGE_TYPE: readonly ["EXPLORATION", "HISTORY", "ACCOMPLISHMENT", "ACHIEVEMENT", "ACCOLADE", "GLADIATOR", "VETERAN", "PVP", "INVENTION", "DEFEAT", "EVENT", "OUROBOROS", "CONSIGNMENT", "DAY_JOB", "AE"];
131
+ declare const BADGE_TYPE: readonly ["exploration", "history", "accomplishment", "achievement", "accolade", "gladiator", "veteran", "pvp", "invention", "defeat", "event", "ouroboros", "consignment", "day-job", "architect-entertainment"];
114
132
  type BadgeType = typeof BADGE_TYPE[number];
115
133
 
134
+ declare const MORALITY: readonly ["hero", "vigilante", "villain", "rogue", "resistance", "loyalist"];
135
+ type Morality = typeof MORALITY[number];
136
+ type MoralityExtended = Morality
137
+ /**
138
+ * Any of the Primal Earth moralities - Hero, Vigilante, Villain, Rogue.
139
+ */
140
+ | 'primal'
141
+ /**
142
+ * Either of the Praetorian Earth moralities - Resistance or Loyalist.
143
+ */
144
+ | 'praetorian'
145
+ /**
146
+ * The moralities that roll up to the Hero {@link Alignment} - Hero and Vigilante.
147
+ */
148
+ | 'heroic'
149
+ /**
150
+ * The moralities that roll up to the Villain {@link Alignment} - Villain and Rogue.
151
+ */
152
+ | 'villainous'
153
+ /**
154
+ * Moralities with access to Paragon City - Hero, Vigilante and Rogue.
155
+ */
156
+ | 'paragon-city-access'
157
+ /**
158
+ * Moralities with access to the Rogue Isles - Villain, Rogue and Vigilante.
159
+ */
160
+ | 'rogue-isles-access'
161
+ /**
162
+ * All the moralities.
163
+ */
164
+ | 'all';
165
+
116
166
  interface BadgeData {
117
167
  /**
118
168
  * Unique key used to reference this badge.
119
169
  *
120
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
170
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
121
171
  */
122
172
  readonly key: string;
123
173
  /**
@@ -129,15 +179,15 @@ interface BadgeData {
129
179
  *
130
180
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
131
181
  */
132
- readonly name: AlternateData<string>[];
182
+ readonly name: string | AlternateData<string>[];
133
183
  /**
134
- * The character alignments that this badge is available to.
184
+ * The {@link MoralityExtended|moralities} that this badge is available to. If undefined then all moralities will be assumed.
135
185
  */
136
- readonly alignment: Alignment[];
186
+ readonly morality?: MoralityExtended | MoralityExtended[];
137
187
  /**
138
188
  * The badge text as it appears in-game. May vary by character sex or alignment.
139
189
  */
140
- readonly badgeText?: AlternateData<string>[];
190
+ readonly badgeText?: AlternateData<MarkdownString>[] | MarkdownString;
141
191
  /**
142
192
  * Short description of how to acquire the badge. Detailed instructions should go in the notes field.
143
193
  */
@@ -147,7 +197,7 @@ interface BadgeData {
147
197
  *
148
198
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
149
199
  */
150
- readonly icon?: AlternateData<string>[];
200
+ readonly icon?: string | AlternateData<string>[];
151
201
  /**
152
202
  * Freeform notes or tips about the badge.
153
203
  */
@@ -157,45 +207,18 @@ interface BadgeData {
157
207
  */
158
208
  readonly links?: Link[];
159
209
  /**
160
- * For exploration badges, the key of the {@link ZoneData|Zone} that this badge is found on.
161
- */
162
- readonly zoneKey?: string;
163
- /**
164
- * For exploration badges, the `/loc` coordinates of the badge.
165
- */
166
- readonly loc?: [number, number, number];
167
- /**
168
- * For plaques that appear on a Vidiot Map, the number or letter the badge appears as.
210
+ * The id used with the in-game `/settitle` command to apply the badge.
211
+ * The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
169
212
  */
170
- readonly vidiotMapKey?: string;
171
- /**
172
- * ID used with the in-game `/settitle` command to apply the badge.
173
- */
174
- readonly setTitle?: {
175
- /**
176
- * `/settitle` id.
177
- */
178
- id?: number;
179
- /**
180
- * `/settitle` id if different for praetorian characters.
181
- */
182
- praetorianId?: number;
183
- };
213
+ readonly setTitleId?: [number, number?];
184
214
  /**
185
215
  * A description of the effect the badge will have, such as a buff or granting a temporary power.
186
216
  */
187
217
  readonly effect?: MarkdownString;
188
218
  /**
189
- * Represents the layered requirements for badges with multiple fulfillment steps,
190
- * such as visiting plaques for history badges or collecting other badges.
191
- *
192
- * The outer array represents groups of requirements evaluated with OR logic —
193
- * fulfilling any group satisfies the badge.
194
- *
195
- * Each inner array represents individual requirements evaluated with AND logic —
196
- * all conditions in the group must be met.
219
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
197
220
  */
198
- readonly requirements?: BadgeRequirementData[][];
221
+ readonly requirements?: BadgeRequirementData[];
199
222
  /**
200
223
  * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
201
224
  */
@@ -221,7 +244,7 @@ interface ContactData {
221
244
  /**
222
245
  * Unique key used to reference this contact.
223
246
  *
224
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
247
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
225
248
  */
226
249
  readonly key: string;
227
250
  /**
@@ -233,13 +256,13 @@ interface ContactData {
233
256
  */
234
257
  readonly title?: string;
235
258
  /**
236
- * The zone this character is located in.
259
+ * The character moralities that this contact will interact with.
237
260
  */
238
- readonly zoneKey?: string;
261
+ readonly morality?: MoralityExtended | MoralityExtended[];
239
262
  /**
240
- * The `/loc` coordinates of the contact.
263
+ * The location of this contact.
241
264
  */
242
- readonly loc?: [number, number, number];
265
+ readonly location?: LocationData;
243
266
  /**
244
267
  * The level range this contact will offer missions for.
245
268
  */
@@ -258,7 +281,7 @@ interface ZoneData {
258
281
  /**
259
282
  * Unique key used to reference this zone.
260
283
  *
261
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
284
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
262
285
  */
263
286
  readonly key: string;
264
287
  /**
@@ -271,6 +294,74 @@ interface ZoneData {
271
294
  readonly links?: Link[];
272
295
  }
273
296
 
297
+ declare const MISSION_TYPE: readonly ["story-arc", "mission", "task-force", "strike-force", "trial", "personal-story"];
298
+ type MissionType = typeof MISSION_TYPE[number];
299
+
300
+ interface MissionData {
301
+ /**
302
+ * Unique key used to reference this mission.
303
+ *
304
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
305
+ */
306
+ readonly key: string;
307
+ /**
308
+ * The name of the mission as it appears from the contact.
309
+ *
310
+ * The name may be different when viewed in Ouroboros as a Flashback.
311
+ */
312
+ readonly name: string;
313
+ /**
314
+ * The type of mission... Story arc, task force, trial, etc.
315
+ */
316
+ readonly type: MissionType;
317
+ /**
318
+ * The character moralities that may accept the mission.
319
+ */
320
+ readonly morality?: MoralityExtended | MoralityExtended[];
321
+ /**
322
+ * The keys of any contacts that provide this mission.
323
+ */
324
+ readonly contactKeys?: string | string[];
325
+ /**
326
+ * The level range this mission is available for.
327
+ */
328
+ readonly levelRange?: [number, number?];
329
+ /**
330
+ * Freeform notes or tips about the mission.
331
+ */
332
+ readonly notes?: MarkdownString;
333
+ /**
334
+ * List of external links. Wiki, forums, etc.
335
+ */
336
+ readonly links?: Link[];
337
+ /**
338
+ * If the mission is available in Ouroboros as a Flashback.
339
+ */
340
+ readonly flashback?: MissionFlashbackData;
341
+ }
342
+ interface MissionFlashbackData {
343
+ /**
344
+ * The id of the mission as seen in the Flashback menu, i.e. '14.01'.
345
+ */
346
+ readonly id: string;
347
+ /**
348
+ * The level range this mission appears under as a Flashback. Leave undefined if the same as the base mission.
349
+ */
350
+ readonly levelRange?: [number, number?];
351
+ /**
352
+ * The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
353
+ */
354
+ readonly name?: string;
355
+ /**
356
+ * The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
357
+ */
358
+ readonly morality?: MoralityExtended | MoralityExtended[];
359
+ /**
360
+ * Freeform notes or tips about the Flashback version of the mission.
361
+ */
362
+ readonly notes?: MarkdownString;
363
+ }
364
+
274
365
  /**
275
366
  * A content bundle holds the data that makes up one forked instance of the game since the original sunset, such as Homecoming (https://forums.homecomingservers.com/).
276
367
  */
@@ -308,6 +399,10 @@ interface ContentBundle {
308
399
  * List of contacts available in this fork.
309
400
  */
310
401
  readonly contacts?: ContactData[];
402
+ /**
403
+ * List of missions available in this fork.
404
+ */
405
+ readonly missions?: MissionData[];
311
406
  /**
312
407
  * List of badges available on this fork.
313
408
  */
@@ -318,18 +413,25 @@ interface ContentBundle {
318
413
  readonly changelog?: Change[];
319
414
  }
320
415
 
321
- declare class Alignments {
322
- readonly items: Alignment[];
416
+ declare class AlignmentList {
417
+ #private;
323
418
  readonly hero: boolean;
324
419
  readonly villain: boolean;
325
420
  readonly praetorian: boolean;
326
421
  readonly primal: boolean;
327
- constructor(raw: Alignment[]);
422
+ readonly all: boolean;
423
+ constructor(items?: AlignmentExtended[]);
424
+ get items(): Alignment[];
425
+ has(alignment?: AlignmentExtended): boolean;
328
426
  }
329
427
 
330
428
  declare class Alternates<T> {
331
429
  #private;
332
- constructor(values: AlternateData<T>[]);
430
+ /**
431
+ * Create an alternate set from either a list of categorized values, or a single value when there are no alternates.
432
+ * @param value List of alternates, or a single value.
433
+ */
434
+ constructor(value: AlternateData<T>[] | T);
333
435
  getValue(alignment?: Alignment, sex?: Sex): T | undefined;
334
436
  /**
335
437
  * Get the default value for this list of alternates, the value with the highest priority and lowest specificity.
@@ -353,61 +455,67 @@ declare class Archetype {
353
455
  constructor(data: ArchetypeData);
354
456
  }
355
457
 
356
- declare class BadgeRequirement {
458
+ declare class Location {
357
459
  /**
358
- * Key.
460
+ * Key of the {@link Zone} that the location references.
359
461
  */
360
- readonly key: string;
462
+ readonly zoneKey?: string;
361
463
  /**
362
- * Type of requirement.
464
+ * In-game `/loc` coordinates of the location.
363
465
  */
364
- readonly type: BadgeRequirementType;
466
+ readonly coords?: Coords;
365
467
  /**
366
- * Zone the requirement is located in.
468
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
367
469
  */
368
- readonly zoneKey?: string;
470
+ readonly icon?: LocationIcon;
369
471
  /**
370
- * /loc coordinates.
472
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
371
473
  */
372
- readonly loc?: number[];
474
+ readonly iconText?: string;
475
+ constructor(data: LocationData);
476
+ }
477
+
478
+ declare class BadgeRequirement {
373
479
  /**
374
- * Is it a wall plaque or a physical monument?
480
+ * Unique key used to reference this badge requirement.
481
+ *
482
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
375
483
  */
376
- readonly plaqueType?: PlaqueType;
484
+ readonly key: string;
377
485
  /**
378
- * Plaque inscription.
486
+ * The requirement type.
379
487
  */
380
- readonly plaqueInscription?: string;
488
+ readonly type: BadgeRequirementType;
381
489
  /**
382
- * The number or letter the plaque appears as on Vidiot Maps.
490
+ * If the requirement involves a location, where it is.
383
491
  */
384
- readonly vidiotMapKey?: string;
492
+ readonly location?: Location[];
385
493
  /**
386
- * The key of the badge for this requirement.
494
+ * If the requirement involves a badge, the badge key.
387
495
  */
388
496
  readonly badgeKey?: string;
389
497
  /**
390
- * Mission name.
498
+ * If the requirement involves a mission, the mission key.
391
499
  */
392
- readonly missionName?: string;
500
+ readonly missionKey?: string;
393
501
  /**
394
- * {@link Contact} key for the story arc.
502
+ * If the requirement involves a monument, the text that is displayed thereon.
395
503
  */
396
- readonly contactKey?: string;
504
+ readonly monumentText?: string;
397
505
  /**
398
- * Level of the invention required.
506
+ * If the requirement involves crafting an invention, the Level of the invention required.
399
507
  */
400
508
  readonly inventionLevel?: number;
401
509
  /**
402
- * The types of enhancements required to be crafted.
510
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
403
511
  */
404
512
  readonly inventionTypes?: EnhancementCategory[];
405
513
  /**
406
- * Number of invention crafts required.
514
+ * Number of times the task needs to be repeated.
407
515
  */
408
- readonly inventionCount?: number;
516
+ readonly count?: number;
409
517
  /**
410
- * Any additional notes.
518
+ * Additional information about the requirement.
411
519
  */
412
520
  readonly notes?: MarkdownString;
413
521
  /**
@@ -417,6 +525,26 @@ declare class BadgeRequirement {
417
525
  constructor(data: BadgeRequirementData);
418
526
  }
419
527
 
528
+ declare class MoralityList {
529
+ #private;
530
+ readonly hero: boolean;
531
+ readonly vigilante: boolean;
532
+ readonly villain: boolean;
533
+ readonly rogue: boolean;
534
+ readonly resistance: boolean;
535
+ readonly loyalist: boolean;
536
+ readonly primal: boolean;
537
+ readonly praetorian: boolean;
538
+ readonly heroic: boolean;
539
+ readonly villainous: boolean;
540
+ readonly paragonCityAccess: boolean;
541
+ readonly rogueIslesAccess: boolean;
542
+ readonly all: boolean;
543
+ constructor(items?: MoralityExtended[]);
544
+ get items(): Morality[];
545
+ has(morality?: MoralityExtended): boolean;
546
+ }
547
+
420
548
  declare class Badge {
421
549
  #private;
422
550
  /**
@@ -434,13 +562,13 @@ declare class Badge {
434
562
  */
435
563
  readonly name: Alternates<string>;
436
564
  /**
437
- * The character alignments that this badge is available to.
565
+ * The character moralities that this badge is available to.
438
566
  */
439
- readonly alignment: Alignments;
567
+ readonly morality: MoralityList;
440
568
  /**
441
569
  * The badge text as it appears in-game. May vary by character sex or alignment.
442
570
  */
443
- readonly badgeText: Alternates<string>;
571
+ readonly badgeText: Alternates<MarkdownString>;
444
572
  /**
445
573
  * Short description of how to acquire the badge. Detailed instructions will be in the notes field.
446
574
  */
@@ -460,52 +588,35 @@ declare class Badge {
460
588
  */
461
589
  readonly links: Link[];
462
590
  /**
463
- * For exploration badges, the key of the {@link Zone} that this badge is found on.
464
- */
465
- readonly zoneKey?: string;
466
- /**
467
- * For exploration badges, the `/loc` coordinates of the badge.
468
- */
469
- readonly loc?: [number, number, number];
470
- /**
471
- * For plaques that appear on a Vidiot Map, the number or letter the badge appears as.
472
- */
473
- readonly vidiotMapKey?: string;
474
- /**
475
- * ID used with the in-game `/settitle` command to apply the badge.
591
+ * The id used with the in-game `/settitle` command to apply the badge.
592
+ * The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
476
593
  */
477
- readonly setTitle?: {
478
- /**
479
- * `/settitle` id.
480
- */
481
- id?: number;
482
- /**
483
- * `/settitle` id if different for praetorian characters.
484
- */
485
- praetorianId?: number;
486
- };
594
+ readonly setTitleId?: [number, number?];
487
595
  /**
488
596
  * A description of the effect the badge will have, such as a buff or granting a temporary power.
489
597
  */
490
598
  readonly effect?: MarkdownString;
491
599
  /**
492
- * Represents the layered requirements for badges with multiple fulfillment steps,
493
- * such as visiting plaques for history badges or collecting other badges.
494
- *
495
- * The outer array represents groups of requirements evaluated with OR logic —
496
- * fulfilling any group satisfies the badge.
497
- *
498
- * Each inner array represents individual requirements evaluated with AND logic —
499
- * all conditions in the group must be met.
600
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
500
601
  */
501
- readonly requirements?: BadgeRequirement[][];
602
+ readonly requirements?: BadgeRequirement[];
502
603
  /**
503
604
  * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
504
605
  */
505
606
  readonly ignoreInTotals: boolean;
506
607
  constructor(badgeData: BadgeData);
507
608
  getRequirement(key: string): BadgeRequirement;
609
+ /**
610
+ * Return a list of all the zone keys referenced by this badge.
611
+ */
612
+ get zoneKeys(): string[];
613
+ /**
614
+ * The zone key if this badge relates to a single zone.
615
+ */
616
+ get zoneKey(): string | undefined;
508
617
  }
618
+ declare function compareByDefaultName(a?: Badge, b?: Badge): number;
619
+ declare function compareByZoneKey(a?: Badge, b?: Badge): number;
509
620
 
510
621
  interface BadgeSearchOptions {
511
622
  /**
@@ -530,7 +641,7 @@ interface BadgeSearchOptions {
530
641
  filter?: {
531
642
  type?: BadgeType;
532
643
  zoneKey?: string;
533
- alignment?: Alignment;
644
+ morality?: MoralityExtended;
534
645
  };
535
646
  /**
536
647
  * Sort results.
@@ -538,8 +649,8 @@ interface BadgeSearchOptions {
538
649
  * Badges are assumed to be in canonical order in the content bundle, and should match the in-game display order.
539
650
  */
540
651
  sort?: {
541
- by?: 'CANONICAL' | 'BADGE_NAME' | 'ZONE_NAME';
542
- dir?: 'ASC' | 'DESC';
652
+ by?: 'canonical' | 'badge-name' | 'zone-key';
653
+ dir?: 'asc' | 'desc';
543
654
  };
544
655
  /**
545
656
  * The page (1-based)
@@ -551,24 +662,6 @@ interface BadgeSearchOptions {
551
662
  pageSize?: number;
552
663
  }
553
664
 
554
- declare class Zone {
555
- /**
556
- * Unique key used to reference this zone.
557
- *
558
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
559
- */
560
- readonly key: string;
561
- /**
562
- * The name of the zone as it appears in-game.
563
- */
564
- readonly name: string;
565
- /**
566
- * List of external links. Wiki, forums, etc.
567
- */
568
- readonly links: Link[];
569
- constructor(data: ZoneData);
570
- }
571
-
572
665
  interface Paged<T> {
573
666
  items: T[];
574
667
  page: number;
@@ -579,9 +672,8 @@ interface Paged<T> {
579
672
 
580
673
  declare class BadgeIndex {
581
674
  #private;
582
- constructor(badges: Badge[], zones?: Zone[]);
583
- getBadge(key: string): Badge;
584
- badgeExists(key: string): boolean;
675
+ constructor(badges: Badge[]);
676
+ getBadge(key?: string): Badge | undefined;
585
677
  searchBadges(options?: BadgeSearchOptions): Paged<Badge>;
586
678
  }
587
679
 
@@ -609,11 +701,29 @@ declare class BundleMetadata {
609
701
  constructor(bundle: ContentBundle);
610
702
  }
611
703
 
704
+ declare class Zone {
705
+ /**
706
+ * Unique key used to reference this zone.
707
+ *
708
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
709
+ */
710
+ readonly key: string;
711
+ /**
712
+ * The name of the zone as it appears in-game.
713
+ */
714
+ readonly name: string;
715
+ /**
716
+ * List of external links. Wiki, forums, etc.
717
+ */
718
+ readonly links: Link[];
719
+ constructor(data: ZoneData);
720
+ }
721
+
612
722
  declare class Contact {
613
723
  /**
614
724
  * Unique key used to reference this contact.
615
725
  *
616
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
726
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
617
727
  */
618
728
  readonly key: string;
619
729
  /**
@@ -625,13 +735,13 @@ declare class Contact {
625
735
  */
626
736
  readonly title?: string;
627
737
  /**
628
- * The zone this character is located in.
738
+ * The character moralities that this contact will interact with.
629
739
  */
630
- readonly zoneKey?: string;
740
+ readonly morality?: MoralityList;
631
741
  /**
632
- * The `/loc` coordinates of the contact.
742
+ * The location of this contact.
633
743
  */
634
- readonly loc?: [number, number, number];
744
+ readonly location?: Location;
635
745
  /**
636
746
  * The level range this contact will offer missions for.
637
747
  */
@@ -644,7 +754,72 @@ declare class Contact {
644
754
  * List of external links. Wiki, forums, etc.
645
755
  */
646
756
  readonly links: Link[];
647
- constructor(contactData: ContactData);
757
+ constructor(data: ContactData);
758
+ }
759
+
760
+ declare class Mission {
761
+ /**
762
+ * Unique key used to reference this mission.
763
+ *
764
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
765
+ */
766
+ readonly key: string;
767
+ /**
768
+ * The name of the mission as it appears from the contact.
769
+ *
770
+ * The name may be different when viewed in Ouroboros as a Flashback.
771
+ */
772
+ readonly name: string;
773
+ /**
774
+ * The type of mission... Story arc, task force, trial, etc.
775
+ */
776
+ readonly type: MissionType;
777
+ /**
778
+ * The character moralities that may accept the mission.
779
+ */
780
+ readonly morality: MoralityList;
781
+ /**
782
+ * The keys of any contacts that provide this mission.
783
+ */
784
+ readonly contactKeys?: string[];
785
+ /**
786
+ * The level range this mission is available for.
787
+ */
788
+ readonly levelRange?: [number, number?];
789
+ /**
790
+ * Freeform notes or tips about the mission.
791
+ */
792
+ readonly notes?: MarkdownString;
793
+ /**
794
+ * List of external links. Wiki, forums, etc.
795
+ */
796
+ readonly links: Link[];
797
+ /**
798
+ * If the mission is available in Ouroboros as a Flashback.
799
+ */
800
+ readonly flashback?: {
801
+ /**
802
+ * The id of the mission as seen in the Flashback menu, i.e. '14.01'.
803
+ */
804
+ readonly id: string;
805
+ /**
806
+ * The level range this mission appears under as a Flashback. Leave undefined if the same as the base mission.
807
+ */
808
+ readonly levelRange?: [number, number?];
809
+ /**
810
+ * The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
811
+ */
812
+ readonly name?: string;
813
+ /**
814
+ * The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
815
+ */
816
+ readonly morality?: MoralityList;
817
+ /**
818
+ * Freeform notes or tips about the Flashback version of the mission.
819
+ */
820
+ readonly notes?: MarkdownString;
821
+ };
822
+ constructor(data: MissionData);
648
823
  }
649
824
 
650
825
  declare class CohContentDatabase {
@@ -671,6 +846,10 @@ declare class CohContentDatabase {
671
846
  * List of contacts.
672
847
  */
673
848
  readonly contacts: Contact[];
849
+ /**
850
+ * List of missions.
851
+ */
852
+ readonly missions: Contact[];
674
853
  /**
675
854
  * List of badges.
676
855
  */
@@ -680,13 +859,11 @@ declare class CohContentDatabase {
680
859
  * @param bundle The data to load.
681
860
  */
682
861
  constructor(bundle: ContentBundle);
683
- getArchetype(key: string): Archetype;
684
- getZone(key: string): Zone;
685
- getContact(key: string): Contact;
686
- zoneExists(key: string): boolean;
687
- contactExists(key: string): boolean;
688
- getBadge(key: string): Badge;
689
- badgeExists(key: string): boolean;
862
+ getArchetype(key?: string): Archetype | undefined;
863
+ getZone(key?: string): Zone | undefined;
864
+ getContact(key?: string): Contact | undefined;
865
+ getMission(key?: string): Mission | undefined;
866
+ getBadge(key?: string): Badge | undefined;
690
867
  /**
691
868
  * Search, sort and filter the badge list.
692
869
  * This is a fairly brute-forced approach and will not be as performant as loading the badge data into a traditional
@@ -705,7 +882,7 @@ declare class Key {
705
882
  declare const CHANGELOG: Change[];
706
883
 
707
884
  /**
708
- * Returns the URI of the given badge that can be used in {@link MarkdownString} links.
885
+ * Returns the URI of the given badge that can be used in {@link MarkdownString} fields.
709
886
  *
710
887
  * URI format: `badge://<key>`
711
888
  *
@@ -721,7 +898,7 @@ declare function badgeUri(target: string | Badge | BadgeData): string;
721
898
  */
722
899
  declare function badgeLink(target: string | Badge | BadgeData): string;
723
900
  /**
724
- * Returns the URI of the given contact that can be used in {@link MarkdownString} links.
901
+ * Returns the URI of the given contact that can be used in {@link MarkdownString} fields.
725
902
  *
726
903
  * URI format: `contact://<key>`
727
904
  *
@@ -737,7 +914,23 @@ declare function contactUri(target: string | Contact | ContactData): string;
737
914
  */
738
915
  declare function contactLink(target: string | Contact | ContactData): string;
739
916
  /**
740
- * Returns the URI of the given zone that can be used in {@link MarkdownString} links.
917
+ * Returns the URI of the given mission that can be used in {@link MarkdownString} fields.
918
+ *
919
+ * URI format: `mission://<key>`
920
+ *
921
+ * @param target The {@link Mission} or mission key to target.
922
+ */
923
+ declare function missionUri(target: string | Mission | MissionData): string;
924
+ /**
925
+ * Returns a {@link MarkdownString} link to the given mission.
926
+ *
927
+ * Link format: `[<key>](mission://<key>)`
928
+ *
929
+ * @param target The {@link Mission} or mission key to target.
930
+ */
931
+ declare function missionLink(target: string | Mission | MissionData): string;
932
+ /**
933
+ * Returns the URI of the given zone that can be used in {@link MarkdownString} fields.
741
934
  *
742
935
  * URI format: `zone://<key>`
743
936
  *
@@ -752,5 +945,15 @@ declare function zoneUri(target: string | Zone | ZoneData): string;
752
945
  * @param target The {@link Zone} or zone key to target.
753
946
  */
754
947
  declare function zoneLink(target: string | Zone | ZoneData): string;
948
+ /**
949
+ * For fields that accept either an array of values or a single value, coalesces the value to an array.
950
+ *
951
+ * Arrays are returned as-is.
952
+ * Single values are returned as a single-value array.
953
+ * Undefined values are returned as undefined.
954
+ *
955
+ * @param value The value to coalesce.
956
+ */
957
+ declare function coalesceToArray<T>(value?: T | T[]): T[] | undefined;
755
958
 
756
- export { ALIGNMENT, type Alignment, Alignments, type AlternateData, Alternates, Archetype, type ArchetypeData, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgeIndex, BadgeRequirement, type BadgeRequirementData, type BadgeRequirementType, type BadgeSearchOptions, type BadgeType, BundleMetadata, CHANGELOG, type Change, CohContentDatabase, Contact, type ContactData, type ContentBundle, ENHANCEMENT_CATEGORY, type EnhancementCategory, Key, type Link, type MarkdownString, PLAQUE_TYPE, type Paged, type PlaqueType, SEX, type Sex, Zone, type ZoneData, badgeLink, badgeUri, contactLink, contactUri, zoneLink, zoneUri };
959
+ export { ALIGNMENT, type Alignment, type AlignmentExtended, AlignmentList, type AlternateData, Alternates, Archetype, type ArchetypeData, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgeIndex, BadgeRequirement, type BadgeRequirementData, type BadgeRequirementType, type BadgeSearchOptions, type BadgeType, BundleMetadata, CHANGELOG, type Change, CohContentDatabase, Contact, type ContactData, type ContentBundle, type Coords, ENHANCEMENT_CATEGORY, type EnhancementCategory, Key, type Link, Location, type LocationData, type LocationIcon, MISSION_TYPE, MORALITY, type MarkdownString, Mission, type MissionData, type MissionFlashbackData, type MissionType, type Morality, type MoralityExtended, MoralityList, type Paged, SEX, type Sex, Zone, type ZoneData, badgeLink, badgeUri, coalesceToArray, compareAlignment, compareByDefaultName, compareByZoneKey, compareSex, contactLink, contactUri, missionLink, missionUri, zoneLink, zoneUri };