@taskeren/bungie-api-ts 5.10.0 → 5.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +66 -27
- package/.babelrc +0 -4
- package/.gitattributes +0 -2
- package/.github/workflows/pr-build.yml +0 -50
- package/.github/workflows/publish.yml +0 -48
- package/.github/workflows/update.yml +0 -55
- package/.gitmodules +0 -3
- package/.nvmrc +0 -1
- package/.prettierrc +0 -10
- package/.vscode/extensions.json +0 -8
- package/.vscode/settings.json +0 -7
- package/LICENSE.md +0 -21
- package/api-src/.github/workflows/close-inactive.yml +0 -24
- package/api-src/CHANGELOG.md +0 -271
- package/api-src/CONTRIBUTING.md +0 -19
- package/api-src/LICENSE +0 -28
- package/api-src/README.md +0 -378
- package/api-src/openapi-2.json +0 -44518
- package/api-src/openapi.json +0 -46467
- package/build.sh +0 -30
- package/generated-src/app/api.ts +0 -50
- package/generated-src/app/index.ts +0 -17
- package/generated-src/app/interfaces.ts +0 -119
- package/generated-src/common.ts +0 -985
- package/generated-src/communitycontent/api.ts +0 -36
- package/generated-src/communitycontent/index.ts +0 -16
- package/generated-src/content/api.ts +0 -142
- package/generated-src/content/index.ts +0 -17
- package/generated-src/content/interfaces.ts +0 -225
- package/generated-src/core/api.ts +0 -57
- package/generated-src/core/index.ts +0 -17
- package/generated-src/core/interfaces.ts +0 -151
- package/generated-src/destiny2/api.ts +0 -821
- package/generated-src/destiny2/index.ts +0 -17
- package/generated-src/destiny2/interfaces.ts +0 -15714
- package/generated-src/destiny2/manifest.ts +0 -341
- package/generated-src/fireteam/api.ts +0 -151
- package/generated-src/fireteam/index.ts +0 -17
- package/generated-src/fireteam/interfaces.ts +0 -183
- package/generated-src/forum/api.ts +0 -197
- package/generated-src/forum/index.ts +0 -17
- package/generated-src/forum/interfaces.ts +0 -171
- package/generated-src/groupv2/api.ts +0 -515
- package/generated-src/groupv2/index.ts +0 -17
- package/generated-src/groupv2/interfaces.ts +0 -773
- package/generated-src/http.ts +0 -52
- package/generated-src/index.ts +0 -37
- package/generated-src/package.json.notyet +0 -99
- package/generated-src/platform.ts +0 -39
- package/generated-src/social/api.ts +0 -115
- package/generated-src/social/index.ts +0 -17
- package/generated-src/social/interfaces.ts +0 -89
- package/generated-src/tokens/api.ts +0 -126
- package/generated-src/tokens/index.ts +0 -17
- package/generated-src/tokens/interfaces.ts +0 -102
- package/generated-src/trending/api.ts +0 -62
- package/generated-src/trending/index.ts +0 -17
- package/generated-src/trending/interfaces.ts +0 -188
- package/generated-src/user/api.ts +0 -130
- package/generated-src/user/index.ts +0 -17
- package/generated-src/user/interfaces.ts +0 -338
- package/generator/generate-api.ts +0 -254
- package/generator/generate-common.ts +0 -123
- package/generator/generate-index.ts +0 -45
- package/generator/generate-interfaces.ts +0 -173
- package/generator/generate-manifest.ts +0 -217
- package/generator/generate-package-json.ts +0 -45
- package/generator/generate.ts +0 -54
- package/generator/http.ts +0 -52
- package/generator/missing-props.ts +0 -11
- package/generator/type-index.ts +0 -184
- package/generator/util.ts +0 -131
- package/lib/README.md +0 -97
- package/lib/bungie-api-LICENSE +0 -29
- package/lib/package.json +0 -99
- package/test-consumer.ts +0 -5
- package/tests/__snapshots__/config-builders.test.ts.snap +0 -343
- package/tests/config-builders.test.ts +0 -145
- package/tests/manifest-fetcher.test.ts +0 -43
- package/tests/test-manifest.js +0 -69
- package/tsconfig-package.json +0 -14
- package/tsconfig.json +0 -17
- /package/{lib/app → app}/api.d.ts +0 -0
- /package/{lib/app → app}/api.js +0 -0
- /package/{lib/app → app}/index.d.ts +0 -0
- /package/{lib/app → app}/index.js +0 -0
- /package/{lib/app → app}/interfaces.d.ts +0 -0
- /package/{lib/app → app}/interfaces.js +0 -0
- /package/{lib/common.d.ts → common.d.ts} +0 -0
- /package/{lib/common.js → common.js} +0 -0
- /package/{lib/communitycontent → communitycontent}/api.d.ts +0 -0
- /package/{lib/communitycontent → communitycontent}/api.js +0 -0
- /package/{lib/communitycontent → communitycontent}/index.d.ts +0 -0
- /package/{lib/communitycontent → communitycontent}/index.js +0 -0
- /package/{lib/content → content}/api.d.ts +0 -0
- /package/{lib/content → content}/api.js +0 -0
- /package/{lib/content → content}/index.d.ts +0 -0
- /package/{lib/content → content}/index.js +0 -0
- /package/{lib/content → content}/interfaces.d.ts +0 -0
- /package/{lib/content → content}/interfaces.js +0 -0
- /package/{lib/core → core}/api.d.ts +0 -0
- /package/{lib/core → core}/api.js +0 -0
- /package/{lib/core → core}/index.d.ts +0 -0
- /package/{lib/core → core}/index.js +0 -0
- /package/{lib/core → core}/interfaces.d.ts +0 -0
- /package/{lib/core → core}/interfaces.js +0 -0
- /package/{lib/destiny2 → destiny2}/api.d.ts +0 -0
- /package/{lib/destiny2 → destiny2}/api.js +0 -0
- /package/{lib/destiny2 → destiny2}/index.d.ts +0 -0
- /package/{lib/destiny2 → destiny2}/index.js +0 -0
- /package/{lib/destiny2 → destiny2}/interfaces.d.ts +0 -0
- /package/{lib/destiny2 → destiny2}/interfaces.js +0 -0
- /package/{lib/destiny2 → destiny2}/manifest.d.ts +0 -0
- /package/{lib/destiny2 → destiny2}/manifest.js +0 -0
- /package/{lib/fireteam → fireteam}/api.d.ts +0 -0
- /package/{lib/fireteam → fireteam}/api.js +0 -0
- /package/{lib/fireteam → fireteam}/index.d.ts +0 -0
- /package/{lib/fireteam → fireteam}/index.js +0 -0
- /package/{lib/fireteam → fireteam}/interfaces.d.ts +0 -0
- /package/{lib/fireteam → fireteam}/interfaces.js +0 -0
- /package/{lib/forum → forum}/api.d.ts +0 -0
- /package/{lib/forum → forum}/api.js +0 -0
- /package/{lib/forum → forum}/index.d.ts +0 -0
- /package/{lib/forum → forum}/index.js +0 -0
- /package/{lib/forum → forum}/interfaces.d.ts +0 -0
- /package/{lib/forum → forum}/interfaces.js +0 -0
- /package/{lib/groupv2 → groupv2}/api.d.ts +0 -0
- /package/{lib/groupv2 → groupv2}/api.js +0 -0
- /package/{lib/groupv2 → groupv2}/index.d.ts +0 -0
- /package/{lib/groupv2 → groupv2}/index.js +0 -0
- /package/{lib/groupv2 → groupv2}/interfaces.d.ts +0 -0
- /package/{lib/groupv2 → groupv2}/interfaces.js +0 -0
- /package/{lib/http.d.ts → http.d.ts} +0 -0
- /package/{lib/http.js → http.js} +0 -0
- /package/{lib/index.d.ts → index.d.ts} +0 -0
- /package/{lib/index.js → index.js} +0 -0
- /package/{lib/platform.d.ts → platform.d.ts} +0 -0
- /package/{lib/platform.js → platform.js} +0 -0
- /package/{lib/social → social}/api.d.ts +0 -0
- /package/{lib/social → social}/api.js +0 -0
- /package/{lib/social → social}/index.d.ts +0 -0
- /package/{lib/social → social}/index.js +0 -0
- /package/{lib/social → social}/interfaces.d.ts +0 -0
- /package/{lib/social → social}/interfaces.js +0 -0
- /package/{lib/tokens → tokens}/api.d.ts +0 -0
- /package/{lib/tokens → tokens}/api.js +0 -0
- /package/{lib/tokens → tokens}/index.d.ts +0 -0
- /package/{lib/tokens → tokens}/index.js +0 -0
- /package/{lib/tokens → tokens}/interfaces.d.ts +0 -0
- /package/{lib/tokens → tokens}/interfaces.js +0 -0
- /package/{lib/trending → trending}/api.d.ts +0 -0
- /package/{lib/trending → trending}/api.js +0 -0
- /package/{lib/trending → trending}/index.d.ts +0 -0
- /package/{lib/trending → trending}/index.js +0 -0
- /package/{lib/trending → trending}/interfaces.d.ts +0 -0
- /package/{lib/trending → trending}/interfaces.js +0 -0
- /package/{lib/user → user}/api.d.ts +0 -0
- /package/{lib/user → user}/api.js +0 -0
- /package/{lib/user → user}/index.d.ts +0 -0
- /package/{lib/user → user}/index.js +0 -0
- /package/{lib/user → user}/interfaces.d.ts +0 -0
- /package/{lib/user → user}/interfaces.js +0 -0
|
@@ -1,821 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bungie.Net API
|
|
3
|
-
* 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.
|
|
4
|
-
*
|
|
5
|
-
* OpenAPI spec version: 2.21.9
|
|
6
|
-
* Contact: support@bungie.com
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by the bungie-api-ts code generator program.
|
|
9
|
-
* https://github.com/DestinyItemManager/bungie-api-ts
|
|
10
|
-
* Do not edit these files manually.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { HttpClient, get, post } from '../http.js';
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
AwaAuthorizationResult,
|
|
17
|
-
AwaInitializeResponse,
|
|
18
|
-
AwaPermissionRequested,
|
|
19
|
-
AwaUserResponse,
|
|
20
|
-
ClanBannerSource,
|
|
21
|
-
DestinyActivityHistoryResults,
|
|
22
|
-
DestinyActivityModeType,
|
|
23
|
-
DestinyAggregateActivityResults,
|
|
24
|
-
DestinyCharacterResponse,
|
|
25
|
-
DestinyClanAggregateStat,
|
|
26
|
-
DestinyCollectibleNodeDetailResponse,
|
|
27
|
-
DestinyComponentType,
|
|
28
|
-
DestinyDefinition,
|
|
29
|
-
DestinyEntitySearchResult,
|
|
30
|
-
DestinyEquipItemResults,
|
|
31
|
-
DestinyHistoricalStatsAccountResult,
|
|
32
|
-
DestinyHistoricalStatsByPeriod,
|
|
33
|
-
DestinyHistoricalStatsDefinition,
|
|
34
|
-
DestinyHistoricalWeaponStatsData,
|
|
35
|
-
DestinyInsertPlugsActionRequest,
|
|
36
|
-
DestinyInsertPlugsFreeActionRequest,
|
|
37
|
-
DestinyItemActionRequest,
|
|
38
|
-
DestinyItemChangeResponse,
|
|
39
|
-
DestinyItemResponse,
|
|
40
|
-
DestinyItemSetActionRequest,
|
|
41
|
-
DestinyItemStateRequest,
|
|
42
|
-
DestinyItemTransferRequest,
|
|
43
|
-
DestinyLeaderboard,
|
|
44
|
-
DestinyLinkedProfilesResponse,
|
|
45
|
-
DestinyLoadoutActionRequest,
|
|
46
|
-
DestinyLoadoutUpdateActionRequest,
|
|
47
|
-
DestinyManifest,
|
|
48
|
-
DestinyMilestone,
|
|
49
|
-
DestinyMilestoneContent,
|
|
50
|
-
DestinyPostGameCarnageReportData,
|
|
51
|
-
DestinyPostmasterTransferRequest,
|
|
52
|
-
DestinyProfileResponse,
|
|
53
|
-
DestinyPublicMilestone,
|
|
54
|
-
DestinyPublicVendorsResponse,
|
|
55
|
-
DestinyReportOffensePgcrRequest,
|
|
56
|
-
DestinyStatsGroupType,
|
|
57
|
-
DestinyVendorFilter,
|
|
58
|
-
DestinyVendorResponse,
|
|
59
|
-
DestinyVendorsResponse,
|
|
60
|
-
PeriodType
|
|
61
|
-
} from './interfaces.js';
|
|
62
|
-
import {
|
|
63
|
-
BungieMembershipType,
|
|
64
|
-
ServerResponse
|
|
65
|
-
} from '../common.js';
|
|
66
|
-
import {
|
|
67
|
-
ExactSearchRequest,
|
|
68
|
-
UserInfoCard
|
|
69
|
-
} from '../user/interfaces.js';
|
|
70
|
-
|
|
71
|
-
const API_BASE = "https://www.bungie.net/Platform/Destiny2/";
|
|
72
|
-
|
|
73
|
-
/** Returns the current version of the manifest as a json object. */
|
|
74
|
-
export function getDestinyManifest(http: HttpClient): Promise<ServerResponse<DestinyManifest>> {
|
|
75
|
-
return get(http, `${API_BASE}Manifest/`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface GetDestinyEntityDefinitionParams {
|
|
79
|
-
/**
|
|
80
|
-
* The type of entity for whom you would like results. These correspond to the
|
|
81
|
-
* entity's definition contract name. For instance, if you are looking for items,
|
|
82
|
-
* this property should be 'DestinyInventoryItemDefinition'. PREVIEW: This endpoint
|
|
83
|
-
* is still in beta, and may experience rough edges. The schema is tentatively in
|
|
84
|
-
* final form, but there may be bugs that prevent desirable operation.
|
|
85
|
-
*/
|
|
86
|
-
entityType: string;
|
|
87
|
-
/** The hash identifier for the specific Entity you want returned. */
|
|
88
|
-
hashIdentifier: number;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Returns the static definition of an entity of the given Type and hash identifier.
|
|
93
|
-
* Examine the API Documentation for the Type Names of entities that have their
|
|
94
|
-
* own definitions. Note that the return type will always *inherit from*
|
|
95
|
-
* DestinyDefinition, but the specific type returned will be the requested entity
|
|
96
|
-
* type if it can be found. Please don't use this as a chatty alternative to the
|
|
97
|
-
* Manifest database if you require large sets of data, but for simple and one-off
|
|
98
|
-
* accesses this should be handy.
|
|
99
|
-
*/
|
|
100
|
-
export function getDestinyEntityDefinition(http: HttpClient, params: GetDestinyEntityDefinitionParams): Promise<ServerResponse<DestinyDefinition>> {
|
|
101
|
-
return get(http, `${API_BASE}Manifest/${params.entityType}/${params.hashIdentifier}/`);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface SearchDestinyPlayerByBungieNameParams {
|
|
105
|
-
/**
|
|
106
|
-
* A valid non-BungieNet membership type, or All. Indicates which memberships to
|
|
107
|
-
* return. You probably want this set to All.
|
|
108
|
-
*/
|
|
109
|
-
membershipType: BungieMembershipType;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Returns a list of Destiny memberships given a global Bungie Display Name. This
|
|
114
|
-
* method will hide overridden memberships due to cross save.
|
|
115
|
-
*/
|
|
116
|
-
export function searchDestinyPlayerByBungieName(http: HttpClient, params: SearchDestinyPlayerByBungieNameParams, body: ExactSearchRequest): Promise<ServerResponse<UserInfoCard[]>> {
|
|
117
|
-
return post(http, `${API_BASE}SearchDestinyPlayerByBungieName/${params.membershipType}/`, body);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface GetLinkedProfilesParams {
|
|
121
|
-
/**
|
|
122
|
-
* (optional) if set to 'true', all memberships regardless of whether they're
|
|
123
|
-
* obscured by overrides will be returned. Normal privacy restrictions on account
|
|
124
|
-
* linking will still apply no matter what.
|
|
125
|
-
*/
|
|
126
|
-
getAllMemberships?: boolean;
|
|
127
|
-
/**
|
|
128
|
-
* The ID of the membership whose linked Destiny accounts you want returned. Make
|
|
129
|
-
* sure your membership ID matches its Membership Type: don't pass us a PSN
|
|
130
|
-
* membership ID and the XBox membership type, it's not going to work!
|
|
131
|
-
*/
|
|
132
|
-
membershipId: string;
|
|
133
|
-
/** The type for the membership whose linked Destiny accounts you want returned. */
|
|
134
|
-
membershipType: BungieMembershipType;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Returns a summary information about all profiles linked to the requesting
|
|
139
|
-
* membership type/membership ID that have valid Destiny information. The passed-in
|
|
140
|
-
* Membership Type/Membership ID may be a Bungie.Net membership or a Destiny
|
|
141
|
-
* membership. It only returns the minimal amount of data to begin making more
|
|
142
|
-
* substantive requests, but will hopefully serve as a useful alternative to
|
|
143
|
-
* UserServices for people who just care about Destiny data. Note that it will only
|
|
144
|
-
* return linked accounts whose linkages you are allowed to view.
|
|
145
|
-
*/
|
|
146
|
-
export function getLinkedProfiles(http: HttpClient, params: GetLinkedProfilesParams): Promise<ServerResponse<DestinyLinkedProfilesResponse>> {
|
|
147
|
-
const strParams: Record<string, string> = {};
|
|
148
|
-
if (params.getAllMemberships !== undefined) { strParams.getAllMemberships = params.getAllMemberships.toString(); }
|
|
149
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.membershipId}/LinkedProfiles/`, strParams);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface GetProfileParams {
|
|
153
|
-
/**
|
|
154
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
155
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
156
|
-
* request at least one component to receive results.
|
|
157
|
-
*/
|
|
158
|
-
components: DestinyComponentType[];
|
|
159
|
-
/** Destiny membership ID. */
|
|
160
|
-
destinyMembershipId: string;
|
|
161
|
-
/** A valid non-BungieNet membership type. */
|
|
162
|
-
membershipType: BungieMembershipType;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/** Returns Destiny Profile information for the supplied membership. */
|
|
166
|
-
export function getProfile(http: HttpClient, params: GetProfileParams): Promise<ServerResponse<DestinyProfileResponse>> {
|
|
167
|
-
const strParams: Record<string, string> = {};
|
|
168
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
169
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/`, strParams);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface GetCharacterParams {
|
|
173
|
-
/** ID of the character. */
|
|
174
|
-
characterId: string;
|
|
175
|
-
/**
|
|
176
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
177
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
178
|
-
* request at least one component to receive results.
|
|
179
|
-
*/
|
|
180
|
-
components: DestinyComponentType[];
|
|
181
|
-
/** Destiny membership ID. */
|
|
182
|
-
destinyMembershipId: string;
|
|
183
|
-
/** A valid non-BungieNet membership type. */
|
|
184
|
-
membershipType: BungieMembershipType;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** Returns character information for the supplied character. */
|
|
188
|
-
export function getCharacter(http: HttpClient, params: GetCharacterParams): Promise<ServerResponse<DestinyCharacterResponse>> {
|
|
189
|
-
const strParams: Record<string, string> = {};
|
|
190
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
191
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/`, strParams);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface GetClanWeeklyRewardStateParams {
|
|
195
|
-
/** A valid group id of clan. */
|
|
196
|
-
groupId: string;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Returns information on the weekly clan rewards and if the clan has earned them
|
|
201
|
-
* or not. Note that this will always report rewards as not redeemed.
|
|
202
|
-
*/
|
|
203
|
-
export function getClanWeeklyRewardState(http: HttpClient, params: GetClanWeeklyRewardStateParams): Promise<ServerResponse<DestinyMilestone>> {
|
|
204
|
-
return get(http, `${API_BASE}Clan/${params.groupId}/WeeklyRewardState/`);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/** Returns the dictionary of values for the Clan Banner */
|
|
208
|
-
export function getClanBannerSource(http: HttpClient): Promise<ServerResponse<ClanBannerSource>> {
|
|
209
|
-
return get(http, `${API_BASE}Clan/ClanBannerDictionary/`);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export interface GetItemParams {
|
|
213
|
-
/**
|
|
214
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
215
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
216
|
-
* request at least one component to receive results.
|
|
217
|
-
*/
|
|
218
|
-
components: DestinyComponentType[];
|
|
219
|
-
/** The membership ID of the destiny profile. */
|
|
220
|
-
destinyMembershipId: string;
|
|
221
|
-
/** The Instance ID of the destiny item. */
|
|
222
|
-
itemInstanceId: string;
|
|
223
|
-
/** A valid non-BungieNet membership type. */
|
|
224
|
-
membershipType: BungieMembershipType;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Retrieve the details of an instanced Destiny Item. An instanced Destiny item is
|
|
229
|
-
* one with an ItemInstanceId. Non-instanced items, such as materials, have no
|
|
230
|
-
* useful instance-specific details and thus are not queryable here.
|
|
231
|
-
*/
|
|
232
|
-
export function getItem(http: HttpClient, params: GetItemParams): Promise<ServerResponse<DestinyItemResponse>> {
|
|
233
|
-
const strParams: Record<string, string> = {};
|
|
234
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
235
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Item/${params.itemInstanceId}/`, strParams);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export interface GetVendorsParams {
|
|
239
|
-
/** The Destiny Character ID of the character for whom we're getting vendor info. */
|
|
240
|
-
characterId: string;
|
|
241
|
-
/**
|
|
242
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
243
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
244
|
-
* request at least one component to receive results.
|
|
245
|
-
*/
|
|
246
|
-
components: DestinyComponentType[];
|
|
247
|
-
/** Destiny membership ID of another user. You may be denied. */
|
|
248
|
-
destinyMembershipId: string;
|
|
249
|
-
/** The filter of what vendors and items to return, if any. */
|
|
250
|
-
filter?: DestinyVendorFilter;
|
|
251
|
-
/** A valid non-BungieNet membership type. */
|
|
252
|
-
membershipType: BungieMembershipType;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Get currently available vendors from the list of vendors that can possibly have
|
|
257
|
-
* rotating inventory. Note that this does not include things like preview vendors
|
|
258
|
-
* and vendors-as-kiosks, neither of whom have rotating/dynamic inventories. Use
|
|
259
|
-
* their definitions as-is for those.
|
|
260
|
-
*/
|
|
261
|
-
export function getVendors(http: HttpClient, params: GetVendorsParams): Promise<ServerResponse<DestinyVendorsResponse>> {
|
|
262
|
-
const strParams: Record<string, string> = {};
|
|
263
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
264
|
-
if (params.filter !== undefined) { strParams.filter = params.filter.toString(); }
|
|
265
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Vendors/`, strParams);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface GetVendorParams {
|
|
269
|
-
/** The Destiny Character ID of the character for whom we're getting vendor info. */
|
|
270
|
-
characterId: string;
|
|
271
|
-
/**
|
|
272
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
273
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
274
|
-
* request at least one component to receive results.
|
|
275
|
-
*/
|
|
276
|
-
components: DestinyComponentType[];
|
|
277
|
-
/** Destiny membership ID of another user. You may be denied. */
|
|
278
|
-
destinyMembershipId: string;
|
|
279
|
-
/** A valid non-BungieNet membership type. */
|
|
280
|
-
membershipType: BungieMembershipType;
|
|
281
|
-
/** The Hash identifier of the Vendor to be returned. */
|
|
282
|
-
vendorHash: number;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/** Get the details of a specific Vendor. */
|
|
286
|
-
export function getVendor(http: HttpClient, params: GetVendorParams): Promise<ServerResponse<DestinyVendorResponse>> {
|
|
287
|
-
const strParams: Record<string, string> = {};
|
|
288
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
289
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Vendors/${params.vendorHash}/`, strParams);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export interface GetPublicVendorsParams {
|
|
293
|
-
/**
|
|
294
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
295
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
296
|
-
* request at least one component to receive results.
|
|
297
|
-
*/
|
|
298
|
-
components: DestinyComponentType[];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Get items available from vendors where the vendors have items for sale that are
|
|
303
|
-
* common for everyone. If any portion of the Vendor's available inventory is
|
|
304
|
-
* character or account specific, we will be unable to return their data from this
|
|
305
|
-
* endpoint due to the way that available inventory is computed. As I am often
|
|
306
|
-
* guilty of saying: 'It's a long story...'
|
|
307
|
-
*/
|
|
308
|
-
export function getPublicVendors(http: HttpClient, params: GetPublicVendorsParams): Promise<ServerResponse<DestinyPublicVendorsResponse>> {
|
|
309
|
-
const strParams: Record<string, string> = {};
|
|
310
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
311
|
-
return get(http, `${API_BASE}Vendors/`, strParams);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export interface GetCollectibleNodeDetailsParams {
|
|
315
|
-
/**
|
|
316
|
-
* The Destiny Character ID of the character for whom we're getting collectible
|
|
317
|
-
* detail info.
|
|
318
|
-
*/
|
|
319
|
-
characterId: string;
|
|
320
|
-
/**
|
|
321
|
-
* The hash identifier of the Presentation Node for whom we should return
|
|
322
|
-
* collectible details. Details will only be returned for collectibles that are
|
|
323
|
-
* direct descendants of this node.
|
|
324
|
-
*/
|
|
325
|
-
collectiblePresentationNodeHash: number;
|
|
326
|
-
/**
|
|
327
|
-
* A comma separated list of components to return (as strings or numeric values).
|
|
328
|
-
* See the DestinyComponentType enum for valid components to request. You must
|
|
329
|
-
* request at least one component to receive results.
|
|
330
|
-
*/
|
|
331
|
-
components: DestinyComponentType[];
|
|
332
|
-
/** Destiny membership ID of another user. You may be denied. */
|
|
333
|
-
destinyMembershipId: string;
|
|
334
|
-
/** A valid non-BungieNet membership type. */
|
|
335
|
-
membershipType: BungieMembershipType;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Given a Presentation Node that has Collectibles as direct descendants, this will
|
|
340
|
-
* return item details about those descendants in the context of the requesting
|
|
341
|
-
* character.
|
|
342
|
-
*/
|
|
343
|
-
export function getCollectibleNodeDetails(http: HttpClient, params: GetCollectibleNodeDetailsParams): Promise<ServerResponse<DestinyCollectibleNodeDetailResponse>> {
|
|
344
|
-
const strParams: Record<string, string> = {};
|
|
345
|
-
if (params.components?.length) { strParams.components = params.components.join(','); }
|
|
346
|
-
return get(http, `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Collectibles/${params.collectiblePresentationNodeHash}/`, strParams);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Transfer an item to/from your vault. You must have a valid Destiny account. You
|
|
351
|
-
* must also pass BOTH a reference AND an instance ID if it's an instanced item.
|
|
352
|
-
* itshappening.gif
|
|
353
|
-
*
|
|
354
|
-
* Wait at least 0.1s between actions.
|
|
355
|
-
*/
|
|
356
|
-
export function transferItem(http: HttpClient, body: DestinyItemTransferRequest): Promise<ServerResponse<number>> {
|
|
357
|
-
return post(http, `${API_BASE}Actions/Items/TransferItem/`, body);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Extract an item from the Postmaster, with whatever implications that may entail.
|
|
362
|
-
* You must have a valid Destiny account. You must also pass BOTH a reference AND
|
|
363
|
-
* an instance ID if it's an instanced item.
|
|
364
|
-
*
|
|
365
|
-
* Wait at least 0.1s between actions.
|
|
366
|
-
*/
|
|
367
|
-
export function pullFromPostmaster(http: HttpClient, body: DestinyPostmasterTransferRequest): Promise<ServerResponse<number>> {
|
|
368
|
-
return post(http, `${API_BASE}Actions/Items/PullFromPostmaster/`, body);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Equip an item. You must have a valid Destiny Account, and either be in a social
|
|
373
|
-
* space, in orbit, or offline.
|
|
374
|
-
*
|
|
375
|
-
* Wait at least 0.1s between actions.
|
|
376
|
-
*/
|
|
377
|
-
export function equipItem(http: HttpClient, body: DestinyItemActionRequest): Promise<ServerResponse<number>> {
|
|
378
|
-
return post(http, `${API_BASE}Actions/Items/EquipItem/`, body);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Equip a list of items by itemInstanceIds. You must have a valid Destiny Account,
|
|
383
|
-
* and either be in a social space, in orbit, or offline. Any items not found on
|
|
384
|
-
* your character will be ignored.
|
|
385
|
-
*
|
|
386
|
-
* Wait at least 0.1s between actions.
|
|
387
|
-
*/
|
|
388
|
-
export function equipItems(http: HttpClient, body: DestinyItemSetActionRequest): Promise<ServerResponse<DestinyEquipItemResults>> {
|
|
389
|
-
return post(http, `${API_BASE}Actions/Items/EquipItems/`, body);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Equip a loadout. You must have a valid Destiny Account, and either be in a
|
|
394
|
-
* social space, in orbit, or offline.
|
|
395
|
-
*
|
|
396
|
-
* Wait at least 1s between actions.
|
|
397
|
-
*/
|
|
398
|
-
export function equipLoadout(http: HttpClient, body: DestinyLoadoutActionRequest): Promise<ServerResponse<number>> {
|
|
399
|
-
return post(http, `${API_BASE}Actions/Loadouts/EquipLoadout/`, body);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Snapshot a loadout with the currently equipped items.
|
|
404
|
-
*
|
|
405
|
-
* Wait at least 1s between actions.
|
|
406
|
-
*/
|
|
407
|
-
export function snapshotLoadout(http: HttpClient, body: DestinyLoadoutUpdateActionRequest): Promise<ServerResponse<number>> {
|
|
408
|
-
return post(http, `${API_BASE}Actions/Loadouts/SnapshotLoadout/`, body);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Update the color, icon, and name of a loadout.
|
|
413
|
-
*
|
|
414
|
-
* Wait at least 1s between actions.
|
|
415
|
-
*/
|
|
416
|
-
export function updateLoadoutIdentifiers(http: HttpClient, body: DestinyLoadoutUpdateActionRequest): Promise<ServerResponse<number>> {
|
|
417
|
-
return post(http, `${API_BASE}Actions/Loadouts/UpdateLoadoutIdentifiers/`, body);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Clear the identifiers and items of a loadout.
|
|
422
|
-
*
|
|
423
|
-
* Wait at least 1s between actions.
|
|
424
|
-
*/
|
|
425
|
-
export function clearLoadout(http: HttpClient, body: DestinyLoadoutActionRequest): Promise<ServerResponse<number>> {
|
|
426
|
-
return post(http, `${API_BASE}Actions/Loadouts/ClearLoadout/`, body);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Set the Lock State for an instanced item. You must have a valid Destiny Account.
|
|
431
|
-
*
|
|
432
|
-
* Wait at least 0.1s between actions.
|
|
433
|
-
*/
|
|
434
|
-
export function setItemLockState(http: HttpClient, body: DestinyItemStateRequest): Promise<ServerResponse<number>> {
|
|
435
|
-
return post(http, `${API_BASE}Actions/Items/SetLockState/`, body);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Set the Tracking State for an instanced item, if that item is a Quest or Bounty.
|
|
440
|
-
* You must have a valid Destiny Account. Yeah, it's an item.
|
|
441
|
-
*
|
|
442
|
-
* Wait at least 1s between actions.
|
|
443
|
-
*/
|
|
444
|
-
export function setQuestTrackedState(http: HttpClient, body: DestinyItemStateRequest): Promise<ServerResponse<number>> {
|
|
445
|
-
return post(http, `${API_BASE}Actions/Items/SetTrackedState/`, body);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Insert a plug into a socketed item. I know how it sounds, but I assure you it's
|
|
450
|
-
* much more G-rated than you might be guessing. We haven't decided yet whether
|
|
451
|
-
* this will be able to insert plugs that have side effects, but if we do it will
|
|
452
|
-
* require special scope permission for an application attempting to do so. You
|
|
453
|
-
* must have a valid Destiny Account, and either be in a social space, in orbit, or
|
|
454
|
-
* offline. Request must include proof of permission for 'InsertPlugs' from the
|
|
455
|
-
* account owner.
|
|
456
|
-
*
|
|
457
|
-
* Wait at least 0.5s between actions.
|
|
458
|
-
*/
|
|
459
|
-
export function insertSocketPlug(http: HttpClient, body: DestinyInsertPlugsActionRequest): Promise<ServerResponse<DestinyItemChangeResponse>> {
|
|
460
|
-
return post(http, `${API_BASE}Actions/Items/InsertSocketPlug/`, body);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Insert a 'free' plug into an item's socket. This does not require 'Advanced
|
|
465
|
-
* Write Action' authorization and is available to 3rd-party apps, but will only
|
|
466
|
-
* work on 'free and reversible' socket actions (Perks, Armor Mods, Shaders,
|
|
467
|
-
* Ornaments, etc.). You must have a valid Destiny Account, and the character must
|
|
468
|
-
* either be in a social space, in orbit, or offline.
|
|
469
|
-
*
|
|
470
|
-
* Wait at least 0.5s between actions.
|
|
471
|
-
*/
|
|
472
|
-
export function insertSocketPlugFree(http: HttpClient, body: DestinyInsertPlugsFreeActionRequest): Promise<ServerResponse<DestinyItemChangeResponse>> {
|
|
473
|
-
return post(http, `${API_BASE}Actions/Items/InsertSocketPlugFree/`, body);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export interface GetPostGameCarnageReportParams {
|
|
477
|
-
/** The ID of the activity whose PGCR is requested. */
|
|
478
|
-
activityId: string;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/** Gets the available post game carnage report for the activity ID. */
|
|
482
|
-
export function getPostGameCarnageReport(http: HttpClient, params: GetPostGameCarnageReportParams): Promise<ServerResponse<DestinyPostGameCarnageReportData>> {
|
|
483
|
-
return get(http, `https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/${params.activityId}/`);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export interface ReportOffensivePostGameCarnageReportPlayerParams {
|
|
487
|
-
/** The ID of the activity where you ran into the brigand that you're reporting. */
|
|
488
|
-
activityId: string;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Report a player that you met in an activity that was engaging in ToS-violating
|
|
493
|
-
* activities. Both you and the offending player must have played in the activityId
|
|
494
|
-
* passed in. Please use this judiciously and only when you have strong suspicions
|
|
495
|
-
* of violation, pretty please.
|
|
496
|
-
*/
|
|
497
|
-
export function reportOffensivePostGameCarnageReportPlayer(http: HttpClient, params: ReportOffensivePostGameCarnageReportPlayerParams, body: DestinyReportOffensePgcrRequest): Promise<ServerResponse<number>> {
|
|
498
|
-
return post(http, `https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/${params.activityId}/Report/`, body);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
/** Gets historical stats definitions. */
|
|
502
|
-
export function getHistoricalStatsDefinition(http: HttpClient): Promise<ServerResponse<{ [key: string]: DestinyHistoricalStatsDefinition }>> {
|
|
503
|
-
return get(http, `${API_BASE}Stats/Definition/`);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
export interface GetClanLeaderboardsParams {
|
|
507
|
-
/** Group ID of the clan whose leaderboards you wish to fetch. */
|
|
508
|
-
groupId: string;
|
|
509
|
-
/**
|
|
510
|
-
* Maximum number of top players to return. Use a large number to get entire
|
|
511
|
-
* leaderboard.
|
|
512
|
-
*/
|
|
513
|
-
maxtop?: number;
|
|
514
|
-
/**
|
|
515
|
-
* List of game modes for which to get leaderboards. See the documentation for
|
|
516
|
-
* DestinyActivityModeType for valid values, and pass in string representation,
|
|
517
|
-
* comma delimited.
|
|
518
|
-
*/
|
|
519
|
-
modes?: string;
|
|
520
|
-
/** ID of stat to return rather than returning all Leaderboard stats. */
|
|
521
|
-
statid?: string;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Gets leaderboards with the signed in user's friends and the supplied
|
|
526
|
-
* destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and
|
|
527
|
-
* may experience rough edges. The schema is in final form, but there may be bugs
|
|
528
|
-
* that prevent desirable operation.
|
|
529
|
-
*/
|
|
530
|
-
export function getClanLeaderboards(http: HttpClient, params: GetClanLeaderboardsParams): Promise<ServerResponse<{ [key: string]: { [key: string]: DestinyLeaderboard } }>> {
|
|
531
|
-
const strParams: Record<string, string> = {};
|
|
532
|
-
if (params.maxtop !== undefined) { strParams.maxtop = params.maxtop.toString(); }
|
|
533
|
-
if (params.modes !== undefined) { strParams.modes = params.modes; }
|
|
534
|
-
if (params.statid !== undefined) { strParams.statid = params.statid; }
|
|
535
|
-
return get(http, `${API_BASE}Stats/Leaderboards/Clans/${params.groupId}/`, strParams);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
export interface GetClanAggregateStatsParams {
|
|
539
|
-
/** Group ID of the clan whose leaderboards you wish to fetch. */
|
|
540
|
-
groupId: string;
|
|
541
|
-
/**
|
|
542
|
-
* List of game modes for which to get leaderboards. See the documentation for
|
|
543
|
-
* DestinyActivityModeType for valid values, and pass in string representation,
|
|
544
|
-
* comma delimited.
|
|
545
|
-
*/
|
|
546
|
-
modes?: string;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Gets aggregated stats for a clan using the same categories as the clan
|
|
551
|
-
* leaderboards. PREVIEW: This endpoint is still in beta, and may experience rough
|
|
552
|
-
* edges. The schema is in final form, but there may be bugs that prevent desirable
|
|
553
|
-
* operation.
|
|
554
|
-
*/
|
|
555
|
-
export function getClanAggregateStats(http: HttpClient, params: GetClanAggregateStatsParams): Promise<ServerResponse<DestinyClanAggregateStat[]>> {
|
|
556
|
-
const strParams: Record<string, string> = {};
|
|
557
|
-
if (params.modes !== undefined) { strParams.modes = params.modes; }
|
|
558
|
-
return get(http, `${API_BASE}Stats/AggregateClanStats/${params.groupId}/`, strParams);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export interface GetLeaderboardsParams {
|
|
562
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
563
|
-
destinyMembershipId: string;
|
|
564
|
-
/**
|
|
565
|
-
* Maximum number of top players to return. Use a large number to get entire
|
|
566
|
-
* leaderboard.
|
|
567
|
-
*/
|
|
568
|
-
maxtop?: number;
|
|
569
|
-
/** A valid non-BungieNet membership type. */
|
|
570
|
-
membershipType: BungieMembershipType;
|
|
571
|
-
/**
|
|
572
|
-
* List of game modes for which to get leaderboards. See the documentation for
|
|
573
|
-
* DestinyActivityModeType for valid values, and pass in string representation,
|
|
574
|
-
* comma delimited.
|
|
575
|
-
*/
|
|
576
|
-
modes?: string;
|
|
577
|
-
/** ID of stat to return rather than returning all Leaderboard stats. */
|
|
578
|
-
statid?: string;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Gets leaderboards with the signed in user's friends and the supplied
|
|
583
|
-
* destinyMembershipId as the focus. PREVIEW: This endpoint has not yet been
|
|
584
|
-
* implemented. It is being returned for a preview of future functionality, and for
|
|
585
|
-
* public comment/suggestion/preparation.
|
|
586
|
-
*/
|
|
587
|
-
export function getLeaderboards(http: HttpClient, params: GetLeaderboardsParams): Promise<ServerResponse<{ [key: string]: { [key: string]: DestinyLeaderboard } }>> {
|
|
588
|
-
const strParams: Record<string, string> = {};
|
|
589
|
-
if (params.maxtop !== undefined) { strParams.maxtop = params.maxtop.toString(); }
|
|
590
|
-
if (params.modes !== undefined) { strParams.modes = params.modes; }
|
|
591
|
-
if (params.statid !== undefined) { strParams.statid = params.statid; }
|
|
592
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Stats/Leaderboards/`, strParams);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
export interface GetLeaderboardsForCharacterParams {
|
|
596
|
-
/**
|
|
597
|
-
* The specific character to build the leaderboard around for the provided Destiny
|
|
598
|
-
* Membership.
|
|
599
|
-
*/
|
|
600
|
-
characterId: string;
|
|
601
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
602
|
-
destinyMembershipId: string;
|
|
603
|
-
/**
|
|
604
|
-
* Maximum number of top players to return. Use a large number to get entire
|
|
605
|
-
* leaderboard.
|
|
606
|
-
*/
|
|
607
|
-
maxtop?: number;
|
|
608
|
-
/** A valid non-BungieNet membership type. */
|
|
609
|
-
membershipType: BungieMembershipType;
|
|
610
|
-
/**
|
|
611
|
-
* List of game modes for which to get leaderboards. See the documentation for
|
|
612
|
-
* DestinyActivityModeType for valid values, and pass in string representation,
|
|
613
|
-
* comma delimited.
|
|
614
|
-
*/
|
|
615
|
-
modes?: string;
|
|
616
|
-
/** ID of stat to return rather than returning all Leaderboard stats. */
|
|
617
|
-
statid?: string;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Gets leaderboards with the signed in user's friends and the supplied
|
|
622
|
-
* destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and
|
|
623
|
-
* may experience rough edges. The schema is in final form, but there may be bugs
|
|
624
|
-
* that prevent desirable operation.
|
|
625
|
-
*/
|
|
626
|
-
export function getLeaderboardsForCharacter(http: HttpClient, params: GetLeaderboardsForCharacterParams): Promise<ServerResponse<{ [key: string]: { [key: string]: DestinyLeaderboard } }>> {
|
|
627
|
-
const strParams: Record<string, string> = {};
|
|
628
|
-
if (params.maxtop !== undefined) { strParams.maxtop = params.maxtop.toString(); }
|
|
629
|
-
if (params.modes !== undefined) { strParams.modes = params.modes; }
|
|
630
|
-
if (params.statid !== undefined) { strParams.statid = params.statid; }
|
|
631
|
-
return get(http, `${API_BASE}Stats/Leaderboards/${params.membershipType}/${params.destinyMembershipId}/${params.characterId}/`, strParams);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export interface SearchDestinyEntitiesParams {
|
|
635
|
-
/** Page number to return, starting with 0. */
|
|
636
|
-
page?: number;
|
|
637
|
-
/** The string to use when searching for Destiny entities. */
|
|
638
|
-
searchTerm: string;
|
|
639
|
-
/**
|
|
640
|
-
* The type of entity for whom you would like results. These correspond to the
|
|
641
|
-
* entity's definition contract name. For instance, if you are looking for items,
|
|
642
|
-
* this property should be 'DestinyInventoryItemDefinition'.
|
|
643
|
-
*/
|
|
644
|
-
type: string;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
/** Gets a page list of Destiny items. */
|
|
648
|
-
export function searchDestinyEntities(http: HttpClient, params: SearchDestinyEntitiesParams): Promise<ServerResponse<DestinyEntitySearchResult>> {
|
|
649
|
-
const strParams: Record<string, string> = {};
|
|
650
|
-
if (params.page !== undefined) { strParams.page = params.page.toString(); }
|
|
651
|
-
return get(http, `${API_BASE}Armory/Search/${params.type}/${params.searchTerm}/`, strParams);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
export interface GetHistoricalStatsParams {
|
|
655
|
-
/**
|
|
656
|
-
* The id of the character to retrieve. You can omit this character ID or set it to
|
|
657
|
-
* 0 to get aggregate stats across all characters.
|
|
658
|
-
*/
|
|
659
|
-
characterId: string;
|
|
660
|
-
/**
|
|
661
|
-
* Last day to return when daily stats are requested. Use the format YYYY-MM-DD.
|
|
662
|
-
* Currently, we cannot allow more than 31 days of daily data to be requested in a
|
|
663
|
-
* single request.
|
|
664
|
-
*/
|
|
665
|
-
dayend?: string;
|
|
666
|
-
/**
|
|
667
|
-
* First day to return when daily stats are requested. Use the format YYYY-MM-DD.
|
|
668
|
-
* Currently, we cannot allow more than 31 days of daily data to be requested in a
|
|
669
|
-
* single request.
|
|
670
|
-
*/
|
|
671
|
-
daystart?: string;
|
|
672
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
673
|
-
destinyMembershipId: string;
|
|
674
|
-
/**
|
|
675
|
-
* Group of stats to include, otherwise only general stats are returned. Comma
|
|
676
|
-
* separated list is allowed. Values: General, Weapons, Medals
|
|
677
|
-
*/
|
|
678
|
-
groups?: DestinyStatsGroupType[];
|
|
679
|
-
/** A valid non-BungieNet membership type. */
|
|
680
|
-
membershipType: BungieMembershipType;
|
|
681
|
-
/**
|
|
682
|
-
* Game modes to return. See the documentation for DestinyActivityModeType for
|
|
683
|
-
* valid values, and pass in string representation, comma delimited.
|
|
684
|
-
*/
|
|
685
|
-
modes?: DestinyActivityModeType[];
|
|
686
|
-
/**
|
|
687
|
-
* Indicates a specific period type to return. Optional. May be: Daily, AllTime, or
|
|
688
|
-
* Activity
|
|
689
|
-
*/
|
|
690
|
-
periodType?: PeriodType;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
/** Gets historical stats for indicated character. */
|
|
694
|
-
export function getHistoricalStats(http: HttpClient, params: GetHistoricalStatsParams): Promise<ServerResponse<{ [key: string]: DestinyHistoricalStatsByPeriod }>> {
|
|
695
|
-
const strParams: Record<string, string> = {};
|
|
696
|
-
if (params.dayend !== undefined) { strParams.dayend = params.dayend; }
|
|
697
|
-
if (params.daystart !== undefined) { strParams.daystart = params.daystart; }
|
|
698
|
-
if (params.groups?.length) { strParams.groups = params.groups.join(','); }
|
|
699
|
-
if (params.modes?.length) { strParams.modes = params.modes.join(','); }
|
|
700
|
-
if (params.periodType !== undefined) { strParams.periodType = params.periodType.toString(); }
|
|
701
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/`, strParams);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
export interface GetHistoricalStatsForAccountParams {
|
|
705
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
706
|
-
destinyMembershipId: string;
|
|
707
|
-
/**
|
|
708
|
-
* Groups of stats to include, otherwise only general stats are returned. Comma
|
|
709
|
-
* separated list is allowed. Values: General, Weapons, Medals.
|
|
710
|
-
*/
|
|
711
|
-
groups?: DestinyStatsGroupType[];
|
|
712
|
-
/** A valid non-BungieNet membership type. */
|
|
713
|
-
membershipType: BungieMembershipType;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* Gets aggregate historical stats organized around each character for a given
|
|
718
|
-
* account.
|
|
719
|
-
*/
|
|
720
|
-
export function getHistoricalStatsForAccount(http: HttpClient, params: GetHistoricalStatsForAccountParams): Promise<ServerResponse<DestinyHistoricalStatsAccountResult>> {
|
|
721
|
-
const strParams: Record<string, string> = {};
|
|
722
|
-
if (params.groups?.length) { strParams.groups = params.groups.join(','); }
|
|
723
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Stats/`, strParams);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
export interface GetActivityHistoryParams {
|
|
727
|
-
/** The id of the character to retrieve. */
|
|
728
|
-
characterId: string;
|
|
729
|
-
/** Number of rows to return */
|
|
730
|
-
count?: number;
|
|
731
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
732
|
-
destinyMembershipId: string;
|
|
733
|
-
/** A valid non-BungieNet membership type. */
|
|
734
|
-
membershipType: BungieMembershipType;
|
|
735
|
-
/**
|
|
736
|
-
* A filter for the activity mode to be returned. None returns all activities. See
|
|
737
|
-
* the documentation for DestinyActivityModeType for valid values, and pass in
|
|
738
|
-
* string representation.
|
|
739
|
-
*/
|
|
740
|
-
mode?: DestinyActivityModeType;
|
|
741
|
-
/** Page number to return, starting with 0. */
|
|
742
|
-
page?: number;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
/** Gets activity history stats for indicated character. */
|
|
746
|
-
export function getActivityHistory(http: HttpClient, params: GetActivityHistoryParams): Promise<ServerResponse<DestinyActivityHistoryResults>> {
|
|
747
|
-
const strParams: Record<string, string> = {};
|
|
748
|
-
if (params.count !== undefined) { strParams.count = params.count.toString(); }
|
|
749
|
-
if (params.mode !== undefined) { strParams.mode = params.mode.toString(); }
|
|
750
|
-
if (params.page !== undefined) { strParams.page = params.page.toString(); }
|
|
751
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/Activities/`, strParams);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
export interface GetUniqueWeaponHistoryParams {
|
|
755
|
-
/** The id of the character to retrieve. */
|
|
756
|
-
characterId: string;
|
|
757
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
758
|
-
destinyMembershipId: string;
|
|
759
|
-
/** A valid non-BungieNet membership type. */
|
|
760
|
-
membershipType: BungieMembershipType;
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
/** Gets details about unique weapon usage, including all exotic weapons. */
|
|
764
|
-
export function getUniqueWeaponHistory(http: HttpClient, params: GetUniqueWeaponHistoryParams): Promise<ServerResponse<DestinyHistoricalWeaponStatsData>> {
|
|
765
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/UniqueWeapons/`);
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
export interface GetDestinyAggregateActivityStatsParams {
|
|
769
|
-
/** The specific character whose activities should be returned. */
|
|
770
|
-
characterId: string;
|
|
771
|
-
/** The Destiny membershipId of the user to retrieve. */
|
|
772
|
-
destinyMembershipId: string;
|
|
773
|
-
/** A valid non-BungieNet membership type. */
|
|
774
|
-
membershipType: BungieMembershipType;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* Gets all activities the character has participated in together with aggregate
|
|
779
|
-
* statistics for those activities.
|
|
780
|
-
*/
|
|
781
|
-
export function getDestinyAggregateActivityStats(http: HttpClient, params: GetDestinyAggregateActivityStatsParams): Promise<ServerResponse<DestinyAggregateActivityResults>> {
|
|
782
|
-
return get(http, `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/AggregateActivityStats/`);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
export interface GetPublicMilestoneContentParams {
|
|
786
|
-
/** The identifier for the milestone to be returned. */
|
|
787
|
-
milestoneHash: number;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
/** Gets custom localized content for the milestone of the given hash, if it exists. */
|
|
791
|
-
export function getPublicMilestoneContent(http: HttpClient, params: GetPublicMilestoneContentParams): Promise<ServerResponse<DestinyMilestoneContent>> {
|
|
792
|
-
return get(http, `${API_BASE}Milestones/${params.milestoneHash}/Content/`);
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
/** Gets public information about currently available Milestones. */
|
|
796
|
-
export function getPublicMilestones(http: HttpClient): Promise<ServerResponse<{ [key: number]: DestinyPublicMilestone }>> {
|
|
797
|
-
return get(http, `${API_BASE}Milestones/`);
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
/** Initialize a request to perform an advanced write action. */
|
|
801
|
-
export function awaInitializeRequest(http: HttpClient, body: AwaPermissionRequested): Promise<ServerResponse<AwaInitializeResponse>> {
|
|
802
|
-
return post(http, `${API_BASE}Awa/Initialize/`, body);
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
* Provide the result of the user interaction. Called by the Bungie Destiny App to
|
|
807
|
-
* approve or reject a request.
|
|
808
|
-
*/
|
|
809
|
-
export function awaProvideAuthorizationResult(http: HttpClient, body: AwaUserResponse): Promise<ServerResponse<number>> {
|
|
810
|
-
return post(http, `${API_BASE}Awa/AwaProvideAuthorizationResult/`, body);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
export interface AwaGetActionTokenParams {
|
|
814
|
-
/** The identifier for the advanced write action request. */
|
|
815
|
-
correlationId: string;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
/** Returns the action token if user approves the request. */
|
|
819
|
-
export function awaGetActionToken(http: HttpClient, params: AwaGetActionTokenParams): Promise<ServerResponse<AwaAuthorizationResult>> {
|
|
820
|
-
return get(http, `${API_BASE}Awa/GetActionToken/${params.correlationId}/`);
|
|
821
|
-
}
|