@wumx-labs/noxaeapi-sdk 0.5.2 → 0.6.1

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/README.md CHANGED
@@ -114,16 +114,42 @@ Javalin handler uses before wiring it up, and pass `form: true` to
114
114
  case). Getting this wrong won't throw a type error — the request just
115
115
  silently sends the wrong content type and the server won't see the field.
116
116
 
117
- ## Optional modules
118
-
119
- Some modules only work depending on the target server's setup:
120
-
121
- - `client.luckperms.*` — requires the LuckPerms mod to be loaded on the server
122
- - `client.noxauth.*` — requires `noxauth.enabled: true` in the server's `noxaeapi-config.yml`
123
- - `client.economy.getCurrencyBalance()`/`.payCurrency()`/`.debitCurrency()`/`.setCurrencyBalance()`/`.getCurrencyTop()`/`.listCurrencies()` — requires ExcellentEconomy (throws a 424 error if it isn't installed)
124
- - `client.network.*` — requires `network.enabled: true` with at least one backend server configured in the server's config
125
-
126
- Calling these against a server without the corresponding feature enabled will fail (typically 404).
117
+ ## Optional modules & Integrations
118
+
119
+ Some modules and external integrations depend on plugins loaded on the target server:
120
+
121
+ - `client.luckperms.*` — requires LuckPerms
122
+ - `client.noxauth.*` — requires `noxauth.enabled: true`
123
+ - `client.economy.getCurrencyBalance()`/`.payCurrency()`/... — requires ExcellentEconomy
124
+ - `client.network.*` — requires `network.enabled: true` with backend nodes configured
125
+
126
+ ### Plugin Integrations Suite (`client.integrations.*` / top-level shortcuts)
127
+
128
+ NoxAeApi 1.5.0 supports deep integration with standard Spigot/Paper plugins:
129
+
130
+ - **Auth**:
131
+ - `client.authme` (`client.integrations.authme`) — AuthMe Reloaded player info & password validation
132
+ - `client.fastlogin` (`client.integrations.fastlogin`) — FastLogin premium / Mojang-verified status
133
+ - `client.nlogin` (`client.integrations.nlogin`) — nLogin player authentication & registration status
134
+ - `client.loginsecurity` (`client.integrations.loginsecurity`) — LoginSecurity auth status
135
+ - **Clans & Teams**:
136
+ - `client.betterteams` (`client.integrations.betterteams`) — Player teams, team details, and paginated team listings
137
+ - **Server Utility**:
138
+ - `client.essentials` (`client.integrations.essentials`) — Player homes, server warps, and player info (afk, muted, godmode)
139
+ - `client.discordsrv` (`client.integrations.discordsrv`) — Discord linked account lookups and channel broadcasts
140
+ - `client.plan` (`client.integrations.plan`) — Player Analytics (Plan) player session and activity summaries
141
+ - `client.geyser` (`client.integrations.geyser`) — Geyser / Floodgate Bedrock player detection, XUID, and OS
142
+ - `client.tab` (`client.integrations.tab`) — TAB prefix/suffix reading and custom nametag updates
143
+ - **Economy & Protection**:
144
+ - `client.playerpoints` (`client.integrations.playerpoints`) — PlayerPoints balance check, pay, take, and set
145
+ - `client.griefprevention` (`client.integrations.griefprevention`) — Player claims and coordinate claim inspections
146
+ - `client.worldguard` (`client.integrations.worldguard`) — Region boundaries, flags, and world listings
147
+ - `client.coreprotect` (`client.integrations.coreprotect`) — Block / action audit logs and rollback history lookup
148
+ - `client.shopgui` (`client.integrations.shopgui`) — ShopGUIPlus shop catalogs and item pricing details
149
+ - **Custom Content**:
150
+ - `client.mythicmobs` (`client.integrations.mythicmobs`) — Mob catalog listing and coordinate-based mob spawning
151
+
152
+ Calling integration endpoints when the corresponding backing plugin is not installed will safely return a 503 Service Unavailable error.
127
153
 
128
154
  ## NoxAeApi-Velocity network hub
129
155
 
package/dist/index.cjs CHANGED
@@ -1120,6 +1120,289 @@ var NetworkHubModule = class {
1120
1120
  }
1121
1121
  };
