UNPKG

quria

Version:

A user-friendly Destiny 2 API Wrapper written with TypeScript and approved by -Axis Minds- Oryx.

36 lines (34 loc) 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.App = void 0; const adapters_1 = require("../../adapters"); class App { url; headers; constructor(url, headers) { this.url = url; this.headers = headers; } /** * Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint. * @param applicationId ID of the application to get usage statistics. * @param end End time for query. Goes to now if not specified. * @param start Start time for query. Goes to 24 hours ago if not specified. * @returns Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint. */ GetApplicationApiUsage(applicationId, queryString, tokens) { const requestURL = (0, adapters_1.formatQueryStrings)(`${this.url}/App/ApiUsage/${applicationId}/`, queryString); const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } /** * Get list of applications created by Bungie. * @returns Get list of applications created by Bungie. */ GetBungieApplications(tokens) { const requestURL = `${this.url}/App/FirstParty/`; const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } } exports.App = App;