coh-content-db 1.4.1 → 2.0.0-rc.10

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 (101) hide show
  1. package/.editorconfig +24 -0
  2. package/.github/workflows/build.yml +38 -0
  3. package/.github/workflows/pull-request.yml +32 -0
  4. package/.github/workflows/release.yml +52 -0
  5. package/CHANGELOG.md +42 -0
  6. package/LICENSE +24 -674
  7. package/README.md +101 -16
  8. package/dist/coh-content-db.d.ts +988 -22
  9. package/dist/coh-content-db.js +1044 -2
  10. package/dist/coh-content-db.js.map +1 -0
  11. package/dist/coh-content-db.mjs +1009 -0
  12. package/dist/coh-content-db.mjs.map +1 -0
  13. package/eslint.config.mjs +31 -0
  14. package/jest.config.mjs +7 -0
  15. package/package.json +31 -23
  16. package/rollup.config.mjs +27 -0
  17. package/src/main/api/alignment.ts +19 -0
  18. package/src/main/api/alternate-data.ts +22 -0
  19. package/src/main/api/archetype-data.ts +5 -0
  20. package/src/main/api/badge-data.ts +81 -0
  21. package/src/main/api/badge-requirement-data.ts +64 -0
  22. package/src/main/api/badge-requirement-type.ts +32 -0
  23. package/src/main/api/badge-type.ts +19 -0
  24. package/src/main/api/bundle-data.ts +47 -0
  25. package/src/main/api/bundle-header-data.ts +37 -0
  26. package/src/main/api/contact-data.ts +48 -0
  27. package/src/main/api/enhancement-category.ts +30 -0
  28. package/src/main/api/link.ts +4 -0
  29. package/src/main/api/location-data.ts +28 -0
  30. package/src/main/api/markdown-string.ts +4 -0
  31. package/src/main/api/mission-data.ts +83 -0
  32. package/src/main/api/mission-type.ts +2 -0
  33. package/src/main/api/morality.ts +31 -0
  34. package/src/main/api/sex.ts +10 -0
  35. package/src/main/api/zone-data.ts +20 -0
  36. package/src/main/db/abstract-index.ts +37 -0
  37. package/src/main/db/alignment-list.ts +54 -0
  38. package/src/main/db/alternates.ts +67 -0
  39. package/src/main/db/archetype.ts +14 -0
  40. package/src/main/db/badge-index.ts +57 -0
  41. package/src/main/db/badge-requirement.ts +81 -0
  42. package/src/main/db/badge-search-options.ts +51 -0
  43. package/src/main/db/badge.ts +147 -0
  44. package/src/main/db/bundle-header.ts +44 -0
  45. package/src/main/db/coh-content-database.ts +138 -0
  46. package/src/main/db/contact.ts +62 -0
  47. package/src/main/db/key.ts +18 -0
  48. package/src/main/db/location.ts +30 -0
  49. package/src/main/db/mission.ts +107 -0
  50. package/src/main/db/morality-list.ts +99 -0
  51. package/src/main/db/paged.ts +7 -0
  52. package/src/main/db/zone.ts +28 -0
  53. package/src/main/index.ts +41 -0
  54. package/src/main/util.ts +118 -0
  55. package/src/test/api/alignment.test.ts +65 -0
  56. package/src/test/api/archetype-data.fixture.ts +8 -0
  57. package/src/test/api/badge-data.fixture.ts +8 -0
  58. package/src/test/api/badge-data.test.ts +15 -0
  59. package/src/test/api/badge-requirement-data.fixture.ts +7 -0
  60. package/src/test/api/badge-requirement-type.test.ts +31 -0
  61. package/src/test/api/badge-type.test.ts +35 -0
  62. package/src/test/api/bundle-data.fixture.ts +6 -0
  63. package/src/test/api/bundle-header-data.fixture.ts +6 -0
  64. package/src/test/api/contact-data.fixture.ts +7 -0
  65. package/src/test/api/enhancement-category.test.ts +35 -0
  66. package/src/test/api/mission-data.fixture.ts +12 -0
  67. package/src/test/api/sex.test.ts +63 -0
  68. package/src/test/api/zone-data.fixture.ts +8 -0
  69. package/src/test/db/abstract-index.test.ts +55 -0
  70. package/src/test/db/alignment-list.test.ts +200 -0
  71. package/src/test/db/alternates.test.ts +188 -0
  72. package/src/test/db/archetype.test.ts +38 -0
  73. package/src/test/db/badge-index.test.ts +519 -0
  74. package/src/test/db/badge-requirement.test.ts +145 -0
  75. package/src/test/db/badge.test.ts +337 -0
  76. package/src/test/db/bundle-header.test.ts +76 -0
  77. package/src/test/db/coh-content-database.test.ts +282 -0
  78. package/src/test/db/contact.test.ts +97 -0
  79. package/src/test/db/key.test.ts +22 -0
  80. package/src/test/db/location.test.ts +51 -0
  81. package/src/test/db/mission.test.ts +171 -0
  82. package/src/test/db/morality-list.test.ts +457 -0
  83. package/src/test/db/zone.test.ts +36 -0
  84. package/src/test/integration.test.ts +16 -0
  85. package/src/test/util.test.ts +165 -0
  86. package/tsconfig.json +117 -0
  87. package/dist/_changelog.d.ts +0 -3
  88. package/dist/coh-content-db.nomin.js +0 -635
  89. package/dist/content-refence-utils.d.ts +0 -4
  90. package/dist/index.d.ts +0 -8
  91. package/dist/internal/_common.d.ts +0 -4
  92. package/dist/internal/archetype.d.ts +0 -10
  93. package/dist/internal/badge.d.ts +0 -44
  94. package/dist/internal/game-map.d.ts +0 -33
  95. package/dist/internal/server-group.d.ts +0 -24
  96. package/dist/types/archetype.d.ts +0 -9
  97. package/dist/types/badge.d.ts +0 -192
  98. package/dist/types/enhancement.d.ts +0 -28
  99. package/dist/types/game-map.d.ts +0 -47
  100. package/dist/types/link.d.ts +0 -4
  101. package/dist/types/server-group.d.ts +0 -75
