mediawiki-projects-list 1.0.4 → 1.1.2

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/index.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ declare module 'mediawiki-projects-list' {
2
+
3
+ /** A MediaWiki project */
4
+ export type WikiProject = {
5
+ /** Hostname of the project */
6
+ name: string;
7
+ /** Regex to match the project url */
8
+ regex: string;
9
+ /** Article path of the project */
10
+ articlePath: string;
11
+ /** Script path of the project */
12
+ scriptPath: string;
13
+ /** Only exists when the hostname contains multiple wikis: How to handle the id string */
14
+ idString?: {
15
+ /** Separator to join or split the id string on */
16
+ separator: string;
17
+ /** Order in which the project regex additional group matches should be chained to gain the id string */
18
+ direction: "asc" | "desc";
19
+ /** Regex to match the id string */
20
+ regex: string;
21
+ /** How to turn the group matches of the id string regex into an URL to the script path, index based on group matches */
22
+ scriptPaths: string[];
23
+ };
24
+ /** Whether the paths include matches of the regex */
25
+ regexPaths: boolean;
26
+ /** Wiki farm of the project */
27
+ wikiFarm: ("wikimedia" | "fandom" | "miraheze" | "wiki.gg" | "biligame" | "huijiwiki" | "shoutwiki") | null;
28
+ /** List of extensions providing useful API endpoints */
29
+ extensions: ("CentralAuth" | "Cargo")[];
30
+ /** Replacement for spaces in the article URL */
31
+ urlSpaceReplacement: string;
32
+ /** Note about the specific project */
33
+ note: string | null;
34
+ };
35
+
36
+ /** List of MediaWiki projects */
37
+ export const wikiProjects: WikiProject[];
38
+
39
+ export function inputToWikiProject(input: string): {
40
+ fullArticlePath: string;
41
+ fullScriptPath: string;
42
+ wikiProject: WikiProject;
43
+ } | null;
44
+
45
+ export function urlToIdString(url: URL): string | null;
46
+
47
+ export function idStringToUrl(idString: string, projectName: string): URL | null;
48
+
49
+ }
package/index.js CHANGED
@@ -13,7 +13,7 @@ const {properties: {wikiProjects: {items: {properties: wikiProjectSchema}}}} = r
13
13
  * @property {string} idString.regex - Regex to match the id string
14
14
  * @property {string[]} idString.scriptPaths - How to turn the group matches of the id string regex into an URL to the script path, index based on group matches
15
15
  * @property {boolean} regexPaths - Whether the paths include matches of the regex
16
- * @property {?("wikimedia"|"fandom"|"miraheze"|"wiki.gg")} wikiFarm - Wiki farm of the project
16
+ * @property {?("wikimedia"|"fandom"|"miraheze"|"wiki.gg"|"biligame"|"huijiwiki"|"shoutwiki")} wikiFarm - Wiki farm of the project
17
17
  * @property {("CentralAuth"|"Cargo")[]} extensions - List of extensions providing useful API endpoints
18
18
  * @property {string} urlSpaceReplacement - Replacement for spaces in the article URL
19
19
  * @property {?string} note - Note about the specific project
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "mediawiki-projects-list",
3
- "version": "1.0.4",
3
+ "version": "1.1.2",
4
4
  "type": "commonjs",
5
5
  "description": "List of MediaWiki projects for use in discord-wiki-bot",
6
6
  "main": "index.js",
7
7
  "files": [
8
8
  "index.js",
9
+ "index.d.ts",
9
10
  "projects.json",
10
11
  "projects-schema.json"
11
12
  ],
@@ -83,7 +83,10 @@
83
83
  "wikimedia",
84
84
  "fandom",
85
85
  "miraheze",
86
- "wiki.gg"
86
+ "wiki.gg",
87
+ "biligame",
88
+ "huijiwiki",
89
+ "shoutwiki"
87
90
  ],
88
91
  "default": null
89
92
  },
@@ -120,6 +123,7 @@
120
123
  ],
121
124
  "additionalProperties": false
122
125
  },
126
+ "uniqueItemProperties": ["name"],
123
127
  "additionalItems": false
124
128
  }
125
129
  },
package/projects.json CHANGED
@@ -261,7 +261,8 @@
261
261
  "scriptPaths": [
262
262
  "https://wiki.biligame.com/$1/"
263
263
  ]
