coh-content-db 2.0.0-rc.15 → 2.0.0-rc.17
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/README.md +9 -1
- package/dist/coh-content-db.d.ts +93 -44
- package/dist/coh-content-db.js +230 -121
- package/dist/coh-content-db.js.map +1 -1
- package/dist/coh-content-db.mjs +228 -121
- package/dist/coh-content-db.mjs.map +1 -1
- package/jest.config.mjs +1 -0
- package/package.json +14 -14
- 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/alternates.ts +1 -1
- package/src/main/db/badge-index.ts +10 -8
- package/src/main/db/badge-requirement.ts +1 -1
- package/src/main/db/badge.ts +5 -4
- package/src/main/db/bundle-header.ts +1 -1
- package/src/main/db/contact.ts +5 -4
- package/src/main/db/level-range.ts +15 -0
- package/src/main/db/mission.ts +9 -8
- package/src/main/db/set-title-ids.ts +10 -0
- package/src/main/db/zone.ts +29 -0
- package/src/main/index.ts +8 -2
- package/src/main/util/coalesce-to-array.ts +13 -0
- package/src/main/{util.ts → util/links.ts} +8 -22
- package/src/test/api/alignment.test.ts +2 -2
- package/src/test/api/sex.test.ts +2 -2
- package/src/test/api/zone-data.fixture.ts +1 -0
- package/src/test/db/badge.test.ts +24 -11
- 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/src/test/util/coalese-to-array.test.ts +17 -0
- package/src/test/{util.test.ts → util/links.test.ts} +5 -21
- package/src/test/{to-date.test.ts → util/to-date.test.ts} +1 -1
- /package/src/main/{to-date.ts → util/to-date.ts} +0 -0
package/dist/coh-content-db.mjs
CHANGED
|
@@ -96,12 +96,71 @@ function compareSex(a, b) {
|
|
|
96
96
|
return orderA - orderB;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
const ZONE_TYPE = [
|
|
100
|
+
/**
|
|
101
|
+
* The standard zone type, even if not technically occurring in the 'City' proper.
|
|
102
|
+
*/
|
|
103
|
+
"city",
|
|
104
|
+
/**
|
|
105
|
+
* An Ouroboros flashback to a zone as it was in a previous era.
|
|
106
|
+
*/
|
|
107
|
+
"echo",
|
|
108
|
+
/**
|
|
109
|
+
* Tutorial zon, usually inaccessible after leaving.
|
|
110
|
+
*/
|
|
111
|
+
"tutorial",
|
|
112
|
+
/**
|
|
113
|
+
* Trial zones, like the Abandoned Sewers trial.
|
|
114
|
+
*/
|
|
115
|
+
"trial",
|
|
116
|
+
/**
|
|
117
|
+
* Hazard zones like the Hollows.
|
|
118
|
+
*/
|
|
119
|
+
"hazard",
|
|
120
|
+
/**
|
|
121
|
+
* Mayhem mission zones.
|
|
122
|
+
*/
|
|
123
|
+
"mayhem",
|
|
124
|
+
/**
|
|
125
|
+
* Safeguard mission zones.
|
|
126
|
+
*/
|
|
127
|
+
"safeguard",
|
|
128
|
+
/**
|
|
129
|
+
* Exists inside a mission not covered by the other types.
|
|
130
|
+
*/
|
|
131
|
+
"mission",
|
|
132
|
+
/**
|
|
133
|
+
* Incarnate trial zones.
|
|
134
|
+
*/
|
|
135
|
+
"incarnate",
|
|
136
|
+
/**
|
|
137
|
+
* Cooprative zones where Heroes and Villains can team up for PvE content.
|
|
138
|
+
*/
|
|
139
|
+
"co-op",
|
|
140
|
+
/**
|
|
141
|
+
* PvP zones like Bloody Bay.
|
|
142
|
+
*/
|
|
143
|
+
"pvp",
|
|
144
|
+
/**
|
|
145
|
+
* Located in an arena PvP map.
|
|
146
|
+
*/
|
|
147
|
+
"arena",
|
|
148
|
+
/**
|
|
149
|
+
* A building, usually contained within another zone, like the AE buildings.
|
|
150
|
+
*/
|
|
151
|
+
"building",
|
|
152
|
+
/**
|
|
153
|
+
* Stuff like the (Phone only) zone.
|
|
154
|
+
*/
|
|
155
|
+
"other"
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
var __defProp$c = Object.defineProperty;
|
|
100
159
|
var __typeError$6 = (msg) => {
|
|
101
160
|
throw TypeError(msg);
|
|
102
161
|
};
|
|
103
|
-
var __defNormalProp$
|
|
104
|
-
var __publicField$
|
|
162
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
163
|
+
var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
105
164
|
var __accessCheck$6 = (obj, member, msg) => member.has(obj) || __typeError$6("Cannot " + msg);
|
|
106
165
|
var __privateGet$5 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
107
166
|
var __privateAdd$6 = (obj, member, value) => member.has(obj) ? __typeError$6("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -110,11 +169,11 @@ var _items$1;
|
|
|
110
169
|
class AlignmentList {
|
|
111
170
|
constructor(items) {
|
|
112
171
|
__privateAdd$6(this, _items$1);
|
|
113
|
-
__publicField$
|
|
114
|
-
__publicField$
|
|
115
|
-
__publicField$
|
|
116
|
-
__publicField$
|
|
117
|
-
__publicField$
|
|
172
|
+
__publicField$c(this, "hero");
|
|
173
|
+
__publicField$c(this, "villain");
|
|
174
|
+
__publicField$c(this, "praetorian");
|
|
175
|
+
__publicField$c(this, "primal");
|
|
176
|
+
__publicField$c(this, "all");
|
|
118
177
|
const set = new Set(items ?? [...ALIGNMENT]);
|
|
119
178
|
this.hero = set.has("hero") || set.has("primal") || set.has("all");
|
|
120
179
|
this.villain = set.has("villain") || set.has("primal") || set.has("all");
|
|
@@ -172,7 +231,7 @@ class Alternates {
|
|
|
172
231
|
__privateAdd$5(this, _Alternates_instances);
|
|
173
232
|
__privateAdd$5(this, _sortedValues, []);
|
|
174
233
|
if (Array.isArray(value)) {
|
|
175
|
-
__privateSet$4(this, _sortedValues, value.
|
|
234
|
+
__privateSet$4(this, _sortedValues, value.toSorted());
|
|
176
235
|
__privateGet$4(this, _sortedValues).sort((a, b) => __privateMethod$2(this, _Alternates_instances, compareAlternates_fn).call(this, a, b));
|
|
177
236
|
} else {
|
|
178
237
|
__privateSet$4(this, _sortedValues, [{ value }]);
|
|
@@ -245,60 +304,28 @@ validateKey_fn = function(key) {
|
|
|
245
304
|
if (INVALID_KEY_PATTERN.test(key)) throw new Error(`Invalid key: [${key}]; Keys can only contain lowercase characters, numbers and dashes.`);
|
|
246
305
|
};
|
|
247
306
|
|
|
248
|
-
var __defProp$
|
|
249
|
-
var __defNormalProp$
|
|
250
|
-
var __publicField$
|
|
307
|
+
var __defProp$b = Object.defineProperty;
|
|
308
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
309
|
+
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
251
310
|
class Archetype {
|
|
252
311
|
constructor(data) {
|
|
253
|
-
__publicField$
|
|
254
|
-
__publicField$
|
|
255
|
-
__publicField$
|
|
312
|
+
__publicField$b(this, "key");
|
|
313
|
+
__publicField$b(this, "name");
|
|
314
|
+
__publicField$b(this, "description");
|
|
256
315
|
this.key = new Key(data.key).value;
|
|
257
316
|
this.name = data.name;
|
|
258
317
|
this.description = data.description;
|
|
259
318
|
}
|
|
260
319
|
}
|
|
261
320
|
|
|
262
|
-
function badgeUri(target) {
|
|
263
|
-
const key = typeof target === "string" ? target : target.key;
|
|
264
|
-
return `badge://${key}`;
|
|
265
|
-
}
|
|
266
|
-
function badgeLink(target) {
|
|
267
|
-
const key = typeof target === "string" ? target : target.key;
|
|
268
|
-
return `[${key}](${badgeUri(target)})`;
|
|
269
|
-
}
|
|
270
|
-
function contactUri(target) {
|
|
271
|
-
const key = typeof target === "string" ? target : target.key;
|
|
272
|
-
return `contact://${key}`;
|
|
273
|
-
}
|
|
274
|
-
function contactLink(target) {
|
|
275
|
-
const key = typeof target === "string" ? target : target.key;
|
|
276
|
-
return `[${key}](${contactUri(target)})`;
|
|
277
|
-
}
|
|
278
|
-
function missionUri(target) {
|
|
279
|
-
const key = typeof target === "string" ? target : target.key;
|
|
280
|
-
return `mission://${key}`;
|
|
281
|
-
}
|
|
282
|
-
function missionLink(target) {
|
|
283
|
-
const key = typeof target === "string" ? target : target.key;
|
|
284
|
-
return `[${key}](${missionUri(target)})`;
|
|
285
|
-
}
|
|
286
|
-
function zoneUri(target) {
|
|
287
|
-
const key = typeof target === "string" ? target : target.key;
|
|
288
|
-
return `zone://${key}`;
|
|
289
|
-
}
|
|
290
|
-
function zoneLink(target) {
|
|
291
|
-
const key = typeof target === "string" ? target : target.key;
|
|
292
|
-
return `[${key}](${zoneUri(target)})`;
|
|
293
|
-
}
|
|
294
321
|
function coalesceToArray(value) {
|
|
295
322
|
if (!value) return void 0;
|
|
296
323
|
return Array.isArray(value) ? value : [value];
|
|
297
324
|
}
|
|
298
325
|
|
|
299
|
-
var __defProp$
|
|
300
|
-
var __defNormalProp$
|
|
301
|
-
var __publicField$
|
|
326
|
+
var __defProp$a = Object.defineProperty;
|
|
327
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
328
|
+
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
302
329
|
class BadgeRequirement {
|
|
303
330
|
constructor(data) {
|
|
304
331
|
/**
|
|
@@ -306,47 +333,47 @@ class BadgeRequirement {
|
|
|
306
333
|
*
|
|
307
334
|
* Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
|
|
308
335
|
*/
|
|
309
|
-
__publicField$
|
|
336
|
+
__publicField$a(this, "key");
|
|
310
337
|
/**
|
|
311
338
|
* The requirement type.
|
|
312
339
|
*/
|
|
313
|
-
__publicField$
|
|
340
|
+
__publicField$a(this, "type");
|
|
314
341
|
/**
|
|
315
342
|
* If the requirement involves a location, where it is.
|
|
316
343
|
*/
|
|
317
|
-
__publicField$
|
|
344
|
+
__publicField$a(this, "location");
|
|
318
345
|
/**
|
|
319
346
|
* If the requirement involves a badge, the badge key.
|
|
320
347
|
*/
|
|
321
|
-
__publicField$
|
|
348
|
+
__publicField$a(this, "badgeKey");
|
|
322
349
|
/**
|
|
323
350
|
* If the requirement involves a mission, the mission key.
|
|
324
351
|
*/
|
|
325
|
-
__publicField$
|
|
352
|
+
__publicField$a(this, "missionKey");
|
|
326
353
|
/**
|
|
327
354
|
* If the requirement involves a monument, the text that is displayed thereon.
|
|
328
355
|
*/
|
|
329
|
-
__publicField$
|
|
356
|
+
__publicField$a(this, "monumentText");
|
|
330
357
|
/**
|
|
331
358
|
* If the requirement involves crafting an invention, the Level of the invention required.
|
|
332
359
|
*/
|
|
333
|
-
__publicField$
|
|
360
|
+
__publicField$a(this, "inventionLevel");
|
|
334
361
|
/**
|
|
335
362
|
* If the requirement involves crafting an invention, the types of enhancements that will qualify.
|
|
336
363
|
*/
|
|
337
|
-
__publicField$
|
|
364
|
+
__publicField$a(this, "inventionTypes");
|
|
338
365
|
/**
|
|
339
366
|
* Number of times the task needs to be repeated.
|
|
340
367
|
*/
|
|
341
|
-
__publicField$
|
|
368
|
+
__publicField$a(this, "count");
|
|
342
369
|
/**
|
|
343
370
|
* Additional information about the requirement.
|
|
344
371
|
*/
|
|
345
|
-
__publicField$
|
|
372
|
+
__publicField$a(this, "notes");
|
|
346
373
|
/**
|
|
347
374
|
* List of external links. Wiki, forums, etc.
|
|
348
375
|
*/
|
|
349
|
-
__publicField$
|
|
376
|
+
__publicField$a(this, "links");
|
|
350
377
|
this.key = new Key(data.key).value;
|
|
351
378
|
this.type = data.type;
|
|
352
379
|
this.location = coalesceToArray(data.location);
|
|
@@ -361,12 +388,12 @@ class BadgeRequirement {
|
|
|
361
388
|
}
|
|
362
389
|
}
|
|
363
390
|
|
|
364
|
-
var __defProp$
|
|
391
|
+
var __defProp$9 = Object.defineProperty;
|
|
365
392
|
var __typeError$3 = (msg) => {
|
|
366
393
|
throw TypeError(msg);
|
|
367
394
|
};
|
|
368
|
-
var __defNormalProp$
|
|
369
|
-
var __publicField$
|
|
395
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
396
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
370
397
|
var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
|
|
371
398
|
var __privateGet$2 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
372
399
|
var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -375,19 +402,19 @@ var _items;
|
|
|
375
402
|
class MoralityList {
|
|
376
403
|
constructor(items) {
|
|
377
404
|
__privateAdd$3(this, _items);
|
|
378
|
-
__publicField$
|
|
379
|
-
__publicField$
|
|
380
|
-
__publicField$
|
|
381
|
-
__publicField$
|
|
382
|
-
__publicField$
|
|
383
|
-
__publicField$
|
|
384
|
-
__publicField$
|
|
385
|
-
__publicField$
|
|
386
|
-
__publicField$
|
|
387
|
-
__publicField$
|
|
388
|
-
__publicField$
|
|
389
|
-
__publicField$
|
|
390
|
-
__publicField$
|
|
405
|
+
__publicField$9(this, "hero");
|
|
406
|
+
__publicField$9(this, "vigilante");
|
|
407
|
+
__publicField$9(this, "villain");
|
|
408
|
+
__publicField$9(this, "rogue");
|
|
409
|
+
__publicField$9(this, "resistance");
|
|
410
|
+
__publicField$9(this, "loyalist");
|
|
411
|
+
__publicField$9(this, "primal");
|
|
412
|
+
__publicField$9(this, "praetorian");
|
|
413
|
+
__publicField$9(this, "heroic");
|
|
414
|
+
__publicField$9(this, "villainous");
|
|
415
|
+
__publicField$9(this, "paragonCityAccess");
|
|
416
|
+
__publicField$9(this, "rogueIslesAccess");
|
|
417
|
+
__publicField$9(this, "all");
|
|
391
418
|
const set = new Set(items ?? [...MORALITY]);
|
|
392
419
|
this.hero = set.has("hero") || set.has("primal") || set.has("heroic") || set.has("paragon-city-access") || set.has("all");
|
|
393
420
|
this.vigilante = set.has("vigilante") || set.has("primal") || set.has("heroic") || set.has("paragon-city-access") || set.has("rogue-isles-access") || set.has("all");
|
|
@@ -462,9 +489,9 @@ class MoralityList {
|
|
|
462
489
|
}
|
|
463
490
|
_items = new WeakMap();
|
|
464
491
|
|
|
465
|
-
var __defProp$
|
|
466
|
-
var __defNormalProp$
|
|
467
|
-
var __publicField$
|
|
492
|
+
var __defProp$8 = Object.defineProperty;
|
|
493
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
494
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
468
495
|
class AbstractIndex {
|
|
469
496
|
/**
|
|
470
497
|
* Create a new index.
|
|
@@ -472,8 +499,8 @@ class AbstractIndex {
|
|
|
472
499
|
* @param values Values to index.
|
|
473
500
|
*/
|
|
474
501
|
constructor(keyField, values) {
|
|
475
|
-
__publicField$
|
|
476
|
-
__publicField$
|
|
502
|
+
__publicField$8(this, "_values", []);
|
|
503
|
+
__publicField$8(this, "_hashTable", {});
|
|
477
504
|
this._values = values ?? [];
|
|
478
505
|
this._hashTable = {};
|
|
479
506
|
for (const value of this.values) {
|
|
@@ -504,12 +531,23 @@ function toDate(iso) {
|
|
|
504
531
|
return date;
|
|
505
532
|
}
|
|
506
533
|
|
|
507
|
-
var __defProp$
|
|
534
|
+
var __defProp$7 = Object.defineProperty;
|
|
535
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
536
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
537
|
+
class SetTitleIds {
|
|
538
|
+
constructor(value) {
|
|
539
|
+
__publicField$7(this, "primal");
|
|
540
|
+
__publicField$7(this, "praetorian");
|
|
541
|
+
[this.primal, this.praetorian] = value;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
var __defProp$6 = Object.defineProperty;
|
|
508
546
|
var __typeError$2 = (msg) => {
|
|
509
547
|
throw TypeError(msg);
|
|
510
548
|
};
|
|
511
|
-
var __defNormalProp$
|
|
512
|
-
var __publicField$
|
|
549
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
550
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
513
551
|
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
|
|
514
552
|
var __privateGet$1 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
515
553
|
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -522,60 +560,60 @@ class Badge {
|
|
|
522
560
|
/**
|
|
523
561
|
* The database key for this badge.
|
|
524
562
|
*/
|
|
525
|
-
__publicField$
|
|
563
|
+
__publicField$6(this, "key");
|
|
526
564
|
/**
|
|
527
565
|
* The type of badge.
|
|
528
566
|
*/
|
|
529
|
-
__publicField$
|
|
567
|
+
__publicField$6(this, "type");
|
|
530
568
|
/**
|
|
531
569
|
* The name of this badge.
|
|
532
570
|
*
|
|
533
571
|
* May vary by character sex or alignment.
|
|
534
572
|
*/
|
|
535
|
-
__publicField$
|
|
573
|
+
__publicField$6(this, "name");
|
|
536
574
|
/**
|
|
537
575
|
* The date that the badge was added to the game.
|
|
538
576
|
*/
|
|
539
|
-
__publicField$
|
|
577
|
+
__publicField$6(this, "releaseDate");
|
|
540
578
|
/**
|
|
541
579
|
* The character moralities that this badge is available to.
|
|
542
580
|
*/
|
|
543
|
-
__publicField$
|
|
581
|
+
__publicField$6(this, "morality");
|
|
544
582
|
/**
|
|
545
583
|
* The badge text as it appears in-game. May vary by character sex or alignment.
|
|
546
584
|
*/
|
|
547
|
-
__publicField$
|
|
585
|
+
__publicField$6(this, "badgeText");
|
|
548
586
|
/**
|
|
549
587
|
* Short description of how to acquire the badge. Detailed instructions will be in the notes field.
|
|
550
588
|
*/
|
|
551
|
-
__publicField$
|
|
589
|
+
__publicField$6(this, "acquisition");
|
|
552
590
|
/**
|
|
553
591
|
* Absolute URL to this badge's icon.
|
|
554
592
|
*
|
|
555
593
|
* May vary by character sex or alignment.
|
|
556
594
|
*/
|
|
557
|
-
__publicField$
|
|
595
|
+
__publicField$6(this, "icon");
|
|
558
596
|
/**
|
|
559
597
|
* Freeform notes or tips about the badge.
|
|
560
598
|
*/
|
|
561
|
-
__publicField$
|
|
599
|
+
__publicField$6(this, "notes");
|
|
562
600
|
/**
|
|
563
601
|
* List of external links. Wiki, forums, etc.
|
|
564
602
|
*/
|
|
565
|
-
__publicField$
|
|
603
|
+
__publicField$6(this, "links");
|
|
566
604
|
/**
|
|
567
605
|
* The id used with the in-game `/settitle` command to apply the badge.
|
|
568
606
|
* The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
|
|
569
607
|
*/
|
|
570
|
-
__publicField$
|
|
608
|
+
__publicField$6(this, "setTitleId");
|
|
571
609
|
/**
|
|
572
610
|
* A description of the effect the badge will have, such as a buff or granting a temporary power.
|
|
573
611
|
*/
|
|
574
|
-
__publicField$
|
|
612
|
+
__publicField$6(this, "effect");
|
|
575
613
|
/**
|
|
576
614
|
* 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.
|
|
577
615
|
*/
|
|
578
|
-
__publicField$
|
|
616
|
+
__publicField$6(this, "ignoreInTotals");
|
|
579
617
|
this.key = new Key(badgeData.key).value;
|
|
580
618
|
this.type = badgeData.type;
|
|
581
619
|
this.name = new Alternates(badgeData.name);
|
|
@@ -587,7 +625,7 @@ class Badge {
|
|
|
587
625
|
this.notes = badgeData.notes;
|
|
588
626
|
this.links = badgeData.links ?? [];
|
|
589
627
|
this.effect = badgeData.effect;
|
|
590
|
-
this.setTitleId = badgeData.setTitleId;
|
|
628
|
+
this.setTitleId = badgeData.setTitleId ? new SetTitleIds(badgeData.setTitleId) : void 0;
|
|
591
629
|
this.ignoreInTotals = badgeData.ignoreInTotals ?? false;
|
|
592
630
|
__privateSet$1(this, _requirementsIndex, new AbstractIndex("key", badgeData.requirements?.map((x) => new BadgeRequirement(x))));
|
|
593
631
|
for (const requirement of __privateGet$1(this, _requirementsIndex).values) {
|
|
@@ -677,7 +715,7 @@ satisfiesQueryPredicate_fn = function(badge, query) {
|
|
|
677
715
|
const queryString = query?.str?.toLowerCase() ?? "";
|
|
678
716
|
const fields = query?.fields ? new Set(query?.fields) : /* @__PURE__ */ new Set(["name"]);
|
|
679
717
|
if (fields.size === 0) return true;
|
|
680
|
-
return !!(fields.has("name") && badge.name.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || fields.has("badge-text") && badge.badgeText.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || fields.has("acquisition") && badge.acquisition?.toLowerCase().includes(queryString) || fields.has("effect") && badge.effect?.toLowerCase().includes(queryString) || fields.has("notes") && badge.notes?.toLowerCase().includes(queryString) || fields.has("set-title-id") && badge.setTitleId?.
|
|
718
|
+
return !!(fields.has("name") && badge.name.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || fields.has("badge-text") && badge.badgeText.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || fields.has("acquisition") && badge.acquisition?.toLowerCase().includes(queryString) || fields.has("effect") && badge.effect?.toLowerCase().includes(queryString) || fields.has("notes") && badge.notes?.toLowerCase().includes(queryString) || fields.has("set-title-id") && badge.setTitleId?.primal.toString() === queryString || fields.has("set-title-id") && badge.setTitleId?.praetorian?.toString() === queryString);
|
|
681
719
|
};
|
|
682
720
|
satisfiesFilterPredicate_fn = function(badge, filter) {
|
|
683
721
|
return (!filter?.type || badge.type === filter.type) && (!filter?.zoneKey || badge.zoneKey === filter.zoneKey) && (!filter?.morality || badge.morality.has(filter.morality));
|
|
@@ -685,25 +723,25 @@ satisfiesFilterPredicate_fn = function(badge, filter) {
|
|
|
685
723
|
sort_fn = function(badges, sort) {
|
|
686
724
|
switch (sort) {
|
|
687
725
|
case "name.asc": {
|
|
688
|
-
return badges.
|
|
726
|
+
return badges.toSorted(compareByDefaultName);
|
|
689
727
|
}
|
|
690
728
|
case "name.desc": {
|
|
691
|
-
return badges.
|
|
729
|
+
return badges.toSorted((a, b) => compareByDefaultName(b, a));
|
|
692
730
|
}
|
|
693
731
|
case "zone-key.asc": {
|
|
694
|
-
return badges.
|
|
732
|
+
return badges.toSorted(compareByZoneKey);
|
|
695
733
|
}
|
|
696
734
|
case "zone-key.desc": {
|
|
697
|
-
return badges.
|
|
735
|
+
return badges.toSorted((a, b) => compareByZoneKey(b, a));
|
|
698
736
|
}
|
|
699
737
|
case "release-date.asc": {
|
|
700
|
-
return badges.
|
|
738
|
+
return badges.toSorted(compareByReleaseDate);
|
|
701
739
|
}
|
|
702
740
|
case "release-date.desc": {
|
|
703
|
-
return badges.
|
|
741
|
+
return badges.toSorted((a, b) => compareByReleaseDate(b, a));
|
|
704
742
|
}
|
|
705
743
|
case "canonical.desc": {
|
|
706
|
-
return badges.
|
|
744
|
+
return badges.toReversed();
|
|
707
745
|
}
|
|
708
746
|
default: {
|
|
709
747
|
return [...badges];
|
|
@@ -711,39 +749,39 @@ sort_fn = function(badges, sort) {
|
|
|
711
749
|
}
|
|
712
750
|
};
|
|
713
751
|
|
|
714
|
-
var __defProp$
|
|
715
|
-
var __defNormalProp$
|
|
716
|
-
var __publicField$
|
|
752
|
+
var __defProp$5 = Object.defineProperty;
|
|
753
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
754
|
+
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
717
755
|
class BundleHeader {
|
|
718
756
|
constructor(data) {
|
|
719
757
|
/**
|
|
720
758
|
* Name of the fork this bundle contains data for.
|
|
721
759
|
*/
|
|
722
|
-
__publicField$
|
|
760
|
+
__publicField$5(this, "name");
|
|
723
761
|
/**
|
|
724
762
|
* Version number for this data package.
|
|
725
763
|
*/
|
|
726
|
-
__publicField$
|
|
764
|
+
__publicField$5(this, "version");
|
|
727
765
|
/**
|
|
728
766
|
* The time this bundle was last updated.
|
|
729
767
|
*/
|
|
730
|
-
__publicField$
|
|
768
|
+
__publicField$5(this, "lastUpdateTime");
|
|
731
769
|
/**
|
|
732
770
|
* Description of the fork.
|
|
733
771
|
*/
|
|
734
|
-
__publicField$
|
|
772
|
+
__publicField$5(this, "description");
|
|
735
773
|
/**
|
|
736
774
|
* Url for the repository where the bundle is maintained.
|
|
737
775
|
*/
|
|
738
|
-
__publicField$
|
|
776
|
+
__publicField$5(this, "repositoryUrl");
|
|
739
777
|
/**
|
|
740
778
|
* Url for the location of the changelog.
|
|
741
779
|
*/
|
|
742
|
-
__publicField$
|
|
780
|
+
__publicField$5(this, "changelogUrl");
|
|
743
781
|
/**
|
|
744
782
|
* List of external links. Wiki, forums, etc.
|
|
745
783
|
*/
|
|
746
|
-
__publicField$
|
|
784
|
+
__publicField$5(this, "links");
|
|
747
785
|
if (!data) throw new Error("Missing header data");
|
|
748
786
|
this.name = data.name;
|
|
749
787
|
this.version = data.version;
|
|
@@ -755,6 +793,22 @@ class BundleHeader {
|
|
|
755
793
|
}
|
|
756
794
|
}
|
|
757
795
|
|
|
796
|
+
var __defProp$4 = Object.defineProperty;
|
|
797
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
798
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
799
|
+
class LevelRange {
|
|
800
|
+
constructor(value) {
|
|
801
|
+
__publicField$4(this, "min");
|
|
802
|
+
__publicField$4(this, "max");
|
|
803
|
+
if (Array.isArray(value)) {
|
|
804
|
+
this.min = value[0];
|
|
805
|
+
this.max = value[1] === void 0 ? void 0 : value[1];
|
|
806
|
+
} else {
|
|
807
|
+
this.min = value;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
758
812
|
var __defProp$3 = Object.defineProperty;
|
|
759
813
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
760
814
|
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -770,12 +824,32 @@ class Zone {
|
|
|
770
824
|
* The name of the zone as it appears in-game.
|
|
771
825
|
*/
|
|
772
826
|
__publicField$3(this, "name");
|
|
827
|
+
/**
|
|
828
|
+
* The type of zone.
|
|
829
|
+
*/
|
|
830
|
+
__publicField$3(this, "type");
|
|
831
|
+
/**
|
|
832
|
+
* The character moralities that this zone is accessible by.
|
|
833
|
+
*/
|
|
834
|
+
__publicField$3(this, "morality");
|
|
835
|
+
/**
|
|
836
|
+
* The level range this zone is recommended for.
|
|
837
|
+
*/
|
|
838
|
+
__publicField$3(this, "levelRange");
|
|
839
|
+
/**
|
|
840
|
+
* Freeform notes or tips about the zone.
|
|
841
|
+
*/
|
|
842
|
+
__publicField$3(this, "notes");
|
|
773
843
|
/**
|
|
774
844
|
* List of external links. Wiki, forums, etc.
|
|
775
845
|
*/
|
|
776
846
|
__publicField$3(this, "links");
|
|
777
847
|
this.key = new Key(data.key).value;
|
|
778
848
|
this.name = data.name;
|
|
849
|
+
this.type = data.type;
|
|
850
|
+
this.morality = new MoralityList(coalesceToArray(data.morality));
|
|
851
|
+
this.levelRange = data.levelRange ? new LevelRange(data.levelRange) : void 0;
|
|
852
|
+
this.notes = data.notes;
|
|
779
853
|
this.links = data.links ?? [];
|
|
780
854
|
}
|
|
781
855
|
}
|
|
@@ -824,7 +898,7 @@ class Contact {
|
|
|
824
898
|
this.title = data.title;
|
|
825
899
|
this.morality = new MoralityList(coalesceToArray(data.morality));
|
|
826
900
|
this.location = data.location;
|
|
827
|
-
this.levelRange = data.levelRange;
|
|
901
|
+
this.levelRange = data.levelRange ? new LevelRange(data.levelRange) : void 0;
|
|
828
902
|
this.notes = data.notes;
|
|
829
903
|
this.links = data.links ?? [];
|
|
830
904
|
}
|
|
@@ -880,7 +954,7 @@ class Mission {
|
|
|
880
954
|
this.type = data.type;
|
|
881
955
|
this.morality = new MoralityList(coalesceToArray(data.morality));
|
|
882
956
|
this.contactKeys = coalesceToArray(data.contactKeys);
|
|
883
|
-
this.levelRange = data.levelRange;
|
|
957
|
+
this.levelRange = data.levelRange ? new LevelRange(data.levelRange) : void 0;
|
|
884
958
|
this.notes = data.notes;
|
|
885
959
|
this.links = data.links ?? [];
|
|
886
960
|
this.flashback = createFlashback(data);
|
|
@@ -890,7 +964,7 @@ function createFlashback(data) {
|
|
|
890
964
|
if (!data.flashback) return void 0;
|
|
891
965
|
return {
|
|
892
966
|
id: data.flashback.id,
|
|
893
|
-
levelRange: data.flashback.levelRange
|
|
967
|
+
levelRange: data.flashback.levelRange ? new LevelRange(data.flashback.levelRange) : void 0,
|
|
894
968
|
name: data.flashback.name ?? data.name,
|
|
895
969
|
morality: new MoralityList(coalesceToArray(data.flashback.morality ?? data.morality)),
|
|
896
970
|
notes: data.flashback.notes
|
|
@@ -1051,5 +1125,38 @@ class Location {
|
|
|
1051
1125
|
}
|
|
1052
1126
|
}
|
|
1053
1127
|
|
|
1054
|
-
|
|
1128
|
+
function badgeUri(target) {
|
|
1129
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1130
|
+
return `badge://${key}`;
|
|
1131
|
+
}
|
|
1132
|
+
function badgeLink(target) {
|
|
1133
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1134
|
+
return `[${key}](${badgeUri(target)})`;
|
|
1135
|
+
}
|
|
1136
|
+
function contactUri(target) {
|
|
1137
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1138
|
+
return `contact://${key}`;
|
|
1139
|
+
}
|
|
1140
|
+
function contactLink(target) {
|
|
1141
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1142
|
+
return `[${key}](${contactUri(target)})`;
|
|
1143
|
+
}
|
|
1144
|
+
function missionUri(target) {
|
|
1145
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1146
|
+
return `mission://${key}`;
|
|
1147
|
+
}
|
|
1148
|
+
function missionLink(target) {
|
|
1149
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1150
|
+
return `[${key}](${missionUri(target)})`;
|
|
1151
|
+
}
|
|
1152
|
+
function zoneUri(target) {
|
|
1153
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1154
|
+
return `zone://${key}`;
|
|
1155
|
+
}
|
|
1156
|
+
function zoneLink(target) {
|
|
1157
|
+
const key = typeof target === "string" ? target : target.key;
|
|
1158
|
+
return `[${key}](${zoneUri(target)})`;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
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 };
|
|
1055
1162
|
//# sourceMappingURL=coh-content-db.mjs.map
|