Version 3.0 sortie, fusion avec JujulBot

This commit is contained in:
Angels-dev
2024-08-07 01:09:05 +02:00
parent 696b284b6c
commit 586f68b0df
51 changed files with 2472 additions and 1144 deletions

View File

@@ -20,7 +20,7 @@ export const Core = {
return { status: 'error', data: error }
})
},
async Init(host: string, version: Number, httpsAgent: https.Agent, app: App, trackId: String) {
async Init(host: string, version: number, httpsAgent: https.Agent, app: App, trackId: string) {
let request
if (trackId) request = axios.get(host + `/api/v${version}/login/authorize/` + trackId, { httpsAgent })
@@ -37,7 +37,7 @@ export const Core = {
}
export const Login = {
async Challenge(host: string, version: Number, httpsAgent: https.Agent) {
async Challenge(host: string, version: number, httpsAgent: https.Agent) {
let request = axios.get(host + `/api/v${version}/login/`, { httpsAgent })
return await request.then(response => {
@@ -49,7 +49,7 @@ export const Login = {
return { status: 'error', data: error }
})
},
async Session(host: string, version: Number, httpsAgent: https.Agent, app_id: string, password: string) {
async Session(host: string, version: number, httpsAgent: https.Agent, app_id: string, password: string) {
let request = axios.post(host + `/api/v${version}/login/session/`, { app_id, password }, { httpsAgent })
return await request.then(response => {
@@ -64,7 +64,7 @@ export const Login = {
}
export const Get = {
async Connection(host: string, version: Number, httpsAgent: https.Agent, sessionToken: string) {
async Connection(host: string, version: number, httpsAgent: https.Agent, sessionToken: string) {
let request = axios.get(host + `/api/v${version}/connection/`, { httpsAgent, headers: { 'X-Fbx-App-Auth': sessionToken } })
return await request.then(response => {