@@ -1,44 +0,0 @@
1
- import { BadgePartialType, BadgeType, EnhancementCategory, IAlignmentFlags, IAlternateValue, IBadge, IBadgeData, IBadgePartial, IBadgePartialData, ILink, PlaqueType } from "..";
2
- import { ServerGroup } from "./server-group";
3
- export declare class Badge implements IBadge {
4
- readonly serverGroup: ServerGroup;
5
- readonly key: string;
6
- type?: BadgeType;
7
- names?: IAlternateValue[];
8
- alignment?: IAlignmentFlags;
9
- badgeText?: IAlternateValue[];
10
- acquisition?: string;
11
- icons?: IAlternateValue[];
12
- notes?: string;
13
- links?: ILink[];
14
- mapKey?: string;
15
- location?: number[];
16
- vidiotMapKey?: string;
17
- setTitleId?: number;
18
- setTitleIdPraetorian?: number;
19
- effect?: string;
20
- partials?: BadgePartial[];
21
- ignoreInTotals?: boolean;
22
- private partialCache;
23
- constructor(serverGroup: ServerGroup, key: string);
24
- load(data: IBadgeData): void;
25
- getPartial(key: string): IBadgePartial | null;
26
- }
27
- export declare class BadgePartial implements IBadgePartial {
28
- readonly serverGroup: ServerGroup;
29
- readonly parent: Badge;
30
- readonly key: string;
31
- type?: BadgePartialType;
32
- mapKey?: string;
33
- location?: number[];
34
- plaqueType?: PlaqueType;
35
- inscription?: string;
36
- vidiotMapKey?: string;
37
- badgeKey?: string;
38
- inventionLevel?: number;
39
- inventionTypes?: EnhancementCategory[];
40
- count?: number;
41
- notes?: string;
42
- constructor(serverGroup: ServerGroup, parent: Badge, key: string);
43
- load(data: IBadgePartialData): void;
44
- }
@@ -1,33 +0,0 @@
1
- import { IGameMap, IGameMapData, ILink, IVidiotMap, IVidiotMapData, IVidiotMapPoi, IVidiotMapPoiData } from "..";
2
- import { ServerGroup } from "./server-group";
3
- export declare class GameMap implements IGameMap {
4
- readonly serverGroup: ServerGroup;
5
- readonly key: string;
6
- name: string;
7
- links?: ILink[];
8
- vidiotMaps?: IVidiotMap[];
9
- constructor(serverGroup: ServerGroup, key: string);
10
- load(data: IGameMapData): void;
11
- }
12
- export declare class VidiotMap implements IVidiotMap {
13
- readonly serverGroup: ServerGroup;
14
- readonly map: IGameMap;
15
- href: string;
16
- name?: string;
17
- pointsOfInterest: VidiotMapPoi[];
18
- constructor(serverGroup: ServerGroup, map: IGameMap);
19
- load(data: IVidiotMapData): VidiotMap;
20
- }
21
- export declare class VidiotMapPoi implements IVidiotMapPoi {
22
- readonly serverGroup: ServerGroup;
23
- readonly map: IGameMap;
24
- readonly vidiotMap: IVidiotMap;
25
- x: number;
26
- y: number;
27
- notes?: string;
28
- mapKey?: string;
29
- badgeKey?: string;
30
- badgePartialKey?: string;
31
- constructor(serverGroup: ServerGroup, map: IGameMap, vidiotMap: IVidiotMap);
32
- load(data: IVidiotMapPoiData): VidiotMapPoi;
33
- }
@@ -1,24 +0,0 @@
1
- import { IBadge, IGameMap, IServer, IServerGroup, IServerGroupData, ServerGroupStatus } from "..";
2
- import { IArchetype } from "../types/archetype";
3
- export declare class ServerGroup implements IServerGroup {
4
- readonly key: string;
5
- name?: string;
6
- description?: string;
7
- status?: ServerGroupStatus[];
8
- repository?: string;
9
- servers?: IServer[];
10
- archetypes: IArchetype[];
11
- maps: IGameMap[];
12
- badges: IBadge[];
13
- changelog: {
14
- [id: string]: string;
15
- };
16
- private archetypeCache;
17
- private mapCache;
18
- private badgeCache;
19
- constructor(key: string);
20
- load(data: IServerGroupData): void;
21
- getArchetype(key: string): IArchetype | null;
22
- getMap(key: string): IGameMap | null;
23
- getBadge(key: string): IBadge | null;
24
- }
@@ -1,9 +0,0 @@
1
- import { IServerGroup } from "./server-group";
2
- export interface IArchetypeData {
3
- readonly key: string;
4
- readonly name?: string;
5
- readonly description?: string;
6
- }
7
- export interface IArchetype extends IArchetypeData {
8
- readonly serverGroup: IServerGroup;
9
- }
@@ -1,192 +0,0 @@
1
- import { ILink } from "./link";
2
- import { IServerGroup } from "./server-group";
3
- import { EnhancementCategory } from "./enhancement";
4
- export interface IBadgeData {
5
- /**
6
- * Key.
7
- */
8
- readonly key: string;
9
- /**
10
- * Badge type.
11
- */
12
- readonly type?: BadgeType;
13
- /**
14
- * The names this badge is known by.
15
- */
16
- readonly names?: IAlternateValue[];
17
- /**
18
- * The alignments this badge can be obtained by.
19
- */
20
- readonly alignment?: IAlignmentFlags;
21
- /**
22
- * The in-game badge text.
23
- */
24
- readonly badgeText?: IAlternateValue[];
25
- /**
26
- * The method used to acquire the badge.
27
- */
28
- readonly acquisition?: string;
29
- /**
30
- * Badge images. Use the absolute url images hosted in a CDN or similar publicly-accessible location.
31
- */
32
- readonly icons?: IAlternateValue[];
33
- /**
34
- * Notes or tips about the badge.
35
- */
36
- readonly notes?: string;
37
- /**
38
- * List of links to external resources.
39
- */
40
- readonly links?: ILink[];
41
- /**
42
- * Key of the map this badge is found on for exploration badges.
43
- */
44
- readonly mapKey?: string;
45
- /**
46
- * /loc coordinates of the badge in-game.
47
- */
48
- readonly location?: number[];
49
- /**
50
- * The number or letter the badge appears as on Vidiot Maps.
51
- */
52
- readonly vidiotMapKey?: string;
53
- /**
54
- * Number used with the in-game `settitle` slash command to apply the badge.
55
- */
56
- readonly setTitleId?: number;
57
- /**
58
- * Some praetorian badges have a different settitle id.
59
- */
60
- readonly setTitleIdPraetorian?: number;
61
- /**
62
- * A description of the effect the badge will have, such as a buff or granting a temporary power.
63
- */
64
- readonly effect?: string;
65
- /**
66
- * For badges that have partial fulfilment requirements, such as plaques for history badges, or other badges for meta-badges like accolades.
67
- */
68
- readonly partials?: IBadgePartialData[];
69
- /**
70
- * 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.
71
- */
72
- readonly ignoreInTotals?: boolean;
73
- }
74
- export interface IBadgePartialData {
75
- /**
76
- * Key.
77
- */
78
- readonly key: string;
79
- /**
80
- * Type of partial.
81
- */
82
- readonly type?: BadgePartialType;
83
- /**
84
- * Map the partial is located on.
85
- */
86
- readonly mapKey?: string;
87
- /**
88
- * /loc coordinates.
89
- */
90
- readonly location?: number[];
91
- /**
92
- * Is it a wall plaque or a physical monument?
93
- */
94
- readonly plaqueType?: PlaqueType;
95
- /**
96
- * Plaque inscription.
97
- */
98
- readonly inscription?: string;
99
- /**
100
- * The number or letter the partial appears as on Vidiot Maps.
101
- */
102
- readonly vidiotMapKey?: string;
103
- /**
104
- * The badge required for this partial.
105
- */
106
- readonly badgeKey?: string;
107
- /**
108
- * Level of the invention required.
109
- */
110
- readonly inventionLevel?: number;
111
- /**
112
- * The types of enhancements required to be crafted.
113
- */
114
- readonly inventionTypes?: EnhancementCategory[];
115
- /**
116
- * Number of invention crafts required.
117
- */
118
- readonly count?: number;
119
- /**
120
- * Any additional notes.
121
- */
122
- readonly notes?: string;
123
- }
124
- export declare enum BadgeType {
125
- EXPLORATION = "EXPLORATION",
126
- HISTORY = "HISTORY",
127
- ACCOMPLISHMENT = "ACCOMPLISHMENT",
128
- ACHIEVEMENT = "ACHIEVEMENT",
129
- ACCOLADE = "ACCOLADE",
130
- GLADIATOR = "GLADIATOR",
131
- VETERAN = "VETERAN",
132
- PVP = "PVP",
133
- INVENTION = "INVENTION",
134
- DEFEAT = "DEFEAT",
135
- EVENT = "EVENT",
136
- OUROBOROS = "OUROBOROS",
137
- CONSIGNMENT = "CONSIGNMENT",
138
- DAY_JOB = "DAY_JOB",
139
- AE = "AE"
140
- }
141
- export declare enum BadgePartialType {
142
- PLAQUE = "PLAQUE",
143
- BADGE = "BADGE",
144
- INVENTION = "INVENTION",
145
- /**
146
- * Some invention badges require you to build x of two different invention levels, 'plus one of either level'.
147
- */
148
- INVENTION_PLUS_ONE = "INVENTION_PLUS_ONE"
149
- }
150
- export interface IAlternateValue {
151
- readonly type?: Alternate;
152
- readonly value: string;
153
- }
154
- /**
155
- * For badges that have alternate values based on the alignment (H/V/P) or sex (M/F) of the character.
156
- */
157
- export declare enum Alternate {
158
- M = "M",
159
- F = "F",
160
- H = "H",
161
- V = "V",
162
- P = "P",
163
- MH = "MH",
164
- MV = "MV",
165
- MP = "MP",
166
- FH = "FH",
167
- FV = "FV",
168
- FP = "FP"
169
- }
170
- export interface IAlignmentFlags {
171
- readonly h: boolean;
172
- readonly v: boolean;
173
- readonly p: boolean;
174
- }
175
- export declare const ALIGNMENT_HERO: IAlignmentFlags;
176
- export declare const ALIGNMENT_VILLAIN: IAlignmentFlags;
177
- export declare const ALIGNMENT_PRIMAL: IAlignmentFlags;
178
- export declare const ALIGNMENT_PRAETORIAN: IAlignmentFlags;
179
- export declare const ALIGNMENT_ANY: IAlignmentFlags;
180
- export declare enum PlaqueType {
181
- WALL_PLAQUE = "WALL_PLAQUE",
182
- MONUMENT = "MONUMENT"
183
- }
184
- export interface IBadge extends IBadgeData {
185
- readonly serverGroup: IServerGroup;
186
- readonly partials?: IBadgePartial[];
187
- getPartial(key: string): IBadgePartial | null;
188
- }
189
- export interface IBadgePartial extends IBadgePartialData {
190
- readonly serverGroup: IServerGroup;
191
- readonly parent: IBadge;
192
- }
@@ -1,28 +0,0 @@
1
- export declare enum EnhancementCategory {
2
- DEFENSE_DEBUFF = "DEFENSE_DEBUFF",
3
- TO_HIT_DEBUFF = "TO_HIT_DEBUFF",
4
- TAUNT = "TAUNT",
5
- CONFUSE = "CONFUSE",
6
- HEALING = "HEALING",
7
- DEFENSE_BUFF = "DEFENSE_BUFF",
8
- RESIST_DAMAGE = "RESIST_DAMAGE",
9
- INTANGIBILITY = "INTANGIBILITY",
10
- SLEEP = "SLEEP",
11
- SLOW = "SLOW",
12
- HOLD = "HOLD",
13
- STUN = "STUN",
14
- IMMOBILIZE = "IMMOBILIZE",
15
- FEAR = "FEAR",
16
- ENDURANCE_MODIFICATION = "ENDURANCE_MODIFICATION",
17
- ENDURANCE_REDUCTION = "ENDURANCE_REDUCTION",
18
- RECHARGE_REDUCTION = "RECHARGE_REDUCTION",
19
- INTERRUPT_DURATION = "INTERRUPT_DURATION",
20
- ACCURACY = "ACCURACY",
21
- TO_HIT_BUFF = "TO_HIT_BUFF",
22
- DAMAGE = "DAMAGE",
23
- KNOCKBACK = "KNOCKBACK",
24
- RUN_SPEED = "RUN_SPEED",
25
- JUMP = "JUMP",
26
- FLY_SPEED = "FLY_SPEED",
27
- RANGE = "RANGE"
28
- }
@@ -1,47 +0,0 @@
1
- import { ILink } from "./link";
2
- import { IServerGroup } from "./server-group";
3
- export interface IGameMapData {
4
- readonly key: string;
5
- readonly name: string;
6
- readonly links?: ILink[];
7
- readonly vidiotMaps?: IVidiotMapData[];
8
- }
9
- export interface IVidiotMapData {
10
- /**
11
- * URL for the vidiot map image.
12
- */
13
- readonly href: string;
14
- readonly name?: string;
15
- readonly pointsOfInterest?: IVidiotMapPoiData[];
16
- }
17
- export interface IVidiotMapPoiData {
18
- readonly x: number;
19
- readonly y: number;
20
- readonly notes?: string;
21
- /**
22
- * If the POI is a zone transfer, the map it transfers to.
23
- */
24
- readonly mapKey?: string;
25
- /**
26
- * If the POI is a badge, the badge.
27
- */
28
- readonly badgeKey?: string;
29
- /**
30
- * If the POI is a partial for a badge, the partial key.
31
- */
32
- readonly badgePartialKey?: string;
33
- }
34
- export interface IGameMap extends IGameMapData {
35
- readonly serverGroup: IServerGroup;
36
- readonly vidiotMaps?: IVidiotMap[];
37
- }
38
- export interface IVidiotMap extends IVidiotMapData {
39
- readonly serverGroup: IServerGroup;
40
- readonly map: IGameMap;
41
- readonly pointsOfInterest?: IVidiotMapPoi[];
42
- }
43
- export interface IVidiotMapPoi extends IVidiotMapPoiData {
44
- readonly serverGroup: IServerGroup;
45
- readonly map: IGameMap;
46
- readonly vidiotMap: IVidiotMap;
47
- }
@@ -1,4 +0,0 @@
1
- export interface ILink {
2
- title: string;
3
- href: string;
4
- }
@@ -1,75 +0,0 @@
1
- import { IBadge, IBadgeData } from "./badge";
2
- import { IGameMap, IGameMapData } from "./game-map";
3
- import { IArchetype, IArchetypeData } from "./archetype";
4
- /**
5
- * A server group is a collection of game servers.
6
- */
7
- export interface IServerGroupData {
8
- /**
9
- * Key.
10
- */
11
- readonly key: string;
12
- /**
13
- * Name of the server group.
14
- */
15
- readonly name?: string;
16
- /**
17
- * Description of the server group. Markdown allowed.
18
- */
19
- readonly description?: string;
20
- /**
21
- * Status of the content module. {@see ServerGroupStatus}.
22
- */
23
- readonly status?: ServerGroupStatus[];
24
- /**
25
- * Repository where the db content package is maintained.
26
- */
27
- readonly repository?: string;
28
- /**
29
- * List of the names of the servers in this group.
30
- * Torchbearer, Excelsior, etc.
31
- */
32
- readonly servers?: IServerData[];
33
- /**
34
- * List of archetypes available on this group.
35
- */
36
- readonly archetypes?: IArchetypeData[];
37
- /**
38
- * List of game maps supported by this server group.
39
- */
40
- readonly maps?: IGameMapData[];
41
- /**
42
- * List of badges available on this server group.
43
- */
44
- readonly badges?: IBadgeData[];
45
- /**
46
- * Change log.
47
- */
48
- readonly changelog?: {
49
- [id: string]: string;
50
- };
51
- }
52
- export interface IServerData {
53
- name: string;
54
- }
55
- export declare enum ServerGroupStatus {
56
- /**
57
- * Package is still being developed, and may be missing some data or some data may be inaccurate.
58
- */
59
- WORK_IN_PROGRESS = "WORK_IN_PROGRESS",
60
- /**
61
- * This server group has been sunset, and is not longer being maintained/developed.
62
- */
63
- SUNSET = "SUNSET"
64
- }
65
- export interface IServerGroup extends IServerGroupData {
66
- readonly servers?: IServer[];
67
- readonly archetypes?: IArchetype[];
68
- readonly maps?: IGameMap[];
69
- readonly badges?: IBadge[];
70
- getArchetype(key: string): IArchetype | null;
71
- getMap(key: string): IGameMap | null;
72
- getBadge(key: string): IBadge | null;
73
- }
74
- export interface IServer extends IServerData {
75
- }