Cleanup
Some checks failed
Publish JS SDK / docker (push) Failing after 32s

This commit is contained in:
Braydon 2024-04-15 08:49:09 -04:00
parent 3e42ed414a
commit d1365ae261
11 changed files with 82 additions and 45 deletions

Binary file not shown.

@ -1,7 +1,6 @@
export * from "./types/dns";
export * from "./types/generic"; export * from "./types/generic";
export * from "./types/mojang"; export * from "./types/mojang";
export * from "./types/player"; export * from "./types/player";
export * from "./types/server";
export * from "./types/server/bedrock-server"; export * from "./types/server/bedrock-server";
export * from "./types/server/java-server"; export * from "./types/server/java-server";
export * from "./types/server/server";

@ -1 +1 @@
export * from "@/lib/restfulmc"; export * from "./lib/restfulmc";

@ -1,4 +1,4 @@
import { ErrorResponse } from "@/types/generic"; import { ErrorResponse } from "../types/generic";
const ENDPOINT = "https://mc.rainnny.club"; // The API endpoint to use const ENDPOINT = "https://mc.rainnny.club"; // The API endpoint to use

@ -1,7 +1,7 @@
/** /**
* An A record. * An A record.
*/ */
export interface ARecord extends DNSRecord { interface ARecord extends DNSRecord {
/** /**
* The address of this record, undefined if unresolved. * The address of this record, undefined if unresolved.
*/ */
@ -11,7 +11,7 @@ export interface ARecord extends DNSRecord {
/** /**
* An SRV record. * An SRV record.
*/ */
export interface SRVRecord extends DNSRecord { interface SRVRecord extends DNSRecord {
/** /**
* The priority of this record. * The priority of this record.
*/ */
@ -36,7 +36,7 @@ export interface SRVRecord extends DNSRecord {
/** /**
* A representation of a DNS record. * A representation of a DNS record.
*/ */
export type DNSRecord = { type DNSRecord = {
/** /**
* The type of this record. * The type of this record.
*/ */
@ -47,3 +47,11 @@ export type DNSRecord = {
*/ */
ttl: number; ttl: number;
}; };
/**
* Types of a DNS record.
*/
enum RecordType {
A,
SRV,
}

@ -3,5 +3,14 @@
* a service provided by Mojang. * a service provided by Mojang.
*/ */
export type MojangServerStatus = { export type MojangServerStatus = {
[key: string]: string; [endpoint: string]: Status;
}; };
/**
* The status of a service.
*/
enum Status {
ONLINE,
DEGRADED,
OFFLINE,
}

@ -57,7 +57,7 @@ export type Player = {
/** /**
* A skin for a {@link Player}. * A skin for a {@link Player}.
*/ */
export type Skin = { type Skin = {
/** /**
* The texture URL of this skin. * The texture URL of this skin.
*/ */
@ -76,24 +76,49 @@ export type Skin = {
/** /**
* URLs to the parts of this skin. * URLs to the parts of this skin.
* <p> * <p>
* The key is the part name, and * The key is the part, and the
* the value is the URL. * value is the URL to the part.
* </p> * </p>
*/ */
parts: { parts: {
[key: string]: string; [part in SkinPart]: string;
}; };
}; };
/** /**
* Possible models for a skin. * Possible models for a skin.
*/ */
export type SkinModel = "default" | "slim"; enum SkinModel {
DEFAULT,
SLIM,
}
/**
* A part of a skin texture.
*/
export enum SkinPart {
HEAD_OVERLAY_FACE,
HEAD_TOP,
HEAD,
FACE,
HEAD_LEFT,
HEAD_RIGHT,
HEAD_BOTTOM,
HEAD_BACK,
BODY_FRONT,
BODY,
LEFT_ARM_TOP,
RIGHT_ARM_TOP,
LEFT_ARM_FRONT,
RIGHT_ARM_FRONT,
LEFT_LEG_FRONT,
RIGHT_LEG_FRONT,
}
/** /**
* A cape for a {@link Player}. * A cape for a {@link Player}.
*/ */
export type Cape = { type Cape = {
/** /**
* The texture URL of this cape. * The texture URL of this cape.
*/ */
@ -103,7 +128,7 @@ export type Cape = {
/** /**
* A property of a Mojang profile. * A property of a Mojang profile.
*/ */
export type ProfileProperty = { type ProfileProperty = {
/** /**
* The name of this property. * The name of this property.
*/ */
@ -124,4 +149,7 @@ export type ProfileProperty = {
/** /**
* Profile actions that can * Profile actions that can
*/ */
export type ProfileAction = "FORCED_NAME_CHANGE" | "USING_BANNED_SKIN"; enum ProfileAction {
FORCED_NAME_CHANGE,
USING_BANNED_SKIN,
}

@ -1,4 +1,4 @@
import { MinecraftServer } from "@/types/server"; import { MinecraftServer } from "./server";
/** /**
* A cacheable {@link BedrockMinecraftServer}. * A cacheable {@link BedrockMinecraftServer}.
@ -39,12 +39,15 @@ export interface BedrockMinecraftServer extends MinecraftServer {
/** /**
* The edition of a Bedrock server. * The edition of a Bedrock server.
*/ */
export type Edition = "MCPE" | "MCEE"; enum Edition {
MCPE,
MCEE,
}
/** /**
* Version information for a server. * Version information for a server.
*/ */
export type BedrockVersion = { type BedrockVersion = {
/** /**
* The protocol version of the server. * The protocol version of the server.
*/ */
@ -59,7 +62,7 @@ export type BedrockVersion = {
/** /**
* The gamemode of a server. * The gamemode of a server.
*/ */
export type GameMode = { type GameMode = {
/** /**
* The name of this gamemode. * The name of this gamemode.
*/ */

@ -1,4 +1,4 @@
import { MinecraftServer } from "@/types/server"; import { MinecraftServer } from "./server";
/** /**
* A cacheable {@link JavaMinecraftServer}. * A cacheable {@link JavaMinecraftServer}.
@ -70,7 +70,7 @@ export interface JavaMinecraftServer extends MinecraftServer {
/** /**
* Version information for a server. * Version information for a server.
*/ */
export type JavaVersion = { type JavaVersion = {
/** /**
* The version name of the server. * The version name of the server.
*/ */
@ -100,7 +100,7 @@ export type JavaVersion = {
/** /**
* The favicon for a server. * The favicon for a server.
*/ */
export type Favicon = { type Favicon = {
/** /**
* The raw Base64 encoded favicon. * The raw Base64 encoded favicon.
*/ */
@ -118,7 +118,7 @@ export type Favicon = {
* This is for servers on 1.12 or below. * This is for servers on 1.12 or below.
* </p> * </p>
*/ */
export type ModInfo = { type ModInfo = {
/** /**
* The type of modded server this is. * The type of modded server this is.
*/ */
@ -133,7 +133,7 @@ export type ModInfo = {
/** /**
* A legacy Forge mod for a server. * A legacy Forge mod for a server.
*/ */
export type LegacyForgeMod = { type LegacyForgeMod = {
/** /**
* The name of this mod. * The name of this mod.
*/ */
@ -151,7 +151,7 @@ export type LegacyForgeMod = {
* This is for servers on 1.13 and above. * This is for servers on 1.13 and above.
* </p> * </p>
*/ */
export type ForgeData = { type ForgeData = {
/** /**
* The list of channels on this server, empty if none. * The list of channels on this server, empty if none.
*/ */
@ -180,7 +180,7 @@ export type ForgeData = {
/** /**
* A Forge channel for a server. * A Forge channel for a server.
*/ */
export type ForgeChannel = { type ForgeChannel = {
/** /**
* The name of this channel. * The name of this channel.
*/ */
@ -200,7 +200,7 @@ export type ForgeChannel = {
/** /**
* A modern Forge mod for a server. * A modern Forge mod for a server.
*/ */
export type ModernForgeMod = { type ModernForgeMod = {
/** /**
* The name of this mod. * The name of this mod.
*/ */

@ -36,7 +36,7 @@ export type MinecraftServer = {
/** /**
* Player count data for a server. * Player count data for a server.
*/ */
export type Players = { type Players = {
/** /**
* The online players on this server. * The online players on this server.
*/ */
@ -56,7 +56,7 @@ export type Players = {
/** /**
* A sample player. * A sample player.
*/ */
export type PlayerSample = { type PlayerSample = {
/** /**
* The ID of this player. * The ID of this player.
*/ */
@ -71,7 +71,7 @@ export type PlayerSample = {
/** /**
* The name of a sample player. * The name of a sample player.
*/ */
export type PlayerSampleName = { type PlayerSampleName = {
/** /**
* The raw name. * The raw name.
*/ */
@ -91,7 +91,7 @@ export type PlayerSampleName = {
/** /**
* The MOTD for a server. * The MOTD for a server.
*/ */
export type MOTD = { type MOTD = {
/** /**
* The raw MOTD lines. * The raw MOTD lines.
*/ */
@ -116,15 +116,10 @@ export enum Platform {
/** /**
* The Java edition of Minecraft. * The Java edition of Minecraft.
*/ */
Java, JAVA = "java",
/** /**
* The Bedrock edition of Minecraft. * The Bedrock edition of Minecraft.
*/ */
Bedrock, BEDROCK = "bedrock",
} }
/**
* Types of a DNS record.
*/
export type RecordType = "A" | "SRV";

@ -11,11 +11,6 @@
"allowJs": true, "allowJs": true,
"noEmit": true, "noEmit": true,
"outDir": "dist", "outDir": "dist",
"resolveJsonModule": true, "resolveJsonModule": true
"paths": {
"@/*": ["./*"],
"@/lib/*": ["./src/lib/*"],
"@/types/*": ["./src/types/*"]
}
} }
} }