1122
1122
 
1123
+ // src/modules/integrations.ts
1124
+ var AuthMeModule = class {
1125
+ constructor(http) {
1126
+ this.http = http;
1127
+ }
1128
+ http;
1129
+ /** Gets AuthMe player auth details (registered, authenticated, lastIp, lastLoginTime). */
1130
+ getPlayerAuth(name) {
1131
+ return this.http.request("GET", `authme/player/${encodeURIComponent(name)}`);
1132
+ }
1133
+ /** Checks if the password matches the player's AuthMe password. */
1134
+ checkPassword(name, password) {
1135
+ return this.http.request(
1136
+ "POST",
1137
+ `authme/player/${encodeURIComponent(name)}/check-password`,
1138
+ { body: { password } }
1139
+ );
1140
+ }
1141
+ };
1142
+ var FastLoginModule = class {
1143
+ constructor(http) {
1144
+ this.http = http;
1145
+ }
1146
+ http;
1147
+ /** Checks if a player is running on a premium (Mojang-authenticated) account via FastLogin. */
1148
+ getPlayerInfo(name) {
1149
+ return this.http.request("GET", `fastlogin/player/${encodeURIComponent(name)}`);
1150
+ }
1151
+ };
1152
+ var NLoginModule = class {
1153
+ constructor(http) {
1154
+ this.http = http;
1155
+ }
1156
+ http;
1157
+ /** Gets nLogin authentication and registration status for a player. */
1158
+ getPlayerAuth(name) {
1159
+ return this.http.request("GET", `nlogin/player/${encodeURIComponent(name)}`);
1160
+ }
1161
+ };
1162
+ var LoginSecurityModule = class {
1163
+ constructor(http) {
1164
+ this.http = http;
1165
+ }
1166
+ http;
1167
+ /** Gets LoginSecurity authentication and registration status for a player. */
1168
+ getPlayerAuth(name) {
1169
+ return this.http.request("GET", `loginsecurity/player/${encodeURIComponent(name)}`);
1170
+ }
1171
+ };
1172
+ var BetterTeamsModule = class {
1173
+ constructor(http) {
1174
+ this.http = http;
1175
+ }
1176
+ http;
1177
+ /** Gets the team summary for a player by UUID or player name. */
1178
+ getPlayerTeam(uuidOrName) {
1179
+ return this.http.request("GET", `betterteams/player/${encodeURIComponent(uuidOrName)}`);
1180
+ }
1181
+ /** Gets full details of a team by team name, including member list. */
1182
+ getTeam(name) {
1183
+ return this.http.request("GET", `betterteams/team/${encodeURIComponent(name)}`);
1184
+ }
1185
+ /** Gets a paginated list of all teams. */
1186
+ getTeams(options = {}) {
1187
+ return this.http.request("GET", "betterteams/teams", {
1188
+ query: { page: options.page, limit: options.limit }
1189
+ });
1190
+ }
1191
+ };
1192
+ var EssentialsModule = class {
1193
+ constructor(http) {
1194
+ this.http = http;
1195
+ }
1196
+ http;
1197
+ /** Gets a player's home coordinates and list from Essentials. */
1198
+ getPlayerHomes(name) {
1199
+ return this.http.request("GET", `essentials/player/${encodeURIComponent(name)}/homes`);
1200
+ }
1201
+ /** Gets all configured server warps from Essentials. */
1202
+ getWarps() {
1203
+ return this.http.request("GET", "essentials/warps");
1204
+ }
1205
+ /** Gets player state info from Essentials (nickname, afk, muted, jailed, godMode). */
1206
+ getPlayerInfo(name) {
1207
+ return this.http.request("GET", `essentials/player/${encodeURIComponent(name)}/info`);
1208
+ }
1209
+ };
1210
+ var GriefPreventionModule = class {
1211
+ constructor(http) {
1212
+ this.http = http;
1213
+ }
1214
+ http;
1215
+ /** Gets all claims owned by a player by UUID. */
1216
+ getPlayerClaims(uuid) {
1217
+ return this.http.request("GET", `claims/player/${encodeURIComponent(uuid)}`);
1218
+ }
1219
+ /** Gets claim details at a specific coordinate location. */
1220
+ getClaimAt(world, x, z) {
1221
+ return this.http.request("GET", "claims", {
1222
+ query: { world, x, z }
1223
+ });
1224
+ }
1225
+ };
1226
+ var DiscordSRVModule = class {
1227
+ constructor(http) {
1228
+ this.http = http;
1229
+ }
1230
+ http;
1231
+ /** Gets Discord user ID linked to a Minecraft player UUID. */
1232
+ getLinked(uuid) {
1233
+ return this.http.request("GET", `discordsrv/linked/${encodeURIComponent(uuid)}`);
1234
+ }
1235
+ /** Broadcasts a message to a Discord channel configured in DiscordSRV. */
1236
+ broadcast(message, channel = "global") {
1237
+ return this.http.request("POST", "discordsrv/broadcast", {
1238
+ body: { message, channel }
1239
+ });
1240
+ }
1241
+ };
1242
+ var PlayerPointsModule = class {
1243
+ constructor(http) {
1244
+ this.http = http;
1245
+ }
1246
+ http;
1247
+ /** Gets points balance for a player UUID. */
1248
+ getBalance(uuid) {
1249
+ return this.http.request("GET", `playerpoints/${encodeURIComponent(uuid)}/balance`);
1250
+ }
1251
+ /** Gives points to a player UUID. */
1252
+ pay(uuid, amount) {
1253
+ return this.http.request("POST", `playerpoints/${encodeURIComponent(uuid)}/pay`, {
1254
+ body: { amount }
1255
+ });
1256
+ }
1257
+ /** Deducts points from a player UUID. */
1258
+ take(uuid, amount) {
1259
+ return this.http.request("POST", `playerpoints/${encodeURIComponent(uuid)}/take`, {
1260
+ body: { amount }
1261
+ });
1262
+ }
1263
+ /** Sets points balance for a player UUID to an exact amount. */
1264
+ set(uuid, amount) {
1265
+ return this.http.request("POST", `playerpoints/${encodeURIComponent(uuid)}/set`, {
1266
+ body: { amount }
1267
+ });
1268
+ }
1269
+ };
1270
+ var WorldGuardModule = class {
1271
+ constructor(http) {
1272
+ this.http = http;
1273
+ }
1274
+ http;
1275
+ /** Gets all WorldGuard regions across all loaded worlds. */
1276
+ getAllRegions() {
1277
+ return this.http.request("GET", "worldguard/regions");
1278
+ }
1279
+ /** Gets a specific WorldGuard region in a world. */
1280
+ getRegion(world, id) {
1281
+ return this.http.request(
1282
+ "GET",
1283
+ `worldguard/regions/${encodeURIComponent(world)}/${encodeURIComponent(id)}`
1284
+ );
1285
+ }
1286
+ };
1287
+ var PlanModule = class {
1288
+ constructor(http) {
1289
+ this.http = http;
1290
+ }
1291
+ http;
1292
+ /** Gets analytics summary for a player from Player Analytics (Plan). */
1293
+ getPlayerSummary(uuid) {
1294
+ return this.http.request("GET", `plan/player/${encodeURIComponent(uuid)}/summary`);
1295
+ }
1296
+ };
1297
+ var GeyserModule = class {
1298
+ constructor(http) {
1299
+ this.http = http;
1300
+ }
1301
+ http;
1302
+ /** Checks Bedrock status, XUID, and device info for a player via Geyser/Floodgate. */
1303
+ getPlayerInfo(uuid) {
1304
+ return this.http.request("GET", `geyser/player/${encodeURIComponent(uuid)}`);
1305
+ }
1306
+ };
1307
+ var MythicMobsModule = class {
1308
+ constructor(http) {
1309
+ this.http = http;
1310
+ }
1311
+ http;
1312
+ /** Gets all registered custom mob types from MythicMobs. */
1313
+ getMobs() {
1314
+ return this.http.request("GET", "mythicmobs/mobs");
1315
+ }
1316
+ /** Spawns a custom MythicMob at target location coordinates. */
1317
+ spawn(options) {
1318
+ return this.http.request("POST", "mythicmobs/spawn", {
1319
+ body: options
1320
+ });
1321
+ }
1322
+ };
1323
+ var TabModule = class {
1324
+ constructor(http) {
1325
+ this.http = http;
1326
+ }
1327
+ http;
1328
+ /** Gets custom nametag prefix/suffix for a player from TAB. */
1329
+ getNametag(uuid) {
1330
+ return this.http.request("GET", `tab/player/${encodeURIComponent(uuid)}/nametag`);
1331
+ }
1332
+ /** Sets custom nametag prefix/suffix for a player via TAB. */
1333
+ setNametag(uuid, options) {
1334
+ return this.http.request("POST", `tab/player/${encodeURIComponent(uuid)}/nametag`, {
1335
+ body: options
1336
+ });
1337
+ }
1338
+ };
1339
+ var CoreProtectModule = class {
1340
+ constructor(http) {
1341
+ this.http = http;
1342
+ }
1343
+ http;
1344
+ /** Performs block and action history lookup via CoreProtect. */
1345
+ lookup(options = {}) {
1346
+ return this.http.request("GET", "coreprotect/lookup", {
1347
+ query: {
1348
+ time: options.time,
1349
+ user: options.user,
1350
+ limit: options.limit
1351
+ }
1352
+ });
1353
+ }
1354
+ };
1355
+ var ShopGuiModule = class {
1356
+ constructor(http) {
1357
+ this.http = http;
1358
+ }
1359
+ http;
1360
+ /** Gets all configured shops from ShopGUIPlus. */
1361
+ getShops() {
1362
+ return this.http.request("GET", "shopgui/shops");
1363
+ }
1364
+ /** Gets details of a specific shop by shop ID from ShopGUIPlus. */
1365
+ getShop(id) {
1366
+ return this.http.request("GET", `shopgui/shop/${encodeURIComponent(id)}`);
1367
+ }
1368
+ };
1369
+ var IntegrationsModule = class {
1370
+ authme;
1371
+ fastlogin;
1372
+ nlogin;
1373
+ loginsecurity;
1374
+ betterteams;
1375
+ essentials;
1376
+ griefprevention;
1377
+ discordsrv;
1378
+ playerpoints;
1379
+ worldguard;
1380
+ plan;
1381
+ geyser;
1382
+ mythicmobs;
1383
+ tab;
1384
+ coreprotect;
1385
+ shopgui;
1386
+ constructor(http) {
1387
+ this.authme = new AuthMeModule(http);
1388
+ this.fastlogin = new FastLoginModule(http);
1389
+ this.nlogin = new NLoginModule(http);
1390
+ this.loginsecurity = new LoginSecurityModule(http);
1391
+ this.betterteams = new BetterTeamsModule(http);
1392
+ this.essentials = new EssentialsModule(http);
1393
+ this.griefprevention = new GriefPreventionModule(http);
1394
+ this.discordsrv = new DiscordSRVModule(http);
1395
+ this.playerpoints = new PlayerPointsModule(http);
1396
+ this.worldguard = new WorldGuardModule(http);
1397
+ this.plan = new PlanModule(http);
1398
+ this.geyser = new GeyserModule(http);
1399
+ this.mythicmobs = new MythicMobsModule(http);
1400
+ this.tab = new TabModule(http);
1401
+ this.coreprotect = new CoreProtectModule(http);
1402
+ this.shopgui = new ShopGuiModule(http);
1403
+ }
1404
+ };
1405
+
1123
1406
  // src/socket.ts
