From 9751a21c9f10c8509552c6651acff4aca96abc6f Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sun, 14 Apr 2024 13:34:34 -0400 Subject: [PATCH] Make basic Lib --- Lib/.gitignore | 1 + Lib/README.md | 1 + Lib/build.mjs | 8 +++++++ Lib/bun.lockb | Bin 0 -> 13757 bytes Lib/dist/index.d.ts | 46 ++++++++++++++++++++++++++++++++++++++ Lib/dist/index.js | 1 + Lib/package.json | 40 +++++++++++++++++++++++++++++++++ Lib/src/index.d.ts | 1 + Lib/src/index.ts | 1 + Lib/src/lib/restfulmc.ts | 21 +++++++++++++++++ Lib/src/types/player.d.ts | 41 +++++++++++++++++++++++++++++++++ Lib/tsconfig.json | 16 +++++++++++++ 12 files changed, 177 insertions(+) create mode 100644 Lib/.gitignore create mode 100644 Lib/README.md create mode 100644 Lib/build.mjs create mode 100644 Lib/bun.lockb create mode 100644 Lib/dist/index.d.ts create mode 100644 Lib/dist/index.js create mode 100644 Lib/package.json create mode 100644 Lib/src/index.d.ts create mode 100644 Lib/src/index.ts create mode 100644 Lib/src/lib/restfulmc.ts create mode 100644 Lib/src/types/player.d.ts create mode 100644 Lib/tsconfig.json diff --git a/Lib/.gitignore b/Lib/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/Lib/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/Lib/README.md b/Lib/README.md new file mode 100644 index 0000000..90c0f16 --- /dev/null +++ b/Lib/README.md @@ -0,0 +1 @@ +# Lib \ No newline at end of file diff --git a/Lib/build.mjs b/Lib/build.mjs new file mode 100644 index 0000000..9f65438 --- /dev/null +++ b/Lib/build.mjs @@ -0,0 +1,8 @@ +import dts from "bun-plugin-dts"; + +await Bun.build({ + entrypoints: ["./src/index.ts"], + outdir: "./dist", + minify: true, + plugins: [dts()], +}); diff --git a/Lib/bun.lockb b/Lib/bun.lockb new file mode 100644 index 0000000000000000000000000000000000000000..a235c21caa22fe867274a90879b5741828281b45 GIT binary patch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%DrQmJa~r;IELm(bp#FwxzdS1ehiG^35C4cY5 zk_33SV7X(>5{AgafLAa5qLf;0TwujwP6oACt_C=|GNWtfg_*tt&9tG@&pi-Qaz{aoh9M5IWbz=0KDZl zi#lbYvD6?-WeFmFYi~WR70}RfFpqH*fhbrk5=&s#M!^w6)>>ES?XXMqJmo~HYx3eK zUL?OwE^O37gc)4r;oAg^lAm$p=bBb{J|0zo=VJz@y>**I`tfiBSllRZ)8tUw1LoS= z_*>d2&{TVh!;0Fb6!cNB8Yq6wYHgre+5p`wDa;f+e6}$uX(|APnpleCEQN&qO&Ba} Zvm^9oKts=hAK^Spy&LkQZ{}&%k)dBzj literal 0 HcmV?d00001 diff --git a/Lib/dist/index.d.ts b/Lib/dist/index.d.ts new file mode 100644 index 0000000..e2ecb49 --- /dev/null +++ b/Lib/dist/index.d.ts @@ -0,0 +1,46 @@ +// Generated by dts-bundle-generator v9.3.1 + +export type Player = { + /** + * The unique id of this player. + */ + uniqueId: string; + /** + * The username of this player. + */ + username: string; + /** + * The skin of this player. + */ + skin: Skin; +}; +/** + * A skin for a {@link Player}. + */ +export type Skin = { + /** + * The texture URL of this skin. + */ + url: string; + /** + * The model of this skin. + */ + model: Model; + /** + * Is this skin legacy? + */ + legacy: boolean; +}; +/** + * Possible models for a skin. + */ +export type Model = "default" | "slim"; +/** + * Get a player by their username or UUID. + * + * @param query the query to search for the player by + * @returns the promised player + */ +export declare const getPlayer: (query: string) => Promise; + +export {}; diff --git a/Lib/dist/index.js b/Lib/dist/index.js new file mode 100644 index 0000000..05d2ac6 --- /dev/null +++ b/Lib/dist/index.js @@ -0,0 +1 @@ +var d=(a)=>{return new Promise((p,b)=>{p({uniqueId:"fc1d5fe7-f29b-430d-80bb-3b093a638b0f",username:"Rainnny",skin:{url:"",model:"default",legacy:!1}})})};export{d as getPlayer}; diff --git a/Lib/package.json b/Lib/package.json new file mode 100644 index 0000000..958252f --- /dev/null +++ b/Lib/package.json @@ -0,0 +1,40 @@ +{ + "name": "restfulmc", + "version": "1.0.0", + "author": "Braydon (Rainnny) ", + "description": "A simple, yet useful RESTful API for Minecraft utilizing Springboot.", + "keywords": [ + "java", + "minecraft", + "json", + "rest-api", + "restful", + "bedrock", + "springboot" + ], + "homepage": "https://github.com/Rainnny7/RESTfulMC", + "repository": { + "type": "git", + "url": "git+https://github.com/Rainnny7/RESTfulMC.git" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "bun run build.mjs", + "prepublishOnly": "bun run build" + }, + "files": [ + "dist" + ], + "devDependencies": { + "@types/bun": "latest", + "bun-plugin-dts": "^0.2.2" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "dependencies": { + "axios": "^1.6.8" + } +} diff --git a/Lib/src/index.d.ts b/Lib/src/index.d.ts new file mode 100644 index 0000000..dd0d3c1 --- /dev/null +++ b/Lib/src/index.d.ts @@ -0,0 +1 @@ +export * from "./types/player"; diff --git a/Lib/src/index.ts b/Lib/src/index.ts new file mode 100644 index 0000000..d0ed23a --- /dev/null +++ b/Lib/src/index.ts @@ -0,0 +1 @@ +export * from "./lib/restfulmc"; diff --git a/Lib/src/lib/restfulmc.ts b/Lib/src/lib/restfulmc.ts new file mode 100644 index 0000000..0527ba6 --- /dev/null +++ b/Lib/src/lib/restfulmc.ts @@ -0,0 +1,21 @@ +import type { Player } from "../types/player"; + +/** + * Get a player by their username or UUID. + * + * @param query the query to search for the player by + * @returns the promised player + */ +export const getPlayer = (query: string): Promise => { + return new Promise((resolve, reject) => { + resolve({ + uniqueId: "fc1d5fe7-f29b-430d-80bb-3b093a638b0f", + username: "Rainnny", + skin: { + url: "", + model: "default", + legacy: false, + }, + }); + }); +}; diff --git a/Lib/src/types/player.d.ts b/Lib/src/types/player.d.ts new file mode 100644 index 0000000..87c4153 --- /dev/null +++ b/Lib/src/types/player.d.ts @@ -0,0 +1,41 @@ +export type Player = { + /** + * The unique id of this player. + */ + uniqueId: string; + + /** + * The username of this player. + */ + username: string; + + /** + * The skin of this player. + */ + skin: Skin; +} + +/** + * A skin for a {@link Player}. + */ +type Skin = { + /** + * The texture URL of this skin. + */ + url: string; + + /** + * The model of this skin. + */ + model: Model; + + /** + * Is this skin legacy? + */ + legacy: boolean; +} + +/** + * Possible models for a skin. + */ +type Model = "default" | "slim"; diff --git a/Lib/tsconfig.json b/Lib/tsconfig.json new file mode 100644 index 0000000..90f2f8f --- /dev/null +++ b/Lib/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "esnext", + "strict": true, + "esModuleInterop": true, + "moduleResolution": "node", + "skipLibCheck": true, + "noUnusedLocals": true, + "noImplicitAny": true, + "allowJs": true, + "noEmit": true, + "outDir": "dist", + "resolveJsonModule": true + } +}