@taskeren/bungie-api-ts 5.10.0

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.
Files changed (164) hide show
  1. package/.babelrc +4 -0
  2. package/.gitattributes +2 -0
  3. package/.github/workflows/pr-build.yml +50 -0
  4. package/.github/workflows/publish.yml +48 -0
  5. package/.github/workflows/update.yml +55 -0
  6. package/.gitmodules +3 -0
  7. package/.nvmrc +1 -0
  8. package/.prettierrc +10 -0
  9. package/.vscode/extensions.json +8 -0
  10. package/.vscode/settings.json +7 -0
  11. package/LICENSE.md +21 -0
  12. package/README.md +97 -0
  13. package/api-src/.github/workflows/close-inactive.yml +24 -0
  14. package/api-src/CHANGELOG.md +271 -0
  15. package/api-src/CONTRIBUTING.md +19 -0
  16. package/api-src/LICENSE +28 -0
  17. package/api-src/README.md +378 -0
  18. package/api-src/openapi-2.json +44518 -0
  19. package/api-src/openapi.json +46467 -0
  20. package/build.sh +30 -0
  21. package/bungie-api-LICENSE +29 -0
  22. package/generated-src/app/api.ts +50 -0
  23. package/generated-src/app/index.ts +17 -0
  24. package/generated-src/app/interfaces.ts +119 -0
  25. package/generated-src/common.ts +985 -0
  26. package/generated-src/communitycontent/api.ts +36 -0
  27. package/generated-src/communitycontent/index.ts +16 -0
  28. package/generated-src/content/api.ts +142 -0
  29. package/generated-src/content/index.ts +17 -0
  30. package/generated-src/content/interfaces.ts +225 -0
  31. package/generated-src/core/api.ts +57 -0
  32. package/generated-src/core/index.ts +17 -0
  33. package/generated-src/core/interfaces.ts +151 -0
  34. package/generated-src/destiny2/api.ts +821 -0
  35. package/generated-src/destiny2/index.ts +17 -0
  36. package/generated-src/destiny2/interfaces.ts +15714 -0
  37. package/generated-src/destiny2/manifest.ts +341 -0
  38. package/generated-src/fireteam/api.ts +151 -0
  39. package/generated-src/fireteam/index.ts +17 -0
  40. package/generated-src/fireteam/interfaces.ts +183 -0
  41. package/generated-src/forum/api.ts +197 -0
  42. package/generated-src/forum/index.ts +17 -0
  43. package/generated-src/forum/interfaces.ts +171 -0
  44. package/generated-src/groupv2/api.ts +515 -0
  45. package/generated-src/groupv2/index.ts +17 -0
  46. package/generated-src/groupv2/interfaces.ts +773 -0
  47. package/generated-src/http.ts +52 -0
  48. package/generated-src/index.ts +37 -0
  49. package/generated-src/package.json.notyet +99 -0
  50. package/generated-src/platform.ts +39 -0
  51. package/generated-src/social/api.ts +115 -0
  52. package/generated-src/social/index.ts +17 -0
  53. package/generated-src/social/interfaces.ts +89 -0
  54. package/generated-src/tokens/api.ts +126 -0
  55. package/generated-src/tokens/index.ts +17 -0
  56. package/generated-src/tokens/interfaces.ts +102 -0
  57. package/generated-src/trending/api.ts +62 -0
  58. package/generated-src/trending/index.ts +17 -0
  59. package/generated-src/trending/interfaces.ts +188 -0
  60. package/generated-src/user/api.ts +130 -0
  61. package/generated-src/user/index.ts +17 -0
  62. package/generated-src/user/interfaces.ts +338 -0
  63. package/generator/generate-api.ts +254 -0
  64. package/generator/generate-common.ts +123 -0
  65. package/generator/generate-index.ts +45 -0
  66. package/generator/generate-interfaces.ts +173 -0
  67. package/generator/generate-manifest.ts +217 -0
  68. package/generator/generate-package-json.ts +45 -0
  69. package/generator/generate.ts +54 -0
  70. package/generator/http.ts +52 -0
  71. package/generator/missing-props.ts +11 -0
  72. package/generator/type-index.ts +184 -0
  73. package/generator/util.ts +131 -0
  74. package/lib/README.md +97 -0
  75. package/lib/app/api.d.ts +36 -0
  76. package/lib/app/api.js +15 -0
  77. package/lib/app/index.d.ts +16 -0
  78. package/lib/app/index.js +5 -0
  79. package/lib/app/interfaces.d.ts +108 -0
  80. package/lib/app/interfaces.js +17 -0
  81. package/lib/bungie-api-LICENSE +29 -0
  82. package/lib/common.d.ts +979 -0
  83. package/lib/common.js +923 -0
  84. package/lib/communitycontent/api.d.ts +31 -0
  85. package/lib/communitycontent/api.js +7 -0
  86. package/lib/communitycontent/index.d.ts +15 -0
  87. package/lib/communitycontent/index.js +4 -0
  88. package/lib/content/api.d.ts +111 -0
  89. package/lib/content/api.js +75 -0
  90. package/lib/content/index.d.ts +16 -0
  91. package/lib/content/index.js +5 -0
  92. package/lib/content/interfaces.d.ts +214 -0
  93. package/lib/content/interfaces.js +17 -0
  94. package/lib/core/api.d.ts +45 -0
  95. package/lib/core/api.js +18 -0
  96. package/lib/core/index.d.ts +16 -0
  97. package/lib/core/index.js +5 -0
  98. package/lib/core/interfaces.d.ts +144 -0
  99. package/lib/core/interfaces.js +10 -0
  100. package/lib/destiny2/api.d.ts +765 -0
  101. package/lib/destiny2/api.js +295 -0
  102. package/lib/destiny2/index.d.ts +16 -0
  103. package/lib/destiny2/index.js +5 -0
  104. package/lib/destiny2/interfaces.d.ts +15340 -0
  105. package/lib/destiny2/interfaces.js +826 -0
  106. package/lib/destiny2/manifest.d.ts +465 -0
  107. package/lib/destiny2/manifest.js +56 -0
  108. package/lib/fireteam/api.d.ts +131 -0
  109. package/lib/fireteam/api.js +50 -0
  110. package/lib/fireteam/index.d.ts +16 -0
  111. package/lib/fireteam/index.js +5 -0
  112. package/lib/fireteam/interfaces.d.ts +166 -0
  113. package/lib/fireteam/interfaces.js +33 -0
  114. package/lib/forum/api.d.ts +165 -0
  115. package/lib/forum/api.js +79 -0
  116. package/lib/forum/index.d.ts +16 -0
  117. package/lib/forum/index.js +5 -0
  118. package/lib/forum/interfaces.d.ts +147 -0
  119. package/lib/forum/interfaces.js +61 -0
  120. package/lib/groupv2/api.d.ts +484 -0
  121. package/lib/groupv2/api.js +154 -0
  122. package/lib/groupv2/index.d.ts +16 -0
  123. package/lib/groupv2/index.js +5 -0
  124. package/lib/groupv2/interfaces.d.ts +718 -0
  125. package/lib/groupv2/interfaces.js +100 -0
  126. package/lib/http.d.ts +18 -0
  127. package/lib/http.js +20 -0
  128. package/lib/index.d.ts +35 -0
  129. package/lib/index.js +24 -0
  130. package/lib/package.json +99 -0
  131. package/lib/platform.d.ts +36 -0
  132. package/lib/platform.js +9 -0
  133. package/lib/social/api.d.ts +101 -0
  134. package/lib/social/api.js +26 -0
  135. package/lib/social/index.d.ts +16 -0
  136. package/lib/social/index.js +5 -0
  137. package/lib/social/interfaces.d.ts +75 -0
  138. package/lib/social/interfaces.js +22 -0
  139. package/lib/tokens/api.d.ts +120 -0
  140. package/lib/tokens/api.js +38 -0
  141. package/lib/tokens/index.d.ts +16 -0
  142. package/lib/tokens/index.js +5 -0
  143. package/lib/tokens/interfaces.d.ts +88 -0
  144. package/lib/tokens/interfaces.js +5 -0
  145. package/lib/trending/api.d.ts +53 -0
  146. package/lib/trending/api.js +11 -0
  147. package/lib/trending/index.d.ts +16 -0
  148. package/lib/trending/index.js +5 -0
  149. package/lib/trending/interfaces.d.ts +171 -0
  150. package/lib/trending/interfaces.js +14 -0
  151. package/lib/user/api.d.ts +117 -0
  152. package/lib/user/api.js +35 -0
  153. package/lib/user/index.d.ts +16 -0
  154. package/lib/user/index.js +5 -0
  155. package/lib/user/interfaces.d.ts +320 -0
  156. package/lib/user/interfaces.js +28 -0
  157. package/package.json +60 -0
  158. package/test-consumer.ts +5 -0
  159. package/tests/__snapshots__/config-builders.test.ts.snap +343 -0
  160. package/tests/config-builders.test.ts +145 -0
  161. package/tests/manifest-fetcher.test.ts +43 -0
  162. package/tests/test-manifest.js +69 -0
  163. package/tsconfig-package.json +14 -0
  164. package/tsconfig.json +17 -0
