coh-content-db 2.0.0-rc.5 → 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 (82) hide show
  1. package/README.md +7 -7
  2. package/dist/coh-content-db.d.ts +493 -243
  3. package/dist/coh-content-db.js +675 -353
  4. package/dist/coh-content-db.js.map +1 -1
  5. package/dist/coh-content-db.mjs +655 -345
  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 +15 -38
  11. package/src/main/api/badge-requirement-data.ts +64 -0
  12. package/src/main/api/badge-requirement-type.ts +32 -0
  13. package/src/main/api/badge-type.ts +15 -15
  14. package/src/main/api/contact-data.ts +48 -0
  15. package/src/main/api/content-bundle.ts +16 -4
  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 +20 -0
  23. package/src/main/changelog.ts +8 -3
  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 +17 -36
  27. package/src/main/db/badge-requirement.ts +81 -0
  28. package/src/main/db/badge-search-options.ts +5 -5
  29. package/src/main/db/badge.ts +73 -62
  30. package/src/main/db/bundle-metadata.ts +3 -3
  31. package/src/main/db/coh-content-database.ts +60 -23
  32. package/src/main/db/contact.ts +62 -0
  33. package/src/main/db/location.ts +30 -0
  34. package/src/main/db/mission.ts +107 -0
  35. package/src/main/db/morality-list.ts +99 -0
  36. package/src/main/db/zone.ts +28 -0
  37. package/src/main/index.ts +16 -13
  38. package/src/main/util.ts +85 -14
  39. package/src/test/api/alignment.test.ts +38 -4
  40. package/src/test/api/badge-data.fixture.ts +1 -15
  41. package/src/test/api/badge-data.test.ts +3 -3
  42. package/src/test/api/badge-requirement-data.fixture.ts +7 -0
  43. package/src/test/api/badge-requirement-type.test.ts +31 -0
  44. package/src/test/api/badge-type.test.ts +5 -5
  45. package/src/test/api/contact-data.fixture.ts +7 -0
  46. package/src/test/api/content-bundle.fixture.ts +1 -17
  47. package/src/test/api/content-bundle.test.ts +1 -1
  48. package/src/test/api/enhancement-category.test.ts +5 -5
  49. package/src/test/api/mission-data.fixture.ts +12 -0
  50. package/src/test/api/sex.test.ts +33 -1
  51. package/src/test/api/zone-data.fixture.ts +8 -0
  52. package/src/test/db/alignment-list.test.ts +200 -0
  53. package/src/test/db/alternates.test.ts +60 -56
  54. package/src/test/db/badge-index.test.ts +108 -66
  55. package/src/test/db/badge-requirement.test.ts +145 -0
  56. package/src/test/db/badge.test.ts +310 -14
  57. package/src/test/db/coh-content-database.test.ts +110 -29
  58. package/src/test/db/contact.test.ts +97 -0
  59. package/src/test/db/location.test.ts +51 -0
  60. package/src/test/db/mission.test.ts +171 -0
  61. package/src/test/db/morality-list.test.ts +457 -0
  62. package/src/test/db/zone.test.ts +36 -0
  63. package/src/test/index.test.ts +4 -2
  64. package/src/test/util.test.ts +112 -22
  65. package/src/main/api/badge-partial-data.ts +0 -66
  66. package/src/main/api/badge-partial-type.ts +0 -8
  67. package/src/main/api/game-map-data.ts +0 -26
  68. package/src/main/api/plaque-type.ts +0 -6
  69. package/src/main/api/vidiot-map-data.ts +0 -18
  70. package/src/main/api/vidiot-map-point-of-interest-data.ts +0 -30
  71. package/src/main/db/alignments.ts +0 -17
  72. package/src/main/db/badge-partial.ts +0 -83
  73. package/src/main/db/game-map.ts +0 -33
  74. package/src/main/db/vidiot-map-point-of-interest.ts +0 -39
  75. package/src/main/db/vidiot-map.ts +0 -25
  76. package/src/test/api/alignments.test.ts +0 -40
  77. package/src/test/api/badge-partial-data.fixture.ts +0 -17
  78. package/src/test/api/badge-partial-type.test.ts +0 -31
  79. package/src/test/api/game-map-data.fixture.ts +0 -10
  80. package/src/test/api/plaque-type.test.ts +0 -31
  81. package/src/test/api/vidiot-map-point-of-interest.fixture.ts +0 -10
  82. package/src/test/api/vidiot-map.fixture.ts +0 -9