264
- }
264
+ },
265
+ "wikiFarm": "biligame"
265
266
  },
266
267
  {
267
268
  "name": "metapedia.org",
@@ -285,7 +286,8 @@
285
286
  "scriptPaths": [
286
287
  "https://$1.brickimedia.org/w/"
287
288
  ]
288
- }
289
+ },
290
+ "wikiFarm": "shoutwiki"
289
291
  },
290
292
  {
291
293
  "name": "wiki.openstreetmap.org",
@@ -315,7 +317,10 @@
315
317
  "name": "pcgamingwiki.com",
316
318
  "regex": "((?:www\\.)?pcgamingwiki.com)",
317
319
  "articlePath": "/wiki/",
318
- "scriptPath": "/w/"
320
+ "scriptPath": "/w/",
321
+ "extensions": [
322
+ "Cargo"
323
+ ]
319
324
  },
320
325
  {
321
326
  "name": "metin2.gameforge.com",
@@ -394,7 +399,10 @@
394
399
  "name": "gbf.wiki",
395
400
  "regex": "((?:www\\.)?gbf\\.wiki)",
396
401
  "articlePath": "/",
397
- "scriptPath": "/"
402
+ "scriptPath": "/",
403
+ "extensions": [
404
+ "Cargo"
405
+ ]
398
406
  },
399
407
  {
400
408
  "name": "wiki.albiononline.com",
@@ -406,13 +414,16 @@
406
414
  "name": "atitd.wiki",
407
415
  "regex": "((?:www\\.)?atitd\\.wiki)",
408
416
  "articlePath": "/tale10/",
409
- "scriptPath": "/tale10/w/"
417
+ "scriptPath": "/tale10/w/",
418
+ "extensions": [
419
+ "Cargo"
420
+ ]
410
421
  },
411
422
  {
412
- "name": "atitd.wiki",
413
- "regex": "((?:www\\.)?atitd\\.wiki)",
414
- "articlePath": "/tale10/",
415
- "scriptPath": "/tale10/w/"
423
+ "name": "consolegameswiki.com",
424
+ "regex": "((?:ffxiv\\.)?consolegameswiki\\.com)",
425
+ "articlePath": "/wiki/",
426
+ "scriptPath": "/mediawiki/"
416
427
  },
417
428
  {
418
429
  "name": "niwanetwork.org",
@@ -484,7 +495,10 @@
484
495
  "name": "dragalialost.wiki",
485
496
  "regex": "((?:www\\.)?dragalialost\\.wiki)",
486
497
  "articlePath": "/w/",
487
- "scriptPath": "/"
498
+ "scriptPath": "/",
499
+ "extensions": [
500
+ "Cargo"
501
+ ]
488
502
  },
489
503
  {
490
504
  "name": "dragon-quest.org",
@@ -502,7 +516,10 @@
502
516
  "name": "fireemblemwiki.org",
503
517
  "regex": "((?:www\\.)?fireemblemwiki\\.org)",
504
518
  "articlePath": "/wiki/",
505
- "scriptPath": "/w/"
519
+ "scriptPath": "/w/",
520
+ "extensions": [
521
+ "Cargo"
522
+ ]
506
523
  },
507
524
  {
508
525
  "name": "mutecity.org",
@@ -532,7 +549,10 @@
532
549
  "scriptPaths": [
533
550
  "https://$1.splatoonwiki.org/w/"
534
551
  ]
535
- }
552
+ },
553
+ "extensions": [
554
+ "Cargo"
555
+ ]
536
556
  },
537
557
  {
538
558
  "name": "starfoxwiki.info",
@@ -550,7 +570,10 @@
550
570
  "name": "nookipedia.com",
551
571
  "regex": "((?:www\\.)?nookipedia\\.com)",
552
572
  "articlePath": "/wiki/",
553
- "scriptPath": "/w/"
573
+ "scriptPath": "/w/",
574
+ "extensions": [
575
+ "Cargo"
576
+ ]
554
577
  },