1124
1407
  function toWsUrl(baseUrl, route, apiKey) {
1125
1408
  const url = new URL(`${baseUrl.replace(/\/+$/, "")}/v1/ws/${route.replace(/^\/+/, "")}`);
@@ -1242,6 +1525,24 @@ var NoxAeApiClient = class _NoxAeApiClient {
1242
1525
  * and its response shapes differ.
1243
1526
  */
1244
1527
  network;
1528
+ /** Comprehensive external plugin integrations suite. */
1529
+ integrations;
1530
+ authme;
1531
+ fastlogin;
1532
+ nlogin;
1533
+ loginsecurity;
1534
+ betterteams;
1535
+ essentials;
1536
+ griefprevention;
1537
+ discordsrv;
1538
+ playerpoints;
1539
+ worldguard;
1540
+ plan;
1541
+ geyser;
1542
+ mythicmobs;
1543
+ tab;
1544
+ coreprotect;
1545
+ shopgui;
1245
1546
  http;
1246
1547
  baseUrl;
1247
1548
  apiKey;
@@ -1262,6 +1563,23 @@ var NoxAeApiClient = class _NoxAeApiClient {
1262
1563
  this.skills = new SkillsModule(this.http);
1263
1564
  this.leaderboards = new LeaderboardModule(this.http);
1264
1565
  this.network = new NetworkModule(this.http);
1566
+ this.integrations = new IntegrationsModule(this.http);
1567
+ this.authme = this.integrations.authme;
1568
+ this.fastlogin = this.integrations.fastlogin;
1569
+ this.nlogin = this.integrations.nlogin;
1570
+ this.loginsecurity = this.integrations.loginsecurity;
1571
+ this.betterteams = this.integrations.betterteams;
1572
+ this.essentials = this.integrations.essentials;
1573
+ this.griefprevention = this.integrations.griefprevention;
1574
+ this.discordsrv = this.integrations.discordsrv;
1575
+ this.playerpoints = this.integrations.playerpoints;
1576
+ this.worldguard = this.integrations.worldguard;
1577
+ this.plan = this.integrations.plan;
1578
+ this.geyser = this.integrations.geyser;
1579
+ this.mythicmobs = this.integrations.mythicmobs;
1580
+ this.tab = this.integrations.tab;
1581
+ this.coreprotect = this.integrations.coreprotect;
1582
+ this.shopgui = this.integrations.shopgui;
1265
1583
  }
1266
1584
  /**
1267
1585
  * Build a client from environment variables:
@@ -1320,7 +1638,19 @@ var NoxAeApiNetworkHubClient = class _NoxAeApiNetworkHubClient {
1320
1638
  }
1321
1639
  };
1322
1640
 
1641
+ exports.AuthMeModule = AuthMeModule;
1642
+ exports.BetterTeamsModule = BetterTeamsModule;
1643
+ exports.CoreProtectModule = CoreProtectModule;
1644
+ exports.DiscordSRVModule = DiscordSRVModule;
1645
+ exports.EssentialsModule = EssentialsModule;
1646
+ exports.FastLoginModule = FastLoginModule;
1647
+ exports.GeyserModule = GeyserModule;
1648
+ exports.GriefPreventionModule = GriefPreventionModule;
1323
1649
  exports.IdentityModule = IdentityModule;
1650
+ exports.IntegrationsModule = IntegrationsModule;
1651
+ exports.LoginSecurityModule = LoginSecurityModule;
1652
+ exports.MythicMobsModule = MythicMobsModule;
1653
+ exports.NLoginModule = NLoginModule;
1324
1654
  exports.NoxAeApiClient = NoxAeApiClient;
1325
1655
  exports.NoxAeApiError = NoxAeApiError;
1326
1656
  exports.NoxAeApiForbiddenError = NoxAeApiForbiddenError;
@@ -1331,5 +1661,10 @@ exports.NoxAeApiRateLimitError = NoxAeApiRateLimitError;
1331
1661
  exports.NoxAeApiServerError = NoxAeApiServerError;
1332
1662
  exports.NoxAeApiSocket = NoxAeApiSocket;
1333
1663
  exports.NoxAeApiUnauthorizedError = NoxAeApiUnauthorizedError;
1664
+ exports.PlanModule = PlanModule;
1665
+ exports.PlayerPointsModule = PlayerPointsModule;
1666
+ exports.ShopGuiModule = ShopGuiModule;
1667
+ exports.TabModule = TabModule;
1668
+ exports.WorldGuardModule = WorldGuardModule;
1334
1669
  //# sourceMappingURL=index.cjs.map
1335
1670
  //# sourceMappingURL=index.cjs.map