UNPKG

bungie-net-core

Version:

An easy way to interact with the Bungie.net API

105 lines (104 loc) 3.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAvailableThemes = getAvailableThemes; exports.getBungieNetUserById = getBungieNetUserById; exports.getCredentialTypesForTargetAccount = getCredentialTypesForTargetAccount; exports.getMembershipDataById = getMembershipDataById; exports.getMembershipDataForCurrentUser = getMembershipDataForCurrentUser; exports.getMembershipFromHardLinkedCredential = getMembershipFromHardLinkedCredential; exports.getSanitizedPlatformDisplayNames = getSanitizedPlatformDisplayNames; exports.searchByGlobalNamePost = searchByGlobalNamePost; exports.searchByGlobalNamePrefix = searchByGlobalNamePrefix; async function getBungieNetUserById(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/GetBungieNetUserById/${params.id}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getSanitizedPlatformDisplayNames(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/GetSanitizedPlatformDisplayNames/${params.membershipId}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getCredentialTypesForTargetAccount(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/GetCredentialTypesForTargetAccount/${params.membershipId}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getAvailableThemes(http) { const baseUrl = `https://www.bungie.net/Platform/User/GetAvailableThemes/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getMembershipDataById(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/GetMembershipsById/${params.membershipId}/${params.membershipType}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getMembershipDataForCurrentUser(http) { const baseUrl = `https://www.bungie.net/Platform/User/GetMembershipsForCurrentUser/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function getMembershipFromHardLinkedCredential(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/GetMembershipFromHardLinkedCredential/${params.crType}/${params.credential}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function searchByGlobalNamePrefix(http, params) { const baseUrl = `https://www.bungie.net/Platform/User/Search/Prefix/${params.displayNamePrefix}/${params.page}/`; const searchParams = undefined; return await http({ method: 'GET', baseUrl, searchParams, body: undefined }); } async function searchByGlobalNamePost(http, params, body) { const baseUrl = `https://www.bungie.net/Platform/User/Search/GlobalName/${params.page}/`; const searchParams = undefined; return await http({ method: 'POST', baseUrl, searchParams, body, contentType: 'application/json' }); }