UNPKG

quria

Version:

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

84 lines (83 loc) 5.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Fireteam = void 0; const adapters_1 = require("../../adapters"); class Fireteam { url; headers; constructor(url, headers) { this.url = url; this.headers = headers; } /** * Gets a count of all active non-public fireteams for the specified clan. Maximum value returned is 25. * @param groupId The group id of the clan. * @returns Gets a count of all active non-public fireteams for the specified clan. Maximum value returned is 25. */ GetActivePrivateClanFireteamCount(groupId, tokens) { const requestURL = `${this.url}/Fireteam/Clan/${groupId}/ActiveCount/`; const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } /** * Gets a listing of all of this clan's fireteams that are have available slots. Caller is not checked for join criteria so caching is maximized. * @param activityType The activity type to filter by. * @param dateRange The date range to grab available fireteams. * @param excludeImmediate If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. * @param groupId The group id of the clan. * @param langFilter An optional language filter. * @param page Zero based page * @param platform The platform filter. * @param publicOnly Determines public/private filtering. * @param slotFilter Filters based on available slots * @returns Gets a listing of all of this clan's fireteams that are have available slots. Caller is not checked for join criteria so caching is maximized. */ GetAvailableClanFireteams(activityType, dateRange, groupId, page, platform, publicOnly, slotFilter, queryString, tokens) { const requestURL = (0, adapters_1.formatQueryStrings)(`${this.url}/Fireteam/Clan/${groupId}/Available/${platform}/${activityType}/${dateRange}/${slotFilter}/${publicOnly}/${page}/`, queryString); const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } /** * Gets a listing of all public fireteams starting now with open slots. Caller is not checked for join criteria so caching is maximized. * @param activityType The activity type to filter by. * @param dateRange The date range to grab available fireteams. * @param excludeImmediate If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. * @param langFilter An optional language filter. * @param page Zero based page * @param platform The platform filter. * @param slotFilter Filters based on available slots * @returns Gets a listing of all public fireteams starting now with open slots. Caller is not checked for join criteria so caching is maximized. */ SearchPublicAvailableClanFireteams(activityType, dateRange, page, platform, slotFilter, queryString, tokens) { const requestURL = (0, adapters_1.formatQueryStrings)(`${this.url}/Fireteam/Search/Available/${platform}/${activityType}/${dateRange}/${slotFilter}/${page}/`, queryString); const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } /** * Gets a listing of all fireteams that caller is an applicant, a member, or an alternate of. * @param groupFilter If true, filter by clan. Otherwise, ignore the clan and show all of the user's fireteams. * @param groupId The group id of the clan. (This parameter is ignored unless the optional query parameter groupFilter is true). * @param includeClosed If true, return fireteams that have been closed. * @param langFilter An optional language filter. * @param page Deprecated parameter, ignored. * @param platform The platform filter. * @returns Gets a listing of all fireteams that caller is an applicant, a member, or an alternate of. */ GetMyClanFireteams(groupId, includeClosed, page, platform, queryString, tokens) { const requestURL = (0, adapters_1.formatQueryStrings)(`${this.url}/Fireteam/Clan/${groupId}/My/${platform}/${includeClosed}/${page}/`, queryString); const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } /** * Gets a specific fireteam. * @param fireteamId The unique id of the fireteam. * @param groupId The group id of the clan. * @returns Gets a specific fireteam. */ GetClanFireteam(fireteamId, groupId, tokens) { const requestURL = `${this.url}/Fireteam/Clan/${groupId}/Summary/${fireteamId}/`; const authHeaders = (0, adapters_1.parseAuthenticationHeaders)(this.headers, tokens); return adapters_1.Controller.request(requestURL, true, "GET", authHeaders); } } exports.Fireteam = Fireteam;