bungie-net-core
Version:
An easy way to interact with the Bungie.net API
412 lines (411 loc) • 13.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.abdicateFoundership = abdicateFoundership;
exports.addOptionalConversation = addOptionalConversation;
exports.approveAllPending = approveAllPending;
exports.approvePending = approvePending;
exports.approvePendingForList = approvePendingForList;
exports.banMember = banMember;
exports.denyAllPending = denyAllPending;
exports.denyPendingForList = denyPendingForList;
exports.editClanBanner = editClanBanner;
exports.editFounderOptions = editFounderOptions;
exports.editGroup = editGroup;
exports.editGroupMembership = editGroupMembership;
exports.editOptionalConversation = editOptionalConversation;
exports.getAdminsAndFounderOfGroup = getAdminsAndFounderOfGroup;
exports.getAvailableAvatars = getAvailableAvatars;
exports.getAvailableThemes = getAvailableThemes;
exports.getBannedMembersOfGroup = getBannedMembersOfGroup;
exports.getGroup = getGroup;
exports.getGroupByName = getGroupByName;
exports.getGroupByNameV2 = getGroupByNameV2;
exports.getGroupEditHistory = getGroupEditHistory;
exports.getGroupOptionalConversations = getGroupOptionalConversations;
exports.getGroupsForMember = getGroupsForMember;
exports.getInvitedIndividuals = getInvitedIndividuals;
exports.getMembersOfGroup = getMembersOfGroup;
exports.getPendingMemberships = getPendingMemberships;
exports.getPotentialGroupsForMember = getPotentialGroupsForMember;
exports.getRecommendedGroups = getRecommendedGroups;
exports.getUserClanInviteSetting = getUserClanInviteSetting;
exports.groupSearch = groupSearch;
exports.individualGroupInvite = individualGroupInvite;
exports.individualGroupInviteCancel = individualGroupInviteCancel;
exports.kickMember = kickMember;
exports.recoverGroupForFounder = recoverGroupForFounder;
exports.unbanMember = unbanMember;
async function getAvailableAvatars(http) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/GetAvailableAvatars/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getAvailableThemes(http) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/GetAvailableThemes/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getUserClanInviteSetting(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/GetUserClanInviteSetting/${params.mType}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getRecommendedGroups(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/Recommended/${params.groupType}/${params.createDateRange}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}
async function groupSearch(http, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/Search/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function getGroup(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getGroupByName(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/Name/${params.groupName}/${params.groupType}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getGroupByNameV2(http, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/NameV2/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function getGroupOptionalConversations(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/OptionalConversations/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function editGroup(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Edit/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function editClanBanner(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/EditClanBanner/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function editFounderOptions(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/EditFounderOptions/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function addOptionalConversation(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/OptionalConversations/Add/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function editOptionalConversation(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/OptionalConversations/Edit/${params.conversationId}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function getMembersOfGroup(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
if (params.memberType !== undefined) searchParams.append('memberType', params.memberType.toString());
if (params.nameSearch !== undefined) searchParams.append('nameSearch', params.nameSearch.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getAdminsAndFounderOfGroup(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/AdminsAndFounder/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function editGroupMembership(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/${params.membershipType}/${params.membershipId}/SetMembershipType/${params.memberType}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}
async function kickMember(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/${params.membershipType}/${params.membershipId}/Kick/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}
async function banMember(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/${params.membershipType}/${params.membershipId}/Ban/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function unbanMember(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/${params.membershipType}/${params.membershipId}/Unban/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}
async function getBannedMembersOfGroup(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Banned/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getGroupEditHistory(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/EditHistory/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function abdicateFoundership(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Admin/AbdicateFoundership/${params.membershipType}/${params.founderIdNew}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}
async function getPendingMemberships(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/Pending/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getInvitedIndividuals(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/InvitedIndividuals/`;
const searchParams = new URLSearchParams();
if (params.currentpage !== undefined) searchParams.append('currentpage', params.currentpage.toString());
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function approveAllPending(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/ApproveAll/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function denyAllPending(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/DenyAll/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function approvePendingForList(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/ApproveList/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function approvePending(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/Approve/${params.membershipType}/${params.membershipId}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function denyPendingForList(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/DenyList/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function getGroupsForMember(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/User/${params.membershipType}/${params.membershipId}/${params.filter}/${params.groupType}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function recoverGroupForFounder(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/Recover/${params.membershipType}/${params.membershipId}/${params.groupType}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function getPotentialGroupsForMember(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/User/Potential/${params.membershipType}/${params.membershipId}/${params.filter}/${params.groupType}/`;
const searchParams = undefined;
return await http({
method: 'GET',
baseUrl,
searchParams,
body: undefined
});
}
async function individualGroupInvite(http, params, body) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/IndividualInvite/${params.membershipType}/${params.membershipId}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body,
contentType: 'application/json'
});
}
async function individualGroupInviteCancel(http, params) {
const baseUrl = `https://www.bungie.net/Platform/GroupV2/${params.groupId}/Members/IndividualInviteCancel/${params.membershipType}/${params.membershipId}/`;
const searchParams = undefined;
return await http({
method: 'POST',
baseUrl,
searchParams,
body: undefined
});
}