@@ -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,84 +39,135 @@ 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_PARTIAL_TYPE: readonly ["PLAQUE", "BADGE", "INVENTION", "INVENTION_PLUS_ONE"];
35
- type BadgePartialType = typeof BADGE_PARTIAL_TYPE[number];
36
-
37
- declare const PLAQUE_TYPE: string[];
38
- type PlaqueType = typeof PLAQUE_TYPE[number];
45
+ declare const BADGE_REQUIREMENT_TYPE: readonly ["badge", "invention", "invention-plus-one", "location", "monument", "mission", "task"];
46
+ type BadgeRequirementType = typeof BADGE_REQUIREMENT_TYPE[number];
39
47
 
40
48
  /**
41
49
  * Tage type to indicate that a string will accept {@link https://www.markdownguide.org/|Markdown} format.
42
50
  */
43
51
  type MarkdownString = string;
44
52
 
45
- interface BadgePartialData {
53
+ interface Link {
54
+ title: string;
55
+ href: string;
56
+ }
57
+
58
+ interface LocationData {
46
59
  /**
47
- * Key.
60
+ * Key of the {@link Zone} that the location references.
48
61
  */
49
- readonly key: string;
62
+ readonly zoneKey?: string;
50
63
  /**
51
- * Type of partial.
64
+ * In-game `/loc` coordinates of the location.
52
65
  */
53
- readonly type: BadgePartialType;
66
+ readonly coords?: Coords;
54
67
  /**
55
- * Map the partial is located on.
68
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
56
69
  */
57
- readonly mapKey?: string;
70
+ readonly icon?: LocationIcon;
58
71
  /**
59
- * /loc coordinates.
72
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
60
73
  */
61
- 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 {
62
83
  /**
63
- * 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 (`-`).
64
87
  */
65
- readonly plaqueType?: PlaqueType;
88
+ readonly key: string;
66
89
  /**
67
- * Plaque inscription.
90
+ * The requirement type.
68
91
  */
69
- readonly plaqueInscription?: string;
92
+ readonly type: BadgeRequirementType;
70
93
  /**
71
- * The number or letter the partial appears as on Vidiot Maps.
94
+ * If the requirement involves a location, where it is.
72
95
  */
73
- readonly vidiotMapKey?: string;
96
+ readonly location?: LocationData | LocationData[];
74
97
  /**
75
- * The badge required for this partial.
98
+ * If the requirement involves a badge, the badge key.
76
99
  */
77
100
  readonly badgeKey?: string;
78
101
  /**
79
- * Level of the invention required.
102
+ * If the requirement involves a mission, the mission key.
103
+ */
104
+ readonly missionKey?: string;
105
+ /**
106
+ * If the requirement involves a monument, the text that is displayed thereon.
107
+ */
108
+ readonly monumentText?: string;
109
+ /**
110
+ * If the requirement involves crafting an invention, the Level of the invention required.
80
111
  */
81
112
  readonly inventionLevel?: number;
82
113
  /**
83
- * The types of enhancements required to be crafted.
114
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
84
115
  */
85
116
  readonly inventionTypes?: EnhancementCategory[];
86
117
  /**
87
- * Number of invention crafts required.
118
+ * Number of times the task needs to be repeated.
88
119
  */
89
- readonly inventionCount?: number;
120
+ readonly count?: number;
90
121
  /**
91
- * Any additional notes.
122
+ * Additional information about the requirement.
92
123
  */
93
124
  readonly notes?: MarkdownString;
125
+ /**
126
+ * List of external links. Wiki, forums, etc.
127
+ */
128
+ readonly links?: Link[];
94
129
  }
95
130
 
96
- interface Link {
97
- title: string;
98
- href: string;
99
- }
100
-
101
- 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"];
102
132
  type BadgeType = typeof BADGE_TYPE[number];
103
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
+
104
166
  interface BadgeData {
105
167
  /**
106
168
  * Unique key used to reference this badge.
107
169
  *
108
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
170
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
109
171
  */
110
172
  readonly key: string;
111
173
  /**
@@ -117,17 +179,17 @@ interface BadgeData {
117
179
  *
118
180
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
119
181
  */
120
- readonly name: AlternateData<string>[];
182
+ readonly name: string | AlternateData<string>[];
121
183
  /**
122
- * 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.
123
185
  */
124
- readonly alignment: Alignment[];
186
+ readonly morality?: MoralityExtended | MoralityExtended[];
125
187
  /**
126
188
  * The badge text as it appears in-game. May vary by character sex or alignment.
127
189
  */
128
- readonly badgeText?: AlternateData<string>[];
190
+ readonly badgeText?: AlternateData<MarkdownString>[] | MarkdownString;
129
191
  /**
130
- * Description of how to acquire the badge.
192
+ * Short description of how to acquire the badge. Detailed instructions should go in the notes field.
131
193
  */
132
194
  readonly acquisition?: MarkdownString;
133
195
  /**
@@ -135,48 +197,28 @@ interface BadgeData {
135
197
  *
136
198
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
137
199
  */
138
- readonly icon?: AlternateData<string>[];
200
+ readonly icon?: string | AlternateData<string>[];
139
201
  /**
140
202
  * Freeform notes or tips about the badge.
141
203
  */
142
204
  readonly notes?: MarkdownString;
143
205
  /**
144
- * List of external links for this Badge. Wiki, forums, etc.
206
+ * List of external links. Wiki, forums, etc.
145
207
  */
146
208
  readonly links?: Link[];
147
209
  /**
148
- * For exploration badges, the key of the {@link GameMapData|GameMap} that this badge is found on.
149
- */
150
- readonly mapKey?: string;
151
- /**
152
- * For exploration badges, the `/loc` coordinates of the badge on the in-game map.
153
- */
154
- readonly loc?: [number, number, number];
155
- /**
156
- * For badges 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.
157
212
  */
158
- readonly vidiotMapKey?: string;
159
- /**
160
- * ID used with the in-game `/settitle` command to apply the badge.
161
- */
162
- readonly setTitle?: {
163
- /**
164
- * `/settitle` id.
165
- */
166
- id?: number;
167
- /**
168
- * `/settitle` id if different for praetorian characters.
169
- */
170
- praetorianId?: number;
171
- };
213
+ readonly setTitleId?: [number, number?];
172
214
  /**
173
215
  * A description of the effect the badge will have, such as a buff or granting a temporary power.
174
216
  */
175
217
  readonly effect?: MarkdownString;
176
218
  /**
177
- * A list of requirements for badges that have partial fulfilment steps, such as visiting plaques for history badges, or collecting other badges for meta-badges like accolades.
219
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
178
220
  */
179
- readonly partials?: BadgePartialData[];
221
+ readonly requirements?: BadgeRequirementData[];
180
222
  /**
181
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.
182
224
  */
@@ -198,65 +240,126 @@ interface Change {
198
240
  description: MarkdownString;
199
241
  }
200
242
 
201
- interface VidiotMapPointOfInterestData {
243
+ interface ContactData {
202
244
  /**
203
- * The pixel-space position of the PoI on the map graphic.
245
+ * Unique key used to reference this contact.
204
246
  *
205
- * Screen-space, pixels from top-left `[0, 0]`.
247
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
248
+ */
249
+ readonly key: string;
250
+ /**
251
+ * The name of this contact.
206
252
  */
207
- readonly pos?: [number, number];
253
+ readonly name: string;
208
254
  /**
209
- * Freeform notes about the PoI.
255
+ * The contact's title.
210
256
  */
211
- readonly notes?: MarkdownString;
257
+ readonly title?: string;
212
258
  /**
213
- * If the POI is a zone transfer, the map it transfers to.
259
+ * The character moralities that this contact will interact with.
214
260
  */
215
- readonly mapKey?: string;
261
+ readonly morality?: MoralityExtended | MoralityExtended[];
216
262
  /**
217
- * If the POI is a badge, the badge.
263
+ * The location of this contact.
218
264
  */
219
- readonly badgeKey?: string;
265
+ readonly location?: LocationData;
266
+ /**
267
+ * The level range this contact will offer missions for.
268
+ */
269
+ readonly levelRange?: [number, number?];
220
270
  /**
221
- * If the POI is a partial for a badge, the partial key.
271
+ * Freeform notes or tips about the contact.
222
272
  */
223
- readonly badgePartialKey?: string;
273
+ readonly notes?: MarkdownString;
274
+ /**
275
+ * List of external links. Wiki, forums, etc.
276
+ */
277
+ readonly links?: Link[];
224
278
  }
225
279
 
226
- interface VidiotMapData {
280
+ interface ZoneData {
227
281
  /**
228
- * URL of the map image.
282
+ * Unique key used to reference this zone.
283
+ *
284
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
229
285
  */
230
- readonly imageUrl: string;
286
+ readonly key: string;
231
287
  /**
232
- * Name to display for the Vidiot map.
288
+ * The name of the zone as it appears in-game.
233
289
  */
234
- readonly name?: string;
290
+ readonly name: string;
235
291
  /**
236
- * List of Points of Interest labelled on the image.
292
+ * List of external links. Wiki, forums, etc.
237
293
  */
238
- readonly pointsOfInterest?: VidiotMapPointOfInterestData[];
294
+ readonly links?: Link[];
239
295
  }
240
296
 
241
- interface GameMapData {
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 {
242
301
  /**
243
- * Unique key used to reference this badge.
302
+ * Unique key used to reference this mission.
244
303
  *
245
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
304
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
246
305
  */
247
306
  readonly key: string;
248
307
  /**
249
- * The name of the map as it appears in-game.
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.
250
311
  */
251
312
  readonly name: string;
252
313
  /**
253
- * List of external links for this Map. Wiki, forums, etc.
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.
254
335
  */
255
336
  readonly links?: Link[];
256
337
  /**
257
- * List of Vidiot Map assets for this map.
338
+ * If the mission is available in Ouroboros as a Flashback.
258
339
  */
259
- readonly vidiotMaps?: VidiotMapData[];
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;
260
363
  }
261
364
 
262
365
  /**
@@ -276,7 +379,7 @@ interface ContentBundle {
276
379
  */
277
380
  readonly repository?: string;
278
381
  /**
279
- * List of external links for this Badge. Wiki, forums, etc.
382
+ * List of external links. Wiki, forums, etc.
280
383
  */
281
384
  readonly links?: Link[];
282
385
  /**
@@ -289,9 +392,17 @@ interface ContentBundle {
289
392
  */
290
393
  readonly archetypes?: ArchetypeData[];
291
394
  /**
292
- * List of game maps supported by this fork.
395
+ * List of zones supported by this fork.
396
+ */
397
+ readonly zones?: ZoneData[];
398
+ /**
399
+ * List of contacts available in this fork.
400
+ */
401
+ readonly contacts?: ContactData[];
402
+ /**
403
+ * List of missions available in this fork.
293
404
  */
294
- readonly maps?: GameMapData[];
405
+ readonly missions?: MissionData[];
295
406
  /**
296
407
  * List of badges available on this fork.
297
408
  */
@@ -302,18 +413,25 @@ interface ContentBundle {
302
413
  readonly changelog?: Change[];
303
414
  }
304
415
 
305
- declare class Alignments {
306
- readonly items: Alignment[];
416
+ declare class AlignmentList {
417
+ #private;
307
418
  readonly hero: boolean;
308
419
  readonly villain: boolean;
309
420
  readonly praetorian: boolean;
310
421
  readonly primal: boolean;
311
- constructor(raw: Alignment[]);
422
+ readonly all: boolean;
423
+ constructor(items?: AlignmentExtended[]);
424
+ get items(): Alignment[];
425
+ has(alignment?: AlignmentExtended): boolean;
312
426
  }
313
427
 
314
428
  declare class Alternates<T> {
315
429
  #private;
316
- 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);
317
435
  getValue(alignment?: Alignment, sex?: Sex): T | undefined;
318
436
  /**
319
437
  * Get the default value for this list of alternates, the value with the highest priority and lowest specificity.
@@ -337,56 +455,94 @@ declare class Archetype {
337
455
  constructor(data: ArchetypeData);
338
456
  }
339
457
 
340
- declare class BadgePartial {
458
+ declare class Location {
341
459
  /**
342
- * Key.
460
+ * Key of the {@link Zone} that the location references.
343
461
  */
344
- readonly key: string;
462
+ readonly zoneKey?: string;
345
463
  /**
346
- * Type of partial.
464
+ * In-game `/loc` coordinates of the location.
347
465
  */
348
- readonly type: BadgePartialType;
466
+ readonly coords?: Coords;
349
467
  /**
350
- * Map the partial is located on.
468
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
351
469
  */
352
- readonly mapKey?: string;
470
+ readonly icon?: LocationIcon;
353
471
  /**
354
- * /loc coordinates.
472
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
355
473
  */
356
- readonly loc?: number[];
474
+ readonly iconText?: string;
475
+ constructor(data: LocationData);
476
+ }
477
+
478
+ declare class BadgeRequirement {
357
479
  /**
358
- * 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 (`-`).
359
483
  */
360
- readonly plaqueType?: PlaqueType;
484
+ readonly key: string;
361
485
  /**
362
- * Plaque inscription.
486
+ * The requirement type.
363
487
  */
364
- readonly plaqueInscription?: string;
488
+ readonly type: BadgeRequirementType;
365
489
  /**
366
- * The number or letter the partial appears as on Vidiot Maps.
490
+ * If the requirement involves a location, where it is.
367
491
  */
368
- readonly vidiotMapKey?: string;
492
+ readonly location?: Location[];
369
493
  /**
370
- * The badge required for this partial.
494
+ * If the requirement involves a badge, the badge key.
371
495
  */
372
496
  readonly badgeKey?: string;
373
497
  /**
374
- * Level of the invention required.
498
+ * If the requirement involves a mission, the mission key.
499
+ */
500
+ readonly missionKey?: string;
501
+ /**
502
+ * If the requirement involves a monument, the text that is displayed thereon.
503
+ */
504
+ readonly monumentText?: string;
505
+ /**
506
+ * If the requirement involves crafting an invention, the Level of the invention required.
375
507
  */
376
508
  readonly inventionLevel?: number;
377
509
  /**
378
- * The types of enhancements required to be crafted.
510
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
379
511
  */
380
512
  readonly inventionTypes?: EnhancementCategory[];
381
513
  /**
382
- * Number of invention crafts required.
514
+ * Number of times the task needs to be repeated.
383
515
  */
384
- readonly inventionCount?: number;
516
+ readonly count?: number;
385
517
  /**
386
- * Any additional notes.
518
+ * Additional information about the requirement.
387
519
  */
388
520
  readonly notes?: MarkdownString;
389
- constructor(data: BadgePartialData);
521
+ /**
522
+ * List of external links. Wiki, forums, etc.
523
+ */
524
+ readonly links: Link[];
525
+ constructor(data: BadgeRequirementData);
526
+ }
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;
390
546
  }
391
547
 
392
548
  declare class Badge {
@@ -406,15 +562,15 @@ declare class Badge {
406
562
  */
407
563
  readonly name: Alternates<string>;
408
564
  /**
409
- * The character alignments that this badge is available to.
565
+ * The character moralities that this badge is available to.
410
566
  */
411
- readonly alignment: Alignments;
567
+ readonly morality: MoralityList;
412
568
  /**
413
569
  * The badge text as it appears in-game. May vary by character sex or alignment.
414
570
  */
415
- readonly badgeText: Alternates<string>;
571
+ readonly badgeText: Alternates<MarkdownString>;
416
572
  /**
417
- * Description of how to acquire the badge.
573
+ * Short description of how to acquire the badge. Detailed instructions will be in the notes field.
418
574
  */
419
575
  readonly acquisition?: MarkdownString;
420
576
  /**
@@ -428,49 +584,39 @@ declare class Badge {
428
584
  */
429
585
  readonly notes?: MarkdownString;
430
586
  /**
431
- * List of external links for this Badge. Wiki, forums, etc.
432
- */
433
- readonly links?: Link[];
434
- /**
435
- * For exploration badges, the key of the {@link GameMap} that this badge is found on.
436
- */
437
- readonly mapKey?: string;
438
- /**
439
- * For exploration badges, the `/loc` coordinates of the badge on the in-game map.
440
- */
441
- readonly loc?: [number, number, number];
442
- /**
443
- * For badges that appear on a Vidiot Map, the number or letter the badge appears as.
587
+ * List of external links. Wiki, forums, etc.
444
588
  */
445
- readonly vidiotMapKey?: string;
589
+ readonly links: Link[];
446
590
  /**
447
- * 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.
448
593
  */
449
- readonly setTitle?: {
450
- /**
451
- * `/settitle` id.
452
- */
453
- id?: number;
454
- /**
455
- * `/settitle` id if different for praetorian characters.
456
- */
457
- praetorianId?: number;
458
- };
594
+ readonly setTitleId?: [number, number?];
459
595
  /**
460
596
  * A description of the effect the badge will have, such as a buff or granting a temporary power.
461
597
  */
462
598
  readonly effect?: MarkdownString;
463
599
  /**
464
- * A list of requirements for badges that have partial fulfilment steps, such as visiting plaques for history badges, or collecting other badges for meta-badges like accolades.
600
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
465
601
  */
466
- readonly partials?: BadgePartial[];
602
+ readonly requirements?: BadgeRequirement[];
467
603
  /**
468
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.
469
605
  */
470
606
  readonly ignoreInTotals: boolean;
471
- constructor(data: BadgeData);
472
- getPartial(key: string): BadgePartial;
607
+ constructor(badgeData: BadgeData);
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;
473
617
  }
618
+ declare function compareByDefaultName(a?: Badge, b?: Badge): number;
619
+ declare function compareByZoneKey(a?: Badge, b?: Badge): number;
474
620
 
475
621
  interface BadgeSearchOptions {
476
622
  /**
@@ -494,8 +640,8 @@ interface BadgeSearchOptions {
494
640
  */
495
641
  filter?: {
496
642
  type?: BadgeType;
497
- mapKey?: string;
498
- alignment?: Alignment;
643
+ zoneKey?: string;
644
+ morality?: MoralityExtended;
499
645
  };
500
646
  /**
501
647
  * Sort results.
@@ -503,8 +649,8 @@ interface BadgeSearchOptions {
503
649
  * Badges are assumed to be in canonical order in the content bundle, and should match the in-game display order.
504
650
  */
505
651
  sort?: {
506
- by?: 'CANONICAL' | 'BADGE_NAME' | 'MAP_NAME';
507
- dir?: 'ASC' | 'DESC';
652
+ by?: 'canonical' | 'badge-name' | 'zone-key';
653
+ dir?: 'asc' | 'desc';
508
654
  };
509
655
  /**
510
656
  * The page (1-based)
@@ -516,105 +662,164 @@ interface BadgeSearchOptions {
516
662
  pageSize?: number;
517
663
  }
518
664
 
519
- declare class VidiotMapPointOfInterest {
665
+ interface Paged<T> {
666
+ items: T[];
667
+ page: number;
668
+ pageSize?: number;
669
+ totalItems: number;
670
+ totalPages: number;
671
+ }
672
+
673
+ declare class BadgeIndex {
674
+ #private;
675
+ constructor(badges: Badge[]);
676
+ getBadge(key?: string): Badge | undefined;
677
+ searchBadges(options?: BadgeSearchOptions): Paged<Badge>;
678
+ }
679
+
680
+ declare class BundleMetadata {
520
681
  /**
521
- * The pixel-space position of the PoI on the map graphic.
522
- *
523
- * Screen-space, pixels from top-left `[0, 0]`.
682
+ * Name of the content bundle.
524
683
  */
525
- readonly pos?: [number, number];
684
+ readonly name: string;
526
685
  /**
527
- * Freeform notes about the PoI.
686
+ * Description of the fork.
528
687
  */
529
- readonly notes?: MarkdownString;
688
+ readonly description?: MarkdownString;
530
689
  /**
531
- * If the POI is a zone transfer, the map it transfers to.
690
+ * Repository where the db content package is maintained.
532
691
  */
533
- readonly mapKey?: string;
692
+ readonly repository?: string;
534
693
  /**
535
- * If the POI is a badge, the badge.
694
+ * List of external links. Wiki, forums, etc.
536
695
  */
537
- readonly badgeKey?: string;
696
+ readonly links: Link[];
538
697
  /**
539
- * If the POI is a partial for a badge, the partial key.
698
+ * Change log for this data package.
540
699
  */
541
- readonly badgePartialKey?: string;
542
- constructor(data: VidiotMapPointOfInterestData);
700
+ readonly changelog: Change[];
701
+ constructor(bundle: ContentBundle);
543
702
  }
544
703
 
545
- declare class VidiotMap {
704
+ declare class Zone {
546
705
  /**
547
- * URL of the map image.
706
+ * Unique key used to reference this zone.
707
+ *
708
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
548
709
  */
549
- readonly imageUrl: string;
710
+ readonly key: string;
550
711
  /**
551
- * Name to display for the Vidiot map.
712
+ * The name of the zone as it appears in-game.
552
713
  */
553
- readonly name?: string;
714
+ readonly name: string;
554
715
  /**
555
- * List of Points of Interest labelled on the image.
716
+ * List of external links. Wiki, forums, etc.
556
717
  */
557
- readonly pointsOfInterest?: VidiotMapPointOfInterest[];
558
- constructor(data: VidiotMapData);
718
+ readonly links: Link[];
719
+ constructor(data: ZoneData);
559
720
  }
560
721
 
561
- declare class GameMap {
722
+ declare class Contact {
562
723
  /**
563
- * The database key for this map.
724
+ * Unique key used to reference this contact.
725
+ *
726
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
564
727
  */
565
728
  readonly key: string;
566
729
  /**
567
- * The name of the map as it appears in-game.
730
+ * The name of this contact.
568
731
  */
569
732
  readonly name: string;
570
733
  /**
571
- * List of external links for this Map. Wiki, forums, etc.
734
+ * The contact's title.
572
735
  */
573
- readonly links?: Link[];
736
+ readonly title?: string;
574
737
  /**
575
- * List of Vidiot Map assets for this map.
738
+ * The character moralities that this contact will interact with.
576
739
  */
577
- readonly vidiotMaps?: VidiotMap[];
578
- constructor(data: GameMapData);
579
- }
580
-
581
- interface Paged<T> {
582
- items: T[];
583
- page: number;
584
- pageSize?: number;
585
- totalItems: number;
586
- totalPages: number;
587
- }
588
-
589
- declare class BadgeIndex {
590
- #private;
591
- constructor(badges: Badge[], maps?: GameMap[]);
592
- getBadge(key: string): Badge;
593
- searchBadges(options?: BadgeSearchOptions): Paged<Badge>;
740
+ readonly morality?: MoralityList;
741
+ /**
742
+ * The location of this contact.
743
+ */
744
+ readonly location?: Location;
745
+ /**
746
+ * The level range this contact will offer missions for.
747
+ */
748
+ readonly levelRange?: [number, number?];
749
+ /**
750
+ * Freeform notes or tips about the contact.
751
+ */
752
+ readonly notes?: MarkdownString;
753
+ /**
754
+ * List of external links. Wiki, forums, etc.
755
+ */
756
+ readonly links: Link[];
757
+ constructor(data: ContactData);
594
758
  }
595
759
 
596
- declare class BundleMetadata {
760
+ declare class Mission {
597
761
  /**
598
- * Name of the server group.
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.
599
771
  */
600
772
  readonly name: string;
601
773
  /**
602
- * Description of the server group.
774
+ * The type of mission... Story arc, task force, trial, etc.
603
775
  */
604
- readonly description?: MarkdownString;
776
+ readonly type: MissionType;
605
777
  /**
606
- * Repository where the db content package is maintained.
778
+ * The character moralities that may accept the mission.
607
779
  */
608
- readonly repository?: string;
780
+ readonly morality: MoralityList;
609
781
  /**
610
- * List of external links for this Server Group. Wiki, forums, etc.
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.
611
795
  */
612
796
  readonly links: Link[];
613
797
  /**
614
- * Change log for this data package.
798
+ * If the mission is available in Ouroboros as a Flashback.
615
799
  */
616
- readonly changelog: Change[];
617
- constructor(bundle: ContentBundle);
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);
618
823
  }
619
824
 
620
825
  declare class CohContentDatabase {
@@ -624,20 +829,29 @@ declare class CohContentDatabase {
624
829
  */
625
830
  readonly metadata: BundleMetadata;
626
831
  /**
627
- * List of the game server names in this server group.
832
+ * List of the game server names.
833
+ *
628
834
  * Torchbearer, Excelsior, etc.
629
835
  */
630
836
  readonly servers: string[];
631
837
  /**
632
- * List of archetypes available in this server group.
838
+ * List of archetypes.
633
839
  */
634
840
  readonly archetypes: Archetype[];
635
841
  /**
636
- * List of game maps supported by this server group.
842
+ * List of game zones.
843
+ */
844
+ readonly zones: Zone[];
845
+ /**
846
+ * List of contacts.
637
847
  */
638
- readonly maps: GameMap[];
848
+ readonly contacts: Contact[];
639
849
  /**
640
- * List of badges available on this server group.
850
+ * List of missions.
851
+ */
852
+ readonly missions: Contact[];
853
+ /**
854
+ * List of badges.
641
855
  */
642
856
  readonly badges: Badge[];
643
857
  /**
@@ -645,9 +859,11 @@ declare class CohContentDatabase {
645
859
  * @param bundle The data to load.
646
860
  */
647
861
  constructor(bundle: ContentBundle);
648
- getArchetype(key: string): Archetype;
649
- getMap(key: string): GameMap;
650
- getBadge(key: string): Badge;
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;
651
867
  /**
652
868
  * Search, sort and filter the badge list.
653
869
  * This is a fairly brute-forced approach and will not be as performant as loading the badge data into a traditional
@@ -666,44 +882,78 @@ declare class Key {
666
882
  declare const CHANGELOG: Change[];
667
883
 
668
884
  /**
669
- * 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.
670
886
  *
671
887
  * URI format: `badge://<key>`
672
888
  *
673
889
  * @param target The badge or badge key to target.
674
890
  */
675
- declare function badgeUri(target: string | {
676
- key: string;
677
- }): string;
891
+ declare function badgeUri(target: string | Badge | BadgeData): string;
678
892
  /**
679
893
  * Returns a {@link MarkdownString} link to the given badge.
680
894
  *
681
895
  * Link format: `[<key>](badge://<key>)`
682
896
  *
683
- * @param target The badge or badge key to target.
897
+ * @param target The {@link Badge} or badge key to target.
898
+ */
899
+ declare function badgeLink(target: string | Badge | BadgeData): string;
900
+ /**
901
+ * Returns the URI of the given contact that can be used in {@link MarkdownString} fields.
902
+ *
903
+ * URI format: `contact://<key>`
904
+ *
905
+ * @param target The {@link Contact} or contact key to target.
906
+ */
907
+ declare function contactUri(target: string | Contact | ContactData): string;
908
+ /**
909
+ * Returns a {@link MarkdownString} link to the given contact.
910
+ *
911
+ * Link format: `[<key>](contact://<key>)`
912
+ *
913
+ * @param target The {@link Contact} or contact key to target.
914
+ */
915
+ declare function contactLink(target: string | Contact | ContactData): string;
916
+ /**
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.
934
+ *
935
+ * URI format: `zone://<key>`
936
+ *
937
+ * @param target The {@link Zone} or zone key to target.
684
938
  */
685
- declare function badgeLink(target: string | {
686
- key: string;
687
- }): string;
939
+ declare function zoneUri(target: string | Zone | ZoneData): string;
688
940
  /**
689
- * Returns the URI of the given map that can be used in {@link MarkdownString} links.
941
+ * Returns a {@link MarkdownString} link to the given zone.
690
942
  *
691
- * URI format: `map://<key>`
943
+ * Link format: `[<key>](zone://<key>)`
692
944
  *
693
- * @param target The {@link GameMap} or map key to target.
945
+ * @param target The {@link Zone} or zone key to target.
694
946
  */
695
- declare function mapUri(target: string | {
696
- key: string;
697
- }): string;
947
+ declare function zoneLink(target: string | Zone | ZoneData): string;
698
948
  /**
699
- * Returns a {@link MarkdownString} link to the given map.
949
+ * For fields that accept either an array of values or a single value, coalesces the value to an array.
700
950
  *
701
- * Link format: `[<key>](map://<key>)`
951
+ * Arrays are returned as-is.
952
+ * Single values are returned as a single-value array.
953
+ * Undefined values are returned as undefined.
702
954
  *
703
- * @param target The map or map key to target.
955
+ * @param value The value to coalesce.
704
956
  */
705
- declare function mapLink(target: string | {
706
- key: string;
707
- }): string;
957
+ declare function coalesceToArray<T>(value?: T | T[]): T[] | undefined;
708
958
 
709
- export { ALIGNMENT, type Alignment, Alignments, type AlternateData, Alternates, Archetype, type ArchetypeData, BADGE_PARTIAL_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgeIndex, BadgePartial, type BadgePartialData, type BadgePartialType, type BadgeSearchOptions, type BadgeType, BundleMetadata, CHANGELOG, type Change, CohContentDatabase, type ContentBundle, ENHANCEMENT_CATEGORY, type EnhancementCategory, GameMap, type GameMapData, Key, type Link, type MarkdownString, PLAQUE_TYPE, type Paged, type PlaqueType, SEX, type Sex, VidiotMap, type VidiotMapData, VidiotMapPointOfInterest, type VidiotMapPointOfInterestData, badgeLink, badgeUri, mapLink, mapUri };
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 };