parent
0f8754732d
commit
d7378945b3
|
@ -8,11 +8,16 @@ import District from './modules/District'
|
||||||
import Stock from './modules/Stock'
|
import Stock from './modules/Stock'
|
||||||
import TransactionHub from './modules/TransactionHub'
|
import TransactionHub from './modules/TransactionHub'
|
||||||
|
|
||||||
|
import * as DepersonalizedUser from './modules/depersonalized/user'
|
||||||
|
import * as DepersonalizedGroup from './modules/depersonalized/group'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
User,
|
User,
|
||||||
Group,
|
Group,
|
||||||
Auth,
|
Auth,
|
||||||
District,
|
District,
|
||||||
Stock,
|
Stock,
|
||||||
TransactionHub
|
TransactionHub,
|
||||||
|
DepersonalizedUser,
|
||||||
|
DepersonalizedGroup
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,21 @@ class User {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
FIXME: This method is at the current moment deprecated. Please someone get on this.
|
||||||
|
|
||||||
|
public async totalXP (): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const userData = this.getUser()
|
||||||
|
resolve(userData.post_likes + userData.comment_likes + (userData.twitch_message_xp * 4) + (userData.discord_commends * 5) + (userData.discord_message_xp * 2) + (userData.discord_game_xp / 100))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public get apikey (): string {
|
public get apikey (): string {
|
||||||
return this.authkey
|
return this.authkey
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
|
||||||
|
|
||||||
|
// SpookVooper API - modules/depersonalized/group.ts
|
||||||
|
// Written by Brendan Lane - https://brndnln.dev/
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
const baseURL = 'https://api.spookvooper.com/group'
|
||||||
|
|
||||||
|
async function doesGroupExist (svid: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/doesGroupExist?svid=${svid}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getSvidFromName (name: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getSvidFromName?name=${name}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
getSvidFromName,
|
||||||
|
doesGroupExist
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
|
||||||
|
|
||||||
|
// SpookVooper API - modules/depersonalized/user.ts
|
||||||
|
// Written by Brendan Lane - https://brndnln.dev/
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
const baseURL = 'https://api.spookvooper.com/user'
|
||||||
|
|
||||||
|
async function getSvidFromUsername (username: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getSvidFromUsername?username=${username}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getUsernameFromDiscord (discordid: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getUsernameFromDiscord?discordid=${discordid}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getSvidFromDiscord (discordid: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getSvidFromDiscord?discordid=${discordid}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getUsernameFromMinecraft (minecraftid: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getUsernameFromMinecraft?minecraftid=${minecraftid}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getSvidFromMinecraft (minecraftid: string, errToConsole?: boolean): Promise<any> {
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
|
axios.get(`${baseURL}/getSvidFromMinecraft?minecraftid=${minecraftid}`)
|
||||||
|
.then(function (response) {
|
||||||
|
resolve(response.data)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
if (errToConsole) {
|
||||||
|
console.warn(error)
|
||||||
|
} else {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
getSvidFromUsername,
|
||||||
|
getSvidFromMinecraft,
|
||||||
|
getSvidFromDiscord,
|
||||||
|
getUsernameFromDiscord,
|
||||||
|
getUsernameFromMinecraft
|
||||||
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
import User from './modules/User'
|
import User from './modules/User'
|
||||||
import Group from './modules/Group'
|
import Group from './modules/Group'
|
||||||
import Auth from './modules/Auth'
|
import Auth from './modules/Auth'
|
||||||
export { User, Group, Auth }
|
import District from './modules/District'
|
||||||
|
import Stock from './modules/Stock'
|
||||||
|
import TransactionHub from './modules/TransactionHub'
|
||||||
|
import * as DepersonalizedUser from './modules/depersonalized/user'
|
||||||
|
import * as DepersonalizedGroup from './modules/depersonalized/group'
|
||||||
|
export { User, Group, Auth, District, Stock, TransactionHub, DepersonalizedUser, DepersonalizedGroup }
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
declare function doesGroupExist (svid: string, errToConsole?: boolean): Promise<any>
|
||||||
|
declare function getSvidFromName (name: string, errToConsole?: boolean): Promise<any>
|
||||||
|
export { getSvidFromName, doesGroupExist }
|
|
@ -0,0 +1,6 @@
|
||||||
|
declare function getSvidFromUsername (username: string, errToConsole?: boolean): Promise<any>
|
||||||
|
declare function getUsernameFromDiscord (discordid: string, errToConsole?: boolean): Promise<any>
|
||||||
|
declare function getSvidFromDiscord (discordid: string, errToConsole?: boolean): Promise<any>
|
||||||
|
declare function getUsernameFromMinecraft (minecraftid: string, errToConsole?: boolean): Promise<any>
|
||||||
|
declare function getSvidFromMinecraft (minecraftid: string, errToConsole?: boolean): Promise<any>
|
||||||
|
export { getSvidFromUsername, getSvidFromMinecraft, getSvidFromDiscord, getUsernameFromDiscord, getUsernameFromMinecraft }
|
Loading…
Reference in New Issue