UNPKG

@ariusii/intersect.ts

Version:

The Intersect Engine API Client Library based on TS.

61 lines 2 kB
/** * This is the Logs Class, it contains all the methods to handle the logs. * Those actions do not require any Query Role. * @class Logs * @link https://docs.freemmorpgmaker.com/en-US/api/v1/endpoints/logs.html * @author AriusII */ export class Logs { _url; _token; constructor(_url, _token) { this._url = _url; this._token = _token; } /** * Retrieve player activity * @param player - The player ID you want to retrieve the activity for. * @returns - The response from the server. */ async playerActivity(player) { const res = await fetch(`${this._url}/api/v1/logs/player/${player}/activity`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${this._token}` } }); return await res.json(); } /** * Retrieve user activity * @param user - The user ID you want to retrieve the activity for. * @returns - The response from the server. */ async userActivity(user) { const res = await fetch(`${this._url}/api/v1/logs/user/${user}/activity`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${this._token}` } }); return await res.json(); } /** * Retrieve user activity by ip * @param user - The user ID you want to retrieve the activity for. * @returns - The response from the server. */ async userActivityByIP(user) { const res = await fetch(`${this._url}/api/v1/logs/user/${user}/ip`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${this._token}` } }); return await res.json(); } } //# sourceMappingURL=logs.js.map