dolorealiquam
Version:
TypeScript mappings for the Bungie.net API
415 lines (414 loc) • 16.5 kB
JavaScript
"use strict";
/**
* Bungie.Net API
* These endpoints constitute the functionality exposed by Bungie.net, both for more traditional website functionality and for connectivity to Bungie video games and their related functionality.
*
* OpenAPI spec version: 2.1.5
* Contact: support@bungie.com
*
* NOTE: This class is auto generated by the bungie-api-ts code generator program.
* https://github.com/DestinyItemManager/bugie-api-ts
* Do not edit these files manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
/** Returns the current version of the manifest as a json object. */
function getDestinyManifest(http) {
return http({
method: 'GET',
url: 'https://www.bungie.net/Platform/Destiny2/Manifest/'
});
}
exports.getDestinyManifest = getDestinyManifest;
/**
* Returns the static definition of an entity of the given Type and hash identifier.
* Examine the API Documentation for the Type Names of entities that have their
* own definitions. Note that the return type will always *inherit from*
* DestinyDefinition, but the specific type returned will be the requested entity
* type if it can be found. Please don't use this as a chatty alternative to the
* Manifest database if you require large sets of data, but for simple and one-off
* accesses this should be handy.
*/
function getDestinyEntityDefinition(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Manifest/" + params.entityType + "/" + params.hashIdentifier + "/"
});
}
exports.getDestinyEntityDefinition = getDestinyEntityDefinition;
/** Returns a list of Destiny memberships given a full Gamertag or PSN ID. */
function searchDestinyPlayer(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/" + params.membershipType + "/" + params.displayName + "/"
});
}
exports.searchDestinyPlayer = searchDestinyPlayer;
/** Returns Destiny Profile information for the supplied membership. */
function getProfile(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Profile/" + params.destinyMembershipId + "/",
params: {
components: params.components ? params.components.join(',') : undefined
}
});
}
exports.getProfile = getProfile;
/** Returns character information for the supplied character. */
function getCharacter(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Profile/" + params.destinyMembershipId + "/Character/" + params.characterId + "/",
params: {
components: params.components ? params.components.join(',') : undefined
}
});
}
exports.getCharacter = getCharacter;
/**
* Returns information on the weekly clan rewards and if the clan has earned them
* or not. Note that this will always report rewards as not redeemed.
*/
function getClanWeeklyRewardState(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Clan/" + params.groupId + "/WeeklyRewardState/"
});
}
exports.getClanWeeklyRewardState = getClanWeeklyRewardState;
/**
* Retrieve the details of an instanced Destiny Item. An instanced Destiny item is
* one with an ItemInstanceId. Non-instanced items, such as materials, have no
* useful instance-specific details and thus are not queryable here.
*/
function getItem(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Profile/" + params.destinyMembershipId + "/Item/" + params.itemInstanceId + "/",
params: {
components: params.components ? params.components.join(',') : undefined
}
});
}
exports.getItem = getItem;
/**
* Get currently available vendors from the list of vendors that can possibly have
* rotating inventory. Note that this does not include things like preview vendors
* and vendors-as-kiosks, neither of whom have rotating/dynamic inventories. Use
* their definitions as-is for those.
*/
function getVendors(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Profile/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Vendors/",
params: {
components: params.components ? params.components.join(',') : undefined
}
});
}
exports.getVendors = getVendors;
/** Get the details of a specific Vendor. */
function getVendor(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Profile/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Vendors/" + params.vendorHash + "/",
params: {
components: params.components ? params.components.join(',') : undefined
}
});
}
exports.getVendor = getVendor;
/**
* Transfer an item to/from your vault. You must have a valid Destiny account. You
* must also pass BOTH a reference AND an instance ID if it's an instanced item.
* itshappening.gif
*/
function transferItem(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/TransferItem/',
body: body
});
}
exports.transferItem = transferItem;
/**
* Extract an item from the Postmaster, with whatever implications that may entail.
* You must have a valid Destiny account. You must also pass BOTH a reference AND
* an instance ID if it's an instanced item.
*/
function pullFromPostmaster(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/PullFromPostmaster/',
body: body
});
}
exports.pullFromPostmaster = pullFromPostmaster;
/**
* Equip an item. You must have a valid Destiny Account, and either be in a social
* space, in orbit, or offline.
*/
function equipItem(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/EquipItem/',
body: body
});
}
exports.equipItem = equipItem;
/**
* Equip a list of items by itemInstanceIds. You must have a valid Destiny Account,
* and either be in a social space, in orbit, or offline. Any items not found on
* your character will be ignored.
*/
function equipItems(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/EquipItems/',
body: body
});
}
exports.equipItems = equipItems;
/** Set the Lock State for an instanced item. You must have a valid Destiny Account. */
function setItemLockState(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/SetLockState/',
body: body
});
}
exports.setItemLockState = setItemLockState;
/**
* Insert a plug into a socketed item. I know how it sounds, but I assure you it's
* much more G-rated than you might be guessing. We haven't decided yet whether
* this will be able to insert plugs that have side effects, but if we do it will
* require special scope permission for an application attempting to do so. You
* must have a valid Destiny Account, and either be in a social space, in orbit, or
* offline. Request must include proof of permission for 'InsertPlugs' from the
* account owner.
*/
function insertSocketPlug(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Actions/Items/InsertSocketPlug/',
body: body
});
}
exports.insertSocketPlug = insertSocketPlug;
/** Gets the available post game carnage report for the activity ID. */
function getPostGameCarnageReport(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/" + params.activityId + "/"
});
}
exports.getPostGameCarnageReport = getPostGameCarnageReport;
/**
* Report a player that you met in an activity that was engaging in ToS-violating
* activities. Both you and the offending player must have played in the activityId
* passed in. Please use this judiciously and only when you have strong suspicions
* of violation, pretty please.
*/
function reportOffensivePostGameCarnageReportPlayer(http, params, body) {
return http({
method: 'POST',
url: "https://www.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/" + params.activityId + "/Report/",
body: body
});
}
exports.reportOffensivePostGameCarnageReportPlayer = reportOffensivePostGameCarnageReportPlayer;
/** Gets historical stats definitions. */
function getHistoricalStatsDefinition(http) {
return http({
method: 'GET',
url: 'https://www.bungie.net/Platform/Destiny2/Stats/Definition/'
});
}
exports.getHistoricalStatsDefinition = getHistoricalStatsDefinition;
/**
* Gets leaderboards with the signed in user's friends and the supplied
* destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and
* may experience rough edges. The schema is in final form, but there may be bugs
* that prevent desirable operation.
*/
function getClanLeaderboards(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Stats/Leaderboards/Clans/" + params.groupId + "/",
params: {
maxtop: params.maxtop,
modes: params.modes,
statid: params.statid
}
});
}
exports.getClanLeaderboards = getClanLeaderboards;
/**
* Gets aggregated stats for a clan using the same categories as the clan
* leaderboards. PREVIEW: This endpoint is still in beta, and may experience rough
* edges. The schema is in final form, but there may be bugs that prevent desirable
* operation.
*/
function getClanAggregateStats(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Stats/AggregateClanStats/" + params.groupId + "/",
params: {
modes: params.modes
}
});
}
exports.getClanAggregateStats = getClanAggregateStats;
/**
* Gets leaderboards with the signed in user's friends and the supplied
* destinyMembershipId as the focus. PREVIEW: This endpoint has not yet been
* implemented. It is being returned for a preview of future functionality, and for
* public comment/suggestion/preparation.
*/
function getLeaderboards(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Stats/Leaderboards/",
params: {
maxtop: params.maxtop,
modes: params.modes,
statid: params.statid
}
});
}
exports.getLeaderboards = getLeaderboards;
/**
* Gets leaderboards with the signed in user's friends and the supplied
* destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and
* may experience rough edges. The schema is in final form, but there may be bugs
* that prevent desirable operation.
*/
function getLeaderboardsForCharacter(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Stats/Leaderboards/" + params.membershipType + "/" + params.destinyMembershipId + "/" + params.characterId + "/",
params: {
maxtop: params.maxtop,
modes: params.modes,
statid: params.statid
}
});
}
exports.getLeaderboardsForCharacter = getLeaderboardsForCharacter;
/** Gets a page list of Destiny items. */
function searchDestinyEntities(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Armory/Search/" + params.type + "/" + params.searchTerm + "/",
params: {
page: params.page
}
});
}
exports.searchDestinyEntities = searchDestinyEntities;
/** Gets historical stats for indicated character. */
function getHistoricalStats(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Stats/",
params: {
dayend: params.dayend,
daystart: params.daystart,
groups: params.groups ? params.groups.join(',') : undefined,
modes: params.modes ? params.modes.join(',') : undefined,
periodType: params.periodType
}
});
}
exports.getHistoricalStats = getHistoricalStats;
/**
* Gets aggregate historical stats organized around each character for a given
* account.
*/
function getHistoricalStatsForAccount(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Stats/",
params: {
groups: params.groups ? params.groups.join(',') : undefined
}
});
}
exports.getHistoricalStatsForAccount = getHistoricalStatsForAccount;
/** Gets activity history stats for indicated character. */
function getActivityHistory(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Stats/Activities/",
params: {
count: params.count,
mode: params.mode,
page: params.page
}
});
}
exports.getActivityHistory = getActivityHistory;
/** Gets details about unique weapon usage, including all exotic weapons. */
function getUniqueWeaponHistory(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Stats/UniqueWeapons/"
});
}
exports.getUniqueWeaponHistory = getUniqueWeaponHistory;
/**
* Gets all activities the character has participated in together with aggregate
* statistics for those activities.
*/
function getDestinyAggregateActivityStats(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/" + params.membershipType + "/Account/" + params.destinyMembershipId + "/Character/" + params.characterId + "/Stats/AggregateActivityStats/"
});
}
exports.getDestinyAggregateActivityStats = getDestinyAggregateActivityStats;
/** Gets custom localized content for the milestone of the given hash, if it exists. */
function getPublicMilestoneContent(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Milestones/" + params.milestoneHash + "/Content/"
});
}
exports.getPublicMilestoneContent = getPublicMilestoneContent;
/** Gets public information about currently available Milestones. */
function getPublicMilestones(http) {
return http({
method: 'GET',
url: 'https://www.bungie.net/Platform/Destiny2/Milestones/'
});
}
exports.getPublicMilestones = getPublicMilestones;
/** Initialize a request to perform an advanced write action. */
function awaInitializeRequest(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Awa/Initialize/',
body: body
});
}
exports.awaInitializeRequest = awaInitializeRequest;
/**
* Provide the result of the user interaction. Called by the Bungie Destiny App to
* approve or reject a request.
*/
function awaProvideAuthorizationResult(http, body) {
return http({
method: 'POST',
url: 'https://www.bungie.net/Platform/Destiny2/Awa/AwaProvideAuthorizationResult/',
body: body
});
}
exports.awaProvideAuthorizationResult = awaProvideAuthorizationResult;
/** Returns the action token if user approves the request. */
function awaGetActionToken(http, params) {
return http({
method: 'GET',
url: "https://www.bungie.net/Platform/Destiny2/Awa/GetActionToken/" + params.correlationId + "/"
});
}
exports.awaGetActionToken = awaGetActionToken;