@sodiumlabs/plume-api
Version:
The official Plume API wrapper
429 lines (423 loc) • 12.9 kB
TypeScript
interface PlumeAPIRESTOptions {
userAgent?: string;
}
declare class PlumeAPIREST {
readonly options: PlumeAPIRESTOptions;
static readonly baseURL = "https://plume.sodiumlabs.xyz/api";
static readonly defaultUserAgent: string;
constructor(options?: PlumeAPIRESTOptions);
request(method: string, path: string, body?: object): Promise<Response>;
get<T = unknown>(path: string): Promise<T>;
file(path: string): Promise<Buffer>;
}
type ExecLanguage = "javascript" | "typescript" | "python" | "cpp" | "go" | "rust" | "java" | "shell" | "php" | "ruby" | "lua" | "elixir" | "zig" | "postgres" | "mysql" | "sqlite";
type InteractionType = "bite" | "blush" | "cry" | "hug" | "kiss" | "lick" | "pat" | "poke" | "slap" | "smile" | "tickle";
type AsciiFont = "standard" | "isometric" | "3d" | "letters";
type DecodeType = "base64" | "binary" | "hex" | "morse" | "unicode";
interface DecodeData {
decoded: string;
}
type EncodeType = "base64" | "binary" | "hex" | "morse" | "unicode";
interface EncodeData {
encoded: string;
}
interface HeightBallData {
answer: string;
}
interface EmojiMixData {
emoji_url: string;
}
interface FunFactData {
text: string;
source_url: string;
language: string;
}
interface JokeData {
question: string;
answer: string;
}
interface MathData {
result: string | null;
}
interface MemeData {
title: string;
downvotes: number;
upvotes: number;
url: string;
image_url: string;
comments: number;
author: string;
}
interface NasaAPOD {
date: string;
title: string;
url: string;
hd_url?: string;
media_type: string;
explanation: string;
page_url: string;
}
interface NPMData {
name: string;
description: string;
version: string;
keywords: string[];
author_username: string;
author_email: string;
repository_url?: string;
npm_url: string;
dependents: number;
search_score: number;
downloads_monthly: number;
downloads_weekly: number;
last_published_date: string;
last_published: number;
}
interface QuoteData {
quote: string;
author: string;
}
interface RandomEmojiMixData {
emoji_url: string;
}
interface UpsideDownTextData {
text: string;
}
interface UrbanData {
word: string;
url: string;
definition: string;
example: string;
author: string;
thumbs_up: number;
thumbs_down: number;
}
interface GitHubRepository {
name: string;
full_name: string;
description: string;
url: string;
owner_username: string;
owner_avatar_url: string;
language?: string;
license_name?: string;
disabled?: boolean;
archived?: boolean;
fork?: boolean;
created_at_date?: string;
created_at?: number;
updated_at_date?: string;
updated_at?: number;
stargazers_count?: number;
forks_count?: number;
open_issues_count?: number;
}
interface GitHubUser {
id: number;
username: string;
avatar_url: string;
page_url: string;
followers_page_url: string;
following_page_url: string;
stars_page_url: string;
repos_page_url: string;
is_admin: boolean;
}
interface CryptoData {
name: string;
currency: string;
price: number;
market_cap: number;
volume_24h: number;
change_24h: number;
}
interface DefinitionData {
word: string;
phonetic?: string;
definitions: {
part_of_speech: string;
definitions: {
definition: string;
example?: string;
}[];
synonyms: string[];
antonyms: string[];
}[];
}
interface ExecData {
success: boolean;
timeout: boolean;
duration: number;
stdout: string | null;
stderr: string | null;
}
interface FreeGamesData {
games: {
store: string;
id: string;
title: string;
description: string;
image?: string;
original_price: number;
currency: string;
free_until: number;
}[];
}
interface IPInfoData {
ip: string;
city: string;
region: string;
country: string;
latitude: number;
longitude: number;
postal: string;
timezone: string;
}
interface ISSData {
latitude: number;
longitude: number;
altitude: number;
timestamp: number;
velocity: number;
}
interface ReverseTextData {
text: string;
}
interface TranslateData {
text: string;
}
interface WeatherData {
city_name: string;
full_city_name: string;
latitude: number;
longitude: number;
temperature: number;
humidity: number;
wind_speed: number;
hourly: {
time: number[];
temperature_2m: number[];
relative_humidity_2m: number[];
wind_speed_10m: number[];
};
}
interface WikipediaData {
title: string;
page_id: number;
thumbnail: {
source: string;
width: number;
height: number;
};
original_image: {
source: string;
width: number;
height: number;
};
lang: string;
description: string;
content_urls: {
desktop: {
page: string;
revisions: string;
edit: string;
talk: string;
};
mobile: {
page: string;
revisions: string;
edit: string;
talk: string;
};
};
extract: string;
}
interface InteractionData {
url: string;
}
interface AdviceData {
advice: string;
}
interface AgifyData {
age: number;
name: string;
count: number;
}
interface AsciiData {
text: string;
}
interface EmojifyData {
text: string;
}
interface UUIDData {
uuid: string;
}
interface FortniteMapData {
images: {
map: string;
map_with_pois: string;
};
pois: {
id: string;
name: string;
location: {
x: number;
y: number;
z: number;
};
}[];
}
interface MinecraftIDData {
id: string;
name: string;
}
interface MinecraftNameData {
id: string;
name: string;
}
interface MinecraftSkinData {
id: string;
name: string;
skin_url: string;
cape_url: string;
avatar_url: string;
body_url: string;
}
type Locale = "en" | "fr";
interface ColorData {
rgb: {
r: number;
g: number;
b: number;
value: string;
};
hsl: {
h: number;
s: number;
l: number;
value: string;
};
hsv: {
h: number;
s: number;
v: number;
value: string;
};
cmyk: {
c: number;
m: number;
y: number;
k: number;
value: string;
};
name: string;
hex: {
value: string;
clean: string;
};
url: string;
}
interface PlumeAPIOptions extends PlumeAPIRESTOptions {
}
/**
* The client to interact with Plume API
*/
declare class PlumeAPI {
readonly rest: PlumeAPIREST;
constructor(options?: PlumeAPIOptions);
eightBall(locale?: Locale): Promise<HeightBallData>;
advice(locale?: Locale): Promise<AdviceData>;
agify(name: string): Promise<AgifyData>;
asciiImage(text: string, font?: AsciiFont): Promise<Buffer>;
asciiText(text: string): Promise<AsciiData>;
/**
* @deprecated Use `eightBall` instead
*/
heightBall(locale?: Locale): Promise<HeightBallData>;
emojiMix(left: string, right: string): Promise<EmojiMixData>;
emojify(text: string): Promise<EmojifyData>;
funFact(locale?: Locale): Promise<FunFactData>;
issImage(circle?: boolean): Promise<Buffer>;
iss(): Promise<ISSData>;
joke(locale?: Locale): Promise<JokeData>;
math(expr: string): Promise<MathData>;
meme(): Promise<MemeData>;
nasaAPOD(): Promise<NasaAPOD>;
npm(name: string): Promise<NPMData>;
quote(locale?: Locale): Promise<QuoteData>;
randomEmojiMix(): Promise<RandomEmojiMixData>;
upsideDown(text: string): Promise<UpsideDownTextData>;
urban(word: string): Promise<UrbanData>;
color(hex: string): Promise<ColorData>;
colorImage(hex: string): Promise<Buffer>;
randomColor(): Promise<ColorData>;
githubRepository(name: string): Promise<GitHubRepository>;
githubUser(name: string): Promise<GitHubUser>;
captcha(): Promise<{
code: string;
image: Buffer;
}>;
crypto(name: string, currency: "usd" | "eur"): Promise<CryptoData>;
definition(locale: Locale, word: string): Promise<DefinitionData>;
exec(language: ExecLanguage, code: string): Promise<ExecData>;
freeGames(locale?: Locale): Promise<FreeGamesData>;
ipInfo(ip: string): Promise<IPInfoData>;
latex(expr: string): Promise<Buffer>;
qrcode(text: string): Promise<Buffer>;
reverseText(text: string): Promise<ReverseTextData>;
screenshot(url: string): Promise<Buffer>;
translate(text: string, to: string): Promise<TranslateData>;
uuid(): Promise<UUIDData>;
weather(city: string): Promise<WeatherData>;
wikipedia(page: string, locale?: Locale): Promise<WikipediaData>;
duck(): Promise<Buffer>;
fox(): Promise<Buffer>;
encode(type: EncodeType, text: string): Promise<EncodeData>;
decode(type: DecodeType, text: string): Promise<DecodeData>;
fortniteMapImagePois(locale?: Locale): Promise<Buffer>;
fortniteMapImage(): Promise<Buffer>;
fortniteMap(locale?: Locale): Promise<FortniteMapData>;
minecraftAvatar(name: string): Promise<Buffer>;
minecraftBody(name: string): Promise<Buffer>;
minecraftID(name: string): Promise<MinecraftIDData>;
minecraftName(id: string): Promise<MinecraftNameData>;
minecraftSkin(name: string): Promise<MinecraftSkinData>;
interaction(type: InteractionType): Promise<InteractionData>;
achievement(text: string): Promise<Buffer>;
alert(text: string): Promise<Buffer>;
caution(text: string): Promise<Buffer>;
challenge(text: string): Promise<Buffer>;
jail(avatar: string): Promise<Buffer>;
nokia(url: string): Promise<Buffer>;
tweet(avatar: string, name: string, username: string, text: string, retweets?: number, quote_tweets?: number, likes?: number): Promise<Buffer>;
wanted(avatar: string): Promise<Buffer>;
blur(url: string): Promise<Buffer>;
colorify(url: string, color: string): Promise<Buffer>;
grayscale(url: string): Promise<Buffer>;
invert(url: string): Promise<Buffer>;
rotate(url: string, deg: number): Promise<Buffer>;
changeMyMind(text: string): Promise<Buffer>;
didYouMean(search: string, correction: string): Promise<Buffer>;
drake(top: string, bottom: string): Promise<Buffer>;
duolingo(text: string): Promise<Buffer>;
facts(text: string): Promise<Buffer>;
fuze3(text: string): Promise<Buffer>;
hugo(text: string): Promise<Buffer>;
nothing(text: string): Promise<Buffer>;
oogway(text: string): Promise<Buffer>;
pepeHug(avatar: string): Promise<Buffer>;
sadcat(top: string, bottom: string): Promise<Buffer>;
stonks(avatar: string, stonks?: boolean): Promise<Buffer>;
tableFlip(avatar: string): Promise<Buffer>;
water(text: string): Promise<Buffer>;
woosh(avatar: string): Promise<Buffer>;
boost(avatar: string, username: string, text?: string): Promise<Buffer>;
couple(avatar1: string, avatar2: string, percentage?: number, primary_color?: string): Promise<Buffer>;
rank(avatar: string, global_name: string, username: string, level: number, xp: number, max_xp: number, rank?: number, bg_url?: string, bg_color?: string, blur?: boolean, color?: string): Promise<Buffer>;
welcome(avatar: string, text1: string, text2?: string, text3?: string, bg_url?: string, bg_color?: string, font_color?: string, blur?: boolean, avatar_border?: boolean, avatar_border_color?: string): Promise<Buffer>;
}
declare class PlumeAPIError extends Error {
res?: (Response | null) | undefined;
constructor(message: string, options?: ErrorOptions | undefined, res?: (Response | null) | undefined);
}
export { type AdviceData, type AgifyData, type AsciiData, type AsciiFont, type ColorData, type CryptoData, type DecodeData, type DecodeType, type DefinitionData, type EmojiMixData, type EmojifyData, type EncodeData, type EncodeType, type ExecData, type ExecLanguage, type FortniteMapData, type FreeGamesData, type FunFactData, type GitHubRepository, type GitHubUser, type HeightBallData, type IPInfoData, type ISSData, type InteractionData, type InteractionType, type JokeData, type Locale, type MathData, type MemeData, type MinecraftIDData, type MinecraftNameData, type MinecraftSkinData, type NPMData, type NasaAPOD, PlumeAPI, PlumeAPIError, type PlumeAPIOptions, PlumeAPIREST, type PlumeAPIRESTOptions, type QuoteData, type RandomEmojiMixData, type ReverseTextData, type TranslateData, type UUIDData, type UpsideDownTextData, type UrbanData, type WeatherData, type WikipediaData };