quria
Version:
A user-friendly Destiny 2 API Wrapper written with TypeScript and approved by -Axis Minds- Oryx.
46 lines (44 loc) • 2.59 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Trending = void 0;
const adapters_1 = require("../../adapters");
class Trending {
url;
headers;
constructor(url, headers) {
this.url = url;
this.headers = headers;
}
/**
* Returns trending items for Bungie.net, collapsed into the first page of items per category. For pagination within a category, call GetTrendingCategory.
* @returns Returns trending items for Bungie.net, collapsed into the first page of items per category. For pagination within a category, call GetTrendingCategory.
*/
GetTrendingCategories(tokens) {
const requestURL = `${this.url}/Trending/Categories/`;
const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens);
return adapters_1.Controller.request(requestURL, true, "GET", authHeaders);
}
/**
* Returns paginated lists of trending items for a category.
* @param categoryId The ID of the category for whom you want additional results.
* @param pageNumber The page # of results to return.
* @returns Returns paginated lists of trending items for a category.
*/
GetTrendingCategory(categoryId, pageNumber, tokens) {
const requestURL = `${this.url}/Trending/Categories/${categoryId}/${pageNumber}/`;
const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens);
return adapters_1.Controller.request(requestURL, true, "GET", authHeaders);
}
/**
* Returns the detailed results for a specific trending entry. Note that trending entries are uniquely identified by a combination of *both* the TrendingEntryType *and* the identifier: the identifier alone is not guaranteed to be globally unique.
* @param identifier The identifier for the entity to be returned.
* @param trendingEntryType The type of entity to be returned.
* @returns Returns the detailed results for a specific trending entry. Note that trending entries are uniquely identified by a combination of *both* the TrendingEntryType *and* the identifier: the identifier alone is not guaranteed to be globally unique.
*/
GetTrendingEntryDetail(identifier, trendingEntryType, tokens) {
const requestURL = `${this.url}/Trending/Details/${trendingEntryType}/${identifier}/`;
const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens);
return adapters_1.Controller.request(requestURL, true, "GET", authHeaders);
}
}
exports.Trending = Trending;