555
578
  {
556
579
  "name": "pikminwiki.com",
@@ -950,7 +973,10 @@
950
973
  "name": "segaretro.org",
951
974
  "regex": "((?:www\\.)?segaretro\\.org)",
952
975
  "articlePath": "/",
953
- "scriptPath": "/"
976
+ "scriptPath": "/",
977
+ "extensions": [
978
+ "Cargo"
979
+ ]
954
980
  },
955
981
  {
956
982
  "name": "necretro.org",
@@ -1186,6 +1212,193 @@
1186
1212
  "articlePath": "/",
1187
1213
  "scriptPath": "/w/"
1188
1214
  },
1215
+ {
1216
+ "name": "developer.valvesoftware.com",
1217
+ "regex": "(developer\\.valvesoftware\\.com)",
1218
+ "articlePath": "/wiki/",
1219
+ "scriptPath": "/w/"
1220
+ },
1221
+ {
1222
+ "name": "pixelmonmod.com",
1223
+ "regex": "((?:www\\.)?pixelmonmod\\.com)",
1224
+ "articlePath": "/wiki/",
1225
+ "scriptPath": "/w/"
1226
+ },
1227
+ {
1228
+ "name": "dmowiki.com",
1229
+ "regex": "((?:www\\.)?dmowiki\\.com)",
1230
+ "articlePath": "/",
1231
+ "scriptPath": "/"
1232
+ },
1233
+ {
1234
+ "name": "awoiaf.westeros.org",
1235
+ "regex": "(awoiaf\\.westeros\\.org)",
1236
+ "articlePath": "/index.php/",
1237
+ "scriptPath": "/"
1238
+ },
1239
+ {
1240
+ "name": "westeros.ir",
1241
+ "regex": "((?:www\\.)?westeros\\.ir)",
1242
+ "articlePath": "/wiki/index.php?title=",
1243
+ "scriptPath": "/wiki/"
1244
+ },
1245
+ {
1246
+ "name": "lagardedenuit.com",
1247
+ "regex": "((?:www\\.)?lagardedenuit\\.com)",
1248
+ "articlePath": "/wiki/index.php?title=",
1249
+ "scriptPath": "/wiki/"
1250
+ },
1251
+ {
1252
+ "name": "7kingdoms.ru",
1253
+ "regex": "((?:www\\.)?7kingdoms\\.ru)",
1254
+ "articlePath": "/wiki/",
1255
+ "scriptPath": "/w/"
1256
+ },
1257
+ {
1258
+ "name": "wiki.geloefogo.com",
1259
+ "regex": "(wiki\\.geloefogo\\.com)",
1260
+ "articlePath": "/index.php/",
1261
+ "scriptPath": "/"
1262
+ },
1263
+ {
1264
+ "name": "huijiwiki.com",
1265
+ "regex": "((?:([a-z\\d-]{1,50})\\.)?huijiwiki\\.com)",
1266
+ "articlePath": "/wiki/",
1267
+ "scriptPath": "/",
1268
+ "idString": {
1269
+ "regex": "([a-z\\d-]{1,50})",
1270
+ "scriptPaths": [
1271
+ "https://$1.huijiwiki.com/"
1272
+ ]
1273
+ },
1274
+ "wikiFarm": "huijiwiki"
1275
+ },
1276
+ {
1277
+ "name": "chocolate-doom.org",
1278
+ "regex": "((?:www\\.)?chocolate-doom\\.org)",
1279
+ "articlePath": "/wiki/index.php/",
1280
+ "scriptPath": "/wiki/"
1281
+ },
1282
+ {
1283
+ "name": "glitchcity.wiki",
1284
+ "regex": "((?:www\\.)?glitchcity\\.wiki)",
1285
+ "articlePath": "/",
1286
+ "scriptPath": "/"
1287
+ },
1288
+ {
1289
+ "name": "playstationdev.wiki",
1290
+ "regex": "((?:www\\.)?playstationdev\\.wiki/([a-z0-9]{1,50}))",
1291
+ "articlePath": "/index.php/",
1292
+ "scriptPath": "/",
1293
+ "idString": {
1294
+ "regex": "([a-z0-9]{1,50})",
1295
+ "scriptPaths": [
1296
+ "https://playstationdev.wiki/$1/"
1297
+ ]
1298
+ }
1299
+ },
1300
+ {
1301
+ "name": "psdevwiki.com",
1302
+ "regex": "((?:www\\.)?psdevwiki\\.com/([a-z0-9]{1,50}))",
1303
+ "articlePath": "/",
1304
+ "scriptPath": "/",
1305
+ "idString": {
1306
+ "regex": "([a-z0-9]{1,50})",
1307
+ "scriptPaths": [
1308
+ "https://www.psdevwiki.com/$1/"
1309
+ ]
1310
+ }
1311
+ },
1312
+ {
1313
+ "name": "wiki.henkaku.xyz",
1314
+ "regex": "(wiki\\.henkaku\\.xyz)",
1315
+ "articlePath": "/vita/",
1316
+ "scriptPath": "/vita/"
1317
+ },
1318
+ {
1319
+ "name": "wiki.raregamingdump.ca",
1320
+ "regex": "(wiki\\.raregamingdump\\.ca)",
1321
+ "articlePath": "/index.php/",
1322
+ "scriptPath": "/"
1323
+ },
1324
+ {
1325
+ "name": "sttwiki.org",
1326
+ "regex": "((?:www\\.)?sttwiki\\.org)",
1327
+ "articlePath": "/wiki/",
1328
+ "scriptPath": "/"
1329
+ },
1330
+ {
1331
+ "name": "wavu.wiki",
1332
+ "regex": "((?:www\\.)?wavu\\.wiki)",
1333
+ "articlePath": "/t/",
1334
+ "scriptPath": "/w/"
1335
+ },
1336
+ {
1337
+ "name": "blazblue.wiki",
1338
+ "regex": "((?:www\\.)?blazblue\\.wiki)",
1339
+ "articlePath": "/wiki/",
1340
+ "scriptPath": "/",
1341
+ "extensions": [
1342
+ "Cargo"
1343
+ ]
1344
+ },
1345
+ {
1346
+ "name": "archives.org.au",
1347
+ "regex": "((?:www\\.)?archives\\.org\\.au)",
1348
+ "articlePath": "/",
1349
+ "scriptPath": "/",
1350
+ "extensions": [
1351
+ "Cargo"
1352
+ ]
1353
+ },
1354
+ {
1355
+ "name": "dragon-mania-legends.wiki",
1356
+ "regex": "((?:www\\.)?dragon-mania-legends\\.wiki)",
1357
+ "articlePath": "/",
1358
+ "scriptPath": "/"
1359
+ },
1360
+ {
1361
+ "name": "wiki.guildwars.com",
1362
+ "regex": "(wiki\\.guildwars\\.com)",
1363
+ "articlePath": "/wiki/",
1364
+ "scriptPath": "/"
1365
+ },
1366
+ {
1367
+ "name": "guildwiki.de",
1368
+ "regex": "((?:www\\.)?guildwiki\\.de)",
1369
+ "articlePath": "/wiki/",
1370
+ "scriptPath": "/gwiki/"
1371
+ },
1372
+ {
1373
+ "name": "gwiki.fr",
1374
+ "regex": "((?:www\\.)?gwiki\\.fr)",
1375
+ "articlePath": "/wiki/",
1376
+ "scriptPath": "/w/"
1377
+ },
1378
+ {
1379
+ "name": "guildwars2.com",
1380
+ "regex": "(wiki(?:-(en|de|es|fr))?\\.guildwars2\\.com)",
1381
+ "articlePath": "/wiki/",
1382
+ "scriptPath": "/",
1383
+ "idString": {
1384
+ "regex": "(en|de|es|fr)",
1385
+ "scriptPaths": [
1386
+ "https://wiki-$1.guildwars2.com/"
1387
+ ]
1388
+ }
1389
+ },
1390
+ {
1391
+ "name": "ashesofcreation.wiki",
1392
+ "regex": "((?:www\\.)?ashesofcreation\\.wiki)",
1393
+ "articlePath": "/",
1394
+ "scriptPath": "/"
1395
+ },
1396
+ {
1397
+ "name": "drawntolife.wiki",
1398
+ "regex": "((?:www\\.)?drawntolife\\.wiki)",
1399
+ "articlePath": "/en/",
1400
+ "scriptPath": "/w/"
1401
+ },
1189
1402
  {
1190
1403
  "name": "liquipedia.net",
1191
1404
  "regex": "((?:www\\.)?liquipedia\\.net/([a-z\\d]{1,50}))",