@@ -0,0 +1,295 @@
1
+ import { get, post } from '../http.js';
2
+ const API_BASE = 'https://www.bungie.net/Platform/Destiny2/';
3
+ export function getDestinyManifest(http) {
4
+ return get(http, `${API_BASE}Manifest/`);
5
+ }
6
+ export function getDestinyEntityDefinition(http, params) {
7
+ return get(http, `${API_BASE}Manifest/${params.entityType}/${params.hashIdentifier}/`);
8
+ }
9
+ export function searchDestinyPlayerByBungieName(http, params, body) {
10
+ return post(http, `${API_BASE}SearchDestinyPlayerByBungieName/${params.membershipType}/`, body);
11
+ }
12
+ export function getLinkedProfiles(http, params) {
13
+ const strParams = {};
14
+ if (params.getAllMemberships !== undefined) {
15
+ strParams.getAllMemberships = params.getAllMemberships.toString();
16
+ }
17
+ return get(
18
+ http,
19
+ `${API_BASE}${params.membershipType}/Profile/${params.membershipId}/LinkedProfiles/`,
20
+ strParams
21
+ );
22
+ }
23
+ export function getProfile(http, params) {
24
+ const strParams = {};
25
+ if (params.components?.length) {
26
+ strParams.components = params.components.join(',');
27
+ }
28
+ return get(
29
+ http,
30
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/`,
31
+ strParams
32
+ );
33
+ }
34
+ export function getCharacter(http, params) {
35
+ const strParams = {};
36
+ if (params.components?.length) {
37
+ strParams.components = params.components.join(',');
38
+ }
39
+ return get(
40
+ http,
41
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/`,
42
+ strParams
43
+ );
44
+ }
45
+ export function getClanWeeklyRewardState(http, params) {
46
+ return get(http, `${API_BASE}Clan/${params.groupId}/WeeklyRewardState/`);
47
+ }
48
+ export function getClanBannerSource(http) {
49
+ return get(http, `${API_BASE}Clan/ClanBannerDictionary/`);
50
+ }
51
+ export function getItem(http, params) {
52
+ const strParams = {};
53
+ if (params.components?.length) {
54
+ strParams.components = params.components.join(',');
55
+ }
56
+ return get(
57
+ http,
58
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Item/${params.itemInstanceId}/`,
59
+ strParams
60
+ );
61
+ }
62
+ export function getVendors(http, params) {
63
+ const strParams = {};
64
+ if (params.components?.length) {
65
+ strParams.components = params.components.join(',');
66
+ }
67
+ if (params.filter !== undefined) {
68
+ strParams.filter = params.filter.toString();
69
+ }
70
+ return get(
71
+ http,
72
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Vendors/`,
73
+ strParams
74
+ );
75
+ }
76
+ export function getVendor(http, params) {
77
+ const strParams = {};
78
+ if (params.components?.length) {
79
+ strParams.components = params.components.join(',');
80
+ }
81
+ return get(
82
+ http,
83
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Vendors/${params.vendorHash}/`,
84
+ strParams
85
+ );
86
+ }
87
+ export function getPublicVendors(http, params) {
88
+ const strParams = {};
89
+ if (params.components?.length) {
90
+ strParams.components = params.components.join(',');
91
+ }
92
+ return get(http, `${API_BASE}Vendors/`, strParams);
93
+ }
94
+ export function getCollectibleNodeDetails(http, params) {
95
+ const strParams = {};
96
+ if (params.components?.length) {
97
+ strParams.components = params.components.join(',');
98
+ }
99
+ return get(
100
+ http,
101
+ `${API_BASE}${params.membershipType}/Profile/${params.destinyMembershipId}/Character/${params.characterId}/Collectibles/${params.collectiblePresentationNodeHash}/`,
102
+ strParams
103
+ );
104
+ }
105
+ export function transferItem(http, body) {
106
+ return post(http, `${API_BASE}Actions/Items/TransferItem/`, body);
107
+ }
108
+ export function pullFromPostmaster(http, body) {
109
+ return post(http, `${API_BASE}Actions/Items/PullFromPostmaster/`, body);
110
+ }
111
+ export function equipItem(http, body) {
112
+ return post(http, `${API_BASE}Actions/Items/EquipItem/`, body);
113
+ }
114
+ export function equipItems(http, body) {
115
+ return post(http, `${API_BASE}Actions/Items/EquipItems/`, body);
116
+ }
117
+ export function equipLoadout(http, body) {
118
+ return post(http, `${API_BASE}Actions/Loadouts/EquipLoadout/`, body);
119
+ }
120
+ export function snapshotLoadout(http, body) {
121
+ return post(http, `${API_BASE}Actions/Loadouts/SnapshotLoadout/`, body);
122
+ }
123
+ export function updateLoadoutIdentifiers(http, body) {
124
+ return post(http, `${API_BASE}Actions/Loadouts/UpdateLoadoutIdentifiers/`, body);
125
+ }
126
+ export function clearLoadout(http, body) {
127
+ return post(http, `${API_BASE}Actions/Loadouts/ClearLoadout/`, body);
128
+ }
129
+ export function setItemLockState(http, body) {
130
+ return post(http, `${API_BASE}Actions/Items/SetLockState/`, body);
131
+ }
132
+ export function setQuestTrackedState(http, body) {
133
+ return post(http, `${API_BASE}Actions/Items/SetTrackedState/`, body);
134
+ }
135
+ export function insertSocketPlug(http, body) {
136
+ return post(http, `${API_BASE}Actions/Items/InsertSocketPlug/`, body);
137
+ }
138
+ export function insertSocketPlugFree(http, body) {
139
+ return post(http, `${API_BASE}Actions/Items/InsertSocketPlugFree/`, body);
140
+ }
141
+ export function getPostGameCarnageReport(http, params) {
142
+ return get(
143
+ http,
144
+ `https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/${params.activityId}/`
145
+ );
146
+ }
147
+ export function reportOffensivePostGameCarnageReportPlayer(http, params, body) {
148
+ return post(
149
+ http,
150
+ `https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/${params.activityId}/Report/`,
151
+ body
152
+ );
153
+ }
154
+ export function getHistoricalStatsDefinition(http) {
155
+ return get(http, `${API_BASE}Stats/Definition/`);
156
+ }
157
+ export function getClanLeaderboards(http, params) {
158
+ const strParams = {};
159
+ if (params.maxtop !== undefined) {
160
+ strParams.maxtop = params.maxtop.toString();
161
+ }
162
+ if (params.modes !== undefined) {
163
+ strParams.modes = params.modes;
164
+ }
165
+ if (params.statid !== undefined) {
166
+ strParams.statid = params.statid;
167
+ }
168
+ return get(http, `${API_BASE}Stats/Leaderboards/Clans/${params.groupId}/`, strParams);
169
+ }
170
+ export function getClanAggregateStats(http, params) {
171
+ const strParams = {};
172
+ if (params.modes !== undefined) {
173
+ strParams.modes = params.modes;
174
+ }
175
+ return get(http, `${API_BASE}Stats/AggregateClanStats/${params.groupId}/`, strParams);
176
+ }
177
+ export function getLeaderboards(http, params) {
178
+ const strParams = {};
179
+ if (params.maxtop !== undefined) {
180
+ strParams.maxtop = params.maxtop.toString();
181
+ }
182
+ if (params.modes !== undefined) {
183
+ strParams.modes = params.modes;
184
+ }
185
+ if (params.statid !== undefined) {
186
+ strParams.statid = params.statid;
187
+ }
188
+ return get(
189
+ http,
190
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Stats/Leaderboards/`,
191
+ strParams
192
+ );
193
+ }
194
+ export function getLeaderboardsForCharacter(http, params) {
195
+ const strParams = {};
196
+ if (params.maxtop !== undefined) {
197
+ strParams.maxtop = params.maxtop.toString();
198
+ }
199
+ if (params.modes !== undefined) {
200
+ strParams.modes = params.modes;
201
+ }
202
+ if (params.statid !== undefined) {
203
+ strParams.statid = params.statid;
204
+ }
205
+ return get(
206
+ http,
207
+ `${API_BASE}Stats/Leaderboards/${params.membershipType}/${params.destinyMembershipId}/${params.characterId}/`,
208
+ strParams
209
+ );
210
+ }
211
+ export function searchDestinyEntities(http, params) {
212
+ const strParams = {};
213
+ if (params.page !== undefined) {
214
+ strParams.page = params.page.toString();
215
+ }
216
+ return get(http, `${API_BASE}Armory/Search/${params.type}/${params.searchTerm}/`, strParams);
217
+ }
218
+ export function getHistoricalStats(http, params) {
219
+ const strParams = {};
220
+ if (params.dayend !== undefined) {
221
+ strParams.dayend = params.dayend;
222
+ }
223
+ if (params.daystart !== undefined) {
224
+ strParams.daystart = params.daystart;
225
+ }
226
+ if (params.groups?.length) {
227
+ strParams.groups = params.groups.join(',');
228
+ }
229
+ if (params.modes?.length) {
230
+ strParams.modes = params.modes.join(',');
231
+ }
232
+ if (params.periodType !== undefined) {
233
+ strParams.periodType = params.periodType.toString();
234
+ }
235
+ return get(
236
+ http,
237
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/`,
238
+ strParams
239
+ );
240
+ }
241
+ export function getHistoricalStatsForAccount(http, params) {
242
+ const strParams = {};
243
+ if (params.groups?.length) {
244
+ strParams.groups = params.groups.join(',');
245
+ }
246
+ return get(
247
+ http,
248
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Stats/`,
249
+ strParams
250
+ );
251
+ }
252
+ export function getActivityHistory(http, params) {
253
+ const strParams = {};
254
+ if (params.count !== undefined) {
255
+ strParams.count = params.count.toString();
256
+ }
257
+ if (params.mode !== undefined) {
258
+ strParams.mode = params.mode.toString();
259
+ }
260
+ if (params.page !== undefined) {
261
+ strParams.page = params.page.toString();
262
+ }
263
+ return get(
264
+ http,
265
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/Activities/`,
266
+ strParams
267
+ );
268
+ }
269
+ export function getUniqueWeaponHistory(http, params) {
270
+ return get(
271
+ http,
272
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/UniqueWeapons/`
273
+ );
274
+ }
275
+ export function getDestinyAggregateActivityStats(http, params) {
276
+ return get(
277
+ http,
278
+ `${API_BASE}${params.membershipType}/Account/${params.destinyMembershipId}/Character/${params.characterId}/Stats/AggregateActivityStats/`
279
+ );
280
+ }
281
+ export function getPublicMilestoneContent(http, params) {
282
+ return get(http, `${API_BASE}Milestones/${params.milestoneHash}/Content/`);
283
+ }
284
+ export function getPublicMilestones(http) {
285
+ return get(http, `${API_BASE}Milestones/`);
286
+ }
287
+ export function awaInitializeRequest(http, body) {
288
+ return post(http, `${API_BASE}Awa/Initialize/`, body);
289
+ }
290
+ export function awaProvideAuthorizationResult(http, body) {
291
+ return post(http, `${API_BASE}Awa/AwaProvideAuthorizationResult/`, body);
292
+ }
293
+ export function awaGetActionToken(http, params) {
294
+ return get(http, `${API_BASE}Awa/GetActionToken/${params.correlationId}/`);
295
+ }
@@ -0,0 +1,16 @@
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
+ export * from '../common.js';
13
+ export type { HttpClientConfig, HttpClient } from '../http.js';
14
+ export * from './api.js';
15
+ export * from './interfaces.js';
16
+ export * from './manifest.js';
@@ -0,0 +1,5 @@
1
+ export * from '../common.js';
2
+ export * from './api.js';
3
+ export * from './interfaces.js';
4
+ export * from './manifest.js';
5
+ export {};