@wumx-labs/noxaeapi-sdk 0.5.0 → 0.5.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/dist/index.d.cts CHANGED
@@ -82,6 +82,19 @@ interface PlayerResolveResult {
82
82
  name: string;
83
83
  uuid: string;
84
84
  }
85
+ interface IdentityServerInfo {
86
+ id: string;
87
+ label: string;
88
+ }
89
+ /** Result of resolving player identity via `GET /v1/identity/{name}`. */
90
+ interface IdentityInfo {
91
+ username: string;
92
+ identityUuid: string;
93
+ localUuid: string | null;
94
+ server: IdentityServerInfo;
95
+ onlineMode: boolean;
96
+ hasPlayedBefore: boolean;
97
+ }
85
98
  interface ServerHealth {
86
99
  cpus: number;
87
100
  uptime: number;
@@ -828,6 +841,27 @@ declare class NoxAuthModule {
828
841
  checkPassword(name: string, password: string): Promise<PasswordCheckResult>;
829
842
  }
830
843
 
844
+ /**
845
+ * Wraps the /v1/identity/* routes.
846
+ *
847
+ * Resolves a username to its deterministic network-wide identityUuid and
848
+ * returns whether the player has ever joined this backend server (along with
849
+ * this server's localUuid).
850
+ */
851
+ declare class IdentityModule {
852
+ private readonly http;
853
+ constructor(http: HttpEngine);
854
+ /**
855
+ * Resolves a player's network-wide identity and local UUID status.
856
+ *
857
+ * Unlike players.resolve(name), this does NOT throw 404 if the player
858
+ * has never joined this server. Instead, identityUuid is always computed
859
+ * deterministically from the username, and hasPlayedBefore will be false
860
+ * with localUuid: null.
861
+ */
862
+ get(name: string): Promise<IdentityInfo>;
863
+ }
864
+
831
865
  /**
832
866
  * Wraps the `/v1/skills/*` routes (mcMMO / AuraSkills).
833
867
  */
@@ -1065,6 +1099,7 @@ declare class NoxAeApiSocket {
1065
1099
 
1066
1100
  declare class NoxAeApiClient {
1067
1101
  readonly players: PlayersModule;
1102
+ readonly identity: IdentityModule;
1068
1103
  readonly economy: EconomyModule;
1069
1104
  readonly server: ServerModule;
1070
1105
  readonly worlds: WorldsModule;
@@ -1188,4 +1223,4 @@ declare class NoxAeApiNetworkError extends Error {
1188
1223
  constructor(message: string, method: string, path: string, cause?: unknown);
1189
1224
  }
1190
1225
 
1191
- export { type AddPermissionOptions, type Advancement, type CurrencyBalance, type CurrencyTopEntry, type EconomyInfo, type GroupInfo, type InventoryItem, type LeaderboardEntry, type LeaderboardSourceInfo, type LuckPermsCheckPermissionResult, type LuckPermsContextOptions, type LuckPermsCreateGroupResult, type LuckPermsPrimaryGroupResult, type LuckPermsTrackActionResult, type MetaInfo, type NetworkBroadcastResponse, type NetworkFindPlayerResponse, type NetworkHealthResponse, type NetworkHealthServerEntry, type NetworkHubBroadcastResponse, type NetworkHubFindPlayerResponse, type NetworkHubNode, type NetworkHubPlayer, type NetworkHubPlayersResponse, type NetworkHubStatusResponse, type NetworkPlayersResponse, type NetworkPlayersServerEntry, type NetworkServerStatus, NoxAeApiClient, type NoxAeApiClientOptions, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError, type NoxAeApiWsEvent, type NoxAeApiWsOptions, type NoxAuthPlayerInfo, type Objective, type OfflinePlayer, type OnlinePlayer, type PasswordCheckResult, type PermissionNode, type PlayerBalance, type PlayerProfile, type PlayerProfileBan, type PlayerProfileEconomy, type PlayerProfileStatTile, type PlayerProfileStatus, type PlayerProfilesResponse, type PlayerResolveResult, type PlayerStats, type Plugin, type RetryOptions, type Score, type Scoreboard, type ServerBan, type ServerHealth, type ServerInfo, type SetGroupOptions, type SetMetaValueOptions, type SkillInfo, type TopBalanceEntry, type TrackInfo, type WhitelistEntry, type World };
1226
+ export { type AddPermissionOptions, type Advancement, type CurrencyBalance, type CurrencyTopEntry, type EconomyInfo, type GroupInfo, type IdentityInfo, IdentityModule, type IdentityServerInfo, type InventoryItem, type LeaderboardEntry, type LeaderboardSourceInfo, type LuckPermsCheckPermissionResult, type LuckPermsContextOptions, type LuckPermsCreateGroupResult, type LuckPermsPrimaryGroupResult, type LuckPermsTrackActionResult, type MetaInfo, type NetworkBroadcastResponse, type NetworkFindPlayerResponse, type NetworkHealthResponse, type NetworkHealthServerEntry, type NetworkHubBroadcastResponse, type NetworkHubFindPlayerResponse, type NetworkHubNode, type NetworkHubPlayer, type NetworkHubPlayersResponse, type NetworkHubStatusResponse, type NetworkPlayersResponse, type NetworkPlayersServerEntry, type NetworkServerStatus, NoxAeApiClient, type NoxAeApiClientOptions, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError, type NoxAeApiWsEvent, type NoxAeApiWsOptions, type NoxAuthPlayerInfo, type Objective, type OfflinePlayer, type OnlinePlayer, type PasswordCheckResult, type PermissionNode, type PlayerBalance, type PlayerProfile, type PlayerProfileBan, type PlayerProfileEconomy, type PlayerProfileStatTile, type PlayerProfileStatus, type PlayerProfilesResponse, type PlayerResolveResult, type PlayerStats, type Plugin, type RetryOptions, type Score, type Scoreboard, type ServerBan, type ServerHealth, type ServerInfo, type SetGroupOptions, type SetMetaValueOptions, type SkillInfo, type TopBalanceEntry, type TrackInfo, type WhitelistEntry, type World };
package/dist/index.d.ts CHANGED
@@ -82,6 +82,19 @@ interface PlayerResolveResult {
82
82
  name: string;
83
83
  uuid: string;
84
84
  }
85
+ interface IdentityServerInfo {
86
+ id: string;
87
+ label: string;
88
+ }
89
+ /** Result of resolving player identity via `GET /v1/identity/{name}`. */
90
+ interface IdentityInfo {
91
+ username: string;
92
+ identityUuid: string;
93
+ localUuid: string | null;
94
+ server: IdentityServerInfo;
95
+ onlineMode: boolean;
96
+ hasPlayedBefore: boolean;
97
+ }
85
98
  interface ServerHealth {
86
99
  cpus: number;
87
100
  uptime: number;
@@ -828,6 +841,27 @@ declare class NoxAuthModule {
828
841
  checkPassword(name: string, password: string): Promise<PasswordCheckResult>;
829
842
  }
830
843
 
844
+ /**
845
+ * Wraps the /v1/identity/* routes.
846
+ *
847
+ * Resolves a username to its deterministic network-wide identityUuid and
848
+ * returns whether the player has ever joined this backend server (along with
849
+ * this server's localUuid).
850
+ */
851
+ declare class IdentityModule {
852
+ private readonly http;
853
+ constructor(http: HttpEngine);
854
+ /**
855
+ * Resolves a player's network-wide identity and local UUID status.
856
+ *
857
+ * Unlike players.resolve(name), this does NOT throw 404 if the player
858
+ * has never joined this server. Instead, identityUuid is always computed
859
+ * deterministically from the username, and hasPlayedBefore will be false
860
+ * with localUuid: null.
861
+ */
862
+ get(name: string): Promise<IdentityInfo>;
863
+ }
864
+
831
865
  /**
832
866
  * Wraps the `/v1/skills/*` routes (mcMMO / AuraSkills).
833
867
  */
@@ -1065,6 +1099,7 @@ declare class NoxAeApiSocket {
1065
1099
 
1066
1100
  declare class NoxAeApiClient {
1067
1101
  readonly players: PlayersModule;
1102
+ readonly identity: IdentityModule;
1068
1103
  readonly economy: EconomyModule;
1069
1104
  readonly server: ServerModule;
1070
1105
  readonly worlds: WorldsModule;
@@ -1188,4 +1223,4 @@ declare class NoxAeApiNetworkError extends Error {
1188
1223
  constructor(message: string, method: string, path: string, cause?: unknown);
1189
1224
  }
1190
1225
 
1191
- export { type AddPermissionOptions, type Advancement, type CurrencyBalance, type CurrencyTopEntry, type EconomyInfo, type GroupInfo, type InventoryItem, type LeaderboardEntry, type LeaderboardSourceInfo, type LuckPermsCheckPermissionResult, type LuckPermsContextOptions, type LuckPermsCreateGroupResult, type LuckPermsPrimaryGroupResult, type LuckPermsTrackActionResult, type MetaInfo, type NetworkBroadcastResponse, type NetworkFindPlayerResponse, type NetworkHealthResponse, type NetworkHealthServerEntry, type NetworkHubBroadcastResponse, type NetworkHubFindPlayerResponse, type NetworkHubNode, type NetworkHubPlayer, type NetworkHubPlayersResponse, type NetworkHubStatusResponse, type NetworkPlayersResponse, type NetworkPlayersServerEntry, type NetworkServerStatus, NoxAeApiClient, type NoxAeApiClientOptions, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError, type NoxAeApiWsEvent, type NoxAeApiWsOptions, type NoxAuthPlayerInfo, type Objective, type OfflinePlayer, type OnlinePlayer, type PasswordCheckResult, type PermissionNode, type PlayerBalance, type PlayerProfile, type PlayerProfileBan, type PlayerProfileEconomy, type PlayerProfileStatTile, type PlayerProfileStatus, type PlayerProfilesResponse, type PlayerResolveResult, type PlayerStats, type Plugin, type RetryOptions, type Score, type Scoreboard, type ServerBan, type ServerHealth, type ServerInfo, type SetGroupOptions, type SetMetaValueOptions, type SkillInfo, type TopBalanceEntry, type TrackInfo, type WhitelistEntry, type World };
1226
+ export { type AddPermissionOptions, type Advancement, type CurrencyBalance, type CurrencyTopEntry, type EconomyInfo, type GroupInfo, type IdentityInfo, IdentityModule, type IdentityServerInfo, type InventoryItem, type LeaderboardEntry, type LeaderboardSourceInfo, type LuckPermsCheckPermissionResult, type LuckPermsContextOptions, type LuckPermsCreateGroupResult, type LuckPermsPrimaryGroupResult, type LuckPermsTrackActionResult, type MetaInfo, type NetworkBroadcastResponse, type NetworkFindPlayerResponse, type NetworkHealthResponse, type NetworkHealthServerEntry, type NetworkHubBroadcastResponse, type NetworkHubFindPlayerResponse, type NetworkHubNode, type NetworkHubPlayer, type NetworkHubPlayersResponse, type NetworkHubStatusResponse, type NetworkPlayersResponse, type NetworkPlayersServerEntry, type NetworkServerStatus, NoxAeApiClient, type NoxAeApiClientOptions, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError, type NoxAeApiWsEvent, type NoxAeApiWsOptions, type NoxAuthPlayerInfo, type Objective, type OfflinePlayer, type OnlinePlayer, type PasswordCheckResult, type PermissionNode, type PlayerBalance, type PlayerProfile, type PlayerProfileBan, type PlayerProfileEconomy, type PlayerProfileStatTile, type PlayerProfileStatus, type PlayerProfilesResponse, type PlayerResolveResult, type PlayerStats, type Plugin, type RetryOptions, type Score, type Scoreboard, type ServerBan, type ServerHealth, type ServerInfo, type SetGroupOptions, type SetMetaValueOptions, type SkillInfo, type TopBalanceEntry, type TrackInfo, type WhitelistEntry, type World };
package/dist/index.js CHANGED
@@ -918,6 +918,25 @@ var NoxAuthModule = class {
918
918
  }
919
919
  };
920
920
 
921
+ // src/modules/identity.ts
922
+ var IdentityModule = class {
923
+ constructor(http) {
924
+ this.http = http;
925
+ }
926
+ http;
927
+ /**
928
+ * Resolves a player's network-wide identity and local UUID status.
929
+ *
930
+ * Unlike players.resolve(name), this does NOT throw 404 if the player
931
+ * has never joined this server. Instead, identityUuid is always computed
932
+ * deterministically from the username, and hasPlayedBefore will be false
933
+ * with localUuid: null.
934
+ */
935
+ get(name) {
936
+ return this.http.request("GET", `identity/${encodeURIComponent(name)}`);
937
+ }
938
+ };
939
+
921
940
  // src/modules/skills.ts
922
941
  var SkillsModule = class {
923
942
  constructor(http) {
@@ -1194,6 +1213,7 @@ function safeParse(text) {
1194
1213
  // src/client.ts
1195
1214
  var NoxAeApiClient = class _NoxAeApiClient {
1196
1215
  players;
1216
+ identity;
1197
1217
  economy;
1198
1218
  server;
1199
1219
  worlds;
@@ -1228,6 +1248,7 @@ var NoxAeApiClient = class _NoxAeApiClient {
1228
1248
  this.baseUrl = options.baseUrl;
1229
1249
  this.apiKey = options.apiKey;
1230
1250
  this.players = new PlayersModule(this.http);
1251
+ this.identity = new IdentityModule(this.http);
1231
1252
  this.economy = new EconomyModule(this.http);
1232
1253
  this.server = new ServerModule(this.http);
1233
1254
  this.worlds = new WorldsModule(this.http);
@@ -1297,6 +1318,6 @@ var NoxAeApiNetworkHubClient = class _NoxAeApiNetworkHubClient {
1297
1318
  }
1298
1319
  };
1299
1320
 
1300
- export { NoxAeApiClient, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError };
1321
+ export { IdentityModule, NoxAeApiClient, NoxAeApiError, NoxAeApiForbiddenError, NoxAeApiNetworkError, NoxAeApiNetworkHubClient, NoxAeApiNotFoundError, NoxAeApiRateLimitError, NoxAeApiServerError, NoxAeApiSocket, NoxAeApiUnauthorizedError };
1301
1322
  //# sourceMappingURL=index.js.map
1302
1323
  //# sourceMappingURL=index.js.map