@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.
- package/.babelrc +4 -0
- package/.gitattributes +2 -0
- package/.github/workflows/pr-build.yml +50 -0
- package/.github/workflows/publish.yml +48 -0
- package/.github/workflows/update.yml +55 -0
- package/.gitmodules +3 -0
- package/.nvmrc +1 -0
- package/.prettierrc +10 -0
- package/.vscode/extensions.json +8 -0
- package/.vscode/settings.json +7 -0
- package/LICENSE.md +21 -0
- package/README.md +97 -0
- package/api-src/.github/workflows/close-inactive.yml +24 -0
- package/api-src/CHANGELOG.md +271 -0
- package/api-src/CONTRIBUTING.md +19 -0
- package/api-src/LICENSE +28 -0
- package/api-src/README.md +378 -0
- package/api-src/openapi-2.json +44518 -0
- package/api-src/openapi.json +46467 -0
- package/build.sh +30 -0
- package/bungie-api-LICENSE +29 -0
- package/generated-src/app/api.ts +50 -0
- package/generated-src/app/index.ts +17 -0
- package/generated-src/app/interfaces.ts +119 -0
- package/generated-src/common.ts +985 -0
- package/generated-src/communitycontent/api.ts +36 -0
- package/generated-src/communitycontent/index.ts +16 -0
- package/generated-src/content/api.ts +142 -0
- package/generated-src/content/index.ts +17 -0
- package/generated-src/content/interfaces.ts +225 -0
- package/generated-src/core/api.ts +57 -0
- package/generated-src/core/index.ts +17 -0
- package/generated-src/core/interfaces.ts +151 -0
- package/generated-src/destiny2/api.ts +821 -0
- package/generated-src/destiny2/index.ts +17 -0
- package/generated-src/destiny2/interfaces.ts +15714 -0
- package/generated-src/destiny2/manifest.ts +341 -0
- package/generated-src/fireteam/api.ts +151 -0
- package/generated-src/fireteam/index.ts +17 -0
- package/generated-src/fireteam/interfaces.ts +183 -0
- package/generated-src/forum/api.ts +197 -0
- package/generated-src/forum/index.ts +17 -0
- package/generated-src/forum/interfaces.ts +171 -0
- package/generated-src/groupv2/api.ts +515 -0
- package/generated-src/groupv2/index.ts +17 -0
- package/generated-src/groupv2/interfaces.ts +773 -0
- package/generated-src/http.ts +52 -0
- package/generated-src/index.ts +37 -0
- package/generated-src/package.json.notyet +99 -0
- package/generated-src/platform.ts +39 -0
- package/generated-src/social/api.ts +115 -0
- package/generated-src/social/index.ts +17 -0
- package/generated-src/social/interfaces.ts +89 -0
- package/generated-src/tokens/api.ts +126 -0
- package/generated-src/tokens/index.ts +17 -0
- package/generated-src/tokens/interfaces.ts +102 -0
- package/generated-src/trending/api.ts +62 -0
- package/generated-src/trending/index.ts +17 -0
- package/generated-src/trending/interfaces.ts +188 -0
- package/generated-src/user/api.ts +130 -0
- package/generated-src/user/index.ts +17 -0
- package/generated-src/user/interfaces.ts +338 -0
- package/generator/generate-api.ts +254 -0
- package/generator/generate-common.ts +123 -0
- package/generator/generate-index.ts +45 -0
- package/generator/generate-interfaces.ts +173 -0
- package/generator/generate-manifest.ts +217 -0
- package/generator/generate-package-json.ts +45 -0
- package/generator/generate.ts +54 -0
- package/generator/http.ts +52 -0
- package/generator/missing-props.ts +11 -0
- package/generator/type-index.ts +184 -0
- package/generator/util.ts +131 -0
- package/lib/README.md +97 -0
- package/lib/app/api.d.ts +36 -0
- package/lib/app/api.js +15 -0
- package/lib/app/index.d.ts +16 -0
- package/lib/app/index.js +5 -0
- package/lib/app/interfaces.d.ts +108 -0
- package/lib/app/interfaces.js +17 -0
- package/lib/bungie-api-LICENSE +29 -0
- package/lib/common.d.ts +979 -0
- package/lib/common.js +923 -0
- package/lib/communitycontent/api.d.ts +31 -0
- package/lib/communitycontent/api.js +7 -0
- package/lib/communitycontent/index.d.ts +15 -0
- package/lib/communitycontent/index.js +4 -0
- package/lib/content/api.d.ts +111 -0
- package/lib/content/api.js +75 -0
- package/lib/content/index.d.ts +16 -0
- package/lib/content/index.js +5 -0
- package/lib/content/interfaces.d.ts +214 -0
- package/lib/content/interfaces.js +17 -0
- package/lib/core/api.d.ts +45 -0
- package/lib/core/api.js +18 -0
- package/lib/core/index.d.ts +16 -0
- package/lib/core/index.js +5 -0
- package/lib/core/interfaces.d.ts +144 -0
- package/lib/core/interfaces.js +10 -0
- package/lib/destiny2/api.d.ts +765 -0
- package/lib/destiny2/api.js +295 -0
- package/lib/destiny2/index.d.ts +16 -0
- package/lib/destiny2/index.js +5 -0
- package/lib/destiny2/interfaces.d.ts +15340 -0
- package/lib/destiny2/interfaces.js +826 -0
- package/lib/destiny2/manifest.d.ts +465 -0
- package/lib/destiny2/manifest.js +56 -0
- package/lib/fireteam/api.d.ts +131 -0
- package/lib/fireteam/api.js +50 -0
- package/lib/fireteam/index.d.ts +16 -0
- package/lib/fireteam/index.js +5 -0
- package/lib/fireteam/interfaces.d.ts +166 -0
- package/lib/fireteam/interfaces.js +33 -0
- package/lib/forum/api.d.ts +165 -0
- package/lib/forum/api.js +79 -0
- package/lib/forum/index.d.ts +16 -0
- package/lib/forum/index.js +5 -0
- package/lib/forum/interfaces.d.ts +147 -0
- package/lib/forum/interfaces.js +61 -0
- package/lib/groupv2/api.d.ts +484 -0
- package/lib/groupv2/api.js +154 -0
- package/lib/groupv2/index.d.ts +16 -0
- package/lib/groupv2/index.js +5 -0
- package/lib/groupv2/interfaces.d.ts +718 -0
- package/lib/groupv2/interfaces.js +100 -0
- package/lib/http.d.ts +18 -0
- package/lib/http.js +20 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +24 -0
- package/lib/package.json +99 -0
- package/lib/platform.d.ts +36 -0
- package/lib/platform.js +9 -0
- package/lib/social/api.d.ts +101 -0
- package/lib/social/api.js +26 -0
- package/lib/social/index.d.ts +16 -0
- package/lib/social/index.js +5 -0
- package/lib/social/interfaces.d.ts +75 -0
- package/lib/social/interfaces.js +22 -0
- package/lib/tokens/api.d.ts +120 -0
- package/lib/tokens/api.js +38 -0
- package/lib/tokens/index.d.ts +16 -0
- package/lib/tokens/index.js +5 -0
- package/lib/tokens/interfaces.d.ts +88 -0
- package/lib/tokens/interfaces.js +5 -0
- package/lib/trending/api.d.ts +53 -0
- package/lib/trending/api.js +11 -0
- package/lib/trending/index.d.ts +16 -0
- package/lib/trending/index.js +5 -0
- package/lib/trending/interfaces.d.ts +171 -0
- package/lib/trending/interfaces.js +14 -0
- package/lib/user/api.d.ts +117 -0
- package/lib/user/api.js +35 -0
- package/lib/user/index.d.ts +16 -0
- package/lib/user/index.js +5 -0
- package/lib/user/interfaces.d.ts +320 -0
- package/lib/user/interfaces.js +28 -0
- package/package.json +60 -0
- package/test-consumer.ts +5 -0
- package/tests/__snapshots__/config-builders.test.ts.snap +343 -0
- package/tests/config-builders.test.ts +145 -0
- package/tests/manifest-fetcher.test.ts +43 -0
- package/tests/test-manifest.js +69 -0
- package/tsconfig-package.json +14 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`check config builder for [Function awaGetActionToken] 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"method": "GET",
|
|
6
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Awa/GetActionToken/456734563673/",
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
exports[`check config builder for [Function awaInitializeRequest] 1`] = `
|
|
11
|
+
{
|
|
12
|
+
"body": {},
|
|
13
|
+
"method": "POST",
|
|
14
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Awa/Initialize/",
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
exports[`check config builder for [Function awaProvideAuthorizationResult] 1`] = `
|
|
19
|
+
{
|
|
20
|
+
"body": {},
|
|
21
|
+
"method": "POST",
|
|
22
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Awa/AwaProvideAuthorizationResult/",
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
exports[`check config builder for [Function equipItem] 1`] = `
|
|
27
|
+
{
|
|
28
|
+
"body": {},
|
|
29
|
+
"method": "POST",
|
|
30
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/EquipItem/",
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`check config builder for [Function equipItems] 1`] = `
|
|
35
|
+
{
|
|
36
|
+
"body": {},
|
|
37
|
+
"method": "POST",
|
|
38
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/EquipItems/",
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
exports[`check config builder for [Function getActivityHistory] 1`] = `
|
|
43
|
+
{
|
|
44
|
+
"method": "GET",
|
|
45
|
+
"params": {
|
|
46
|
+
"count": "10",
|
|
47
|
+
"mode": "5",
|
|
48
|
+
"page": "2",
|
|
49
|
+
},
|
|
50
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Character/1234658790/Stats/Activities/",
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
exports[`check config builder for [Function getCharacter] 1`] = `
|
|
55
|
+
{
|
|
56
|
+
"method": "GET",
|
|
57
|
+
"params": {
|
|
58
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
59
|
+
},
|
|
60
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/Character/1234658790/",
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
exports[`check config builder for [Function getClanAggregateStats] 1`] = `
|
|
65
|
+
{
|
|
66
|
+
"method": "GET",
|
|
67
|
+
"params": {
|
|
68
|
+
"modes": [
|
|
69
|
+
5,
|
|
70
|
+
7,
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Stats/AggregateClanStats/78346592834756/",
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
exports[`check config builder for [Function getClanLeaderboards] 1`] = `
|
|
78
|
+
{
|
|
79
|
+
"method": "GET",
|
|
80
|
+
"params": {
|
|
81
|
+
"maxtop": "6",
|
|
82
|
+
"modes": [
|
|
83
|
+
5,
|
|
84
|
+
7,
|
|
85
|
+
],
|
|
86
|
+
"statid": "234624564",
|
|
87
|
+
},
|
|
88
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Stats/Leaderboards/Clans/78346592834756/",
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
exports[`check config builder for [Function getClanWeeklyRewardState] 1`] = `
|
|
93
|
+
{
|
|
94
|
+
"method": "GET",
|
|
95
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Clan/78346592834756/WeeklyRewardState/",
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
exports[`check config builder for [Function getCollectibleNodeDetails] 1`] = `
|
|
100
|
+
{
|
|
101
|
+
"method": "GET",
|
|
102
|
+
"params": {
|
|
103
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
104
|
+
},
|
|
105
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/Character/1234658790/Collectibles/10293847/",
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
exports[`check config builder for [Function getDestinyAggregateActivityStats] 1`] = `
|
|
110
|
+
{
|
|
111
|
+
"method": "GET",
|
|
112
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Character/1234658790/Stats/AggregateActivityStats/",
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
|
|
116
|
+
exports[`check config builder for [Function getDestinyEntityDefinition] 1`] = `
|
|
117
|
+
{
|
|
118
|
+
"method": "GET",
|
|
119
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Manifest/DestinyInventoryItemDefinition/23463456/",
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
exports[`check config builder for [Function getDestinyManifest] 1`] = `
|
|
124
|
+
{
|
|
125
|
+
"method": "GET",
|
|
126
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Manifest/",
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
exports[`check config builder for [Function getHistoricalStats] 1`] = `
|
|
131
|
+
{
|
|
132
|
+
"method": "GET",
|
|
133
|
+
"params": {
|
|
134
|
+
"dayend": "YYYY-MM-DD",
|
|
135
|
+
"daystart": "YYYY-MM-DD",
|
|
136
|
+
"groups": "General,Weapons",
|
|
137
|
+
"modes": "5,7",
|
|
138
|
+
"periodType": "AllTime",
|
|
139
|
+
},
|
|
140
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Character/1234658790/Stats/",
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
exports[`check config builder for [Function getHistoricalStatsDefinition] 1`] = `
|
|
145
|
+
{
|
|
146
|
+
"method": "GET",
|
|
147
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Stats/Definition/",
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
exports[`check config builder for [Function getHistoricalStatsForAccount] 1`] = `
|
|
152
|
+
{
|
|
153
|
+
"method": "GET",
|
|
154
|
+
"params": {
|
|
155
|
+
"groups": "General,Weapons",
|
|
156
|
+
},
|
|
157
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Stats/",
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
exports[`check config builder for [Function getItem] 1`] = `
|
|
162
|
+
{
|
|
163
|
+
"method": "GET",
|
|
164
|
+
"params": {
|
|
165
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
166
|
+
},
|
|
167
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/Item/0987654321/",
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
|
|
171
|
+
exports[`check config builder for [Function getLeaderboards] 1`] = `
|
|
172
|
+
{
|
|
173
|
+
"method": "GET",
|
|
174
|
+
"params": {
|
|
175
|
+
"maxtop": "6",
|
|
176
|
+
"modes": [
|
|
177
|
+
5,
|
|
178
|
+
7,
|
|
179
|
+
],
|
|
180
|
+
"statid": "234624564",
|
|
181
|
+
},
|
|
182
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Stats/Leaderboards/",
|
|
183
|
+
}
|
|
184
|
+
`;
|
|
185
|
+
|
|
186
|
+
exports[`check config builder for [Function getLeaderboardsForCharacter] 1`] = `
|
|
187
|
+
{
|
|
188
|
+
"method": "GET",
|
|
189
|
+
"params": {
|
|
190
|
+
"maxtop": "6",
|
|
191
|
+
"modes": [
|
|
192
|
+
5,
|
|
193
|
+
7,
|
|
194
|
+
],
|
|
195
|
+
"statid": "234624564",
|
|
196
|
+
},
|
|
197
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Stats/Leaderboards/3/123456/1234658790/",
|
|
198
|
+
}
|
|
199
|
+
`;
|
|
200
|
+
|
|
201
|
+
exports[`check config builder for [Function getLinkedProfiles] 1`] = `
|
|
202
|
+
{
|
|
203
|
+
"method": "GET",
|
|
204
|
+
"params": {
|
|
205
|
+
"getAllMemberships": "true",
|
|
206
|
+
},
|
|
207
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/LinkedProfiles/",
|
|
208
|
+
}
|
|
209
|
+
`;
|
|
210
|
+
|
|
211
|
+
exports[`check config builder for [Function getPostGameCarnageReport] 1`] = `
|
|
212
|
+
{
|
|
213
|
+
"method": "GET",
|
|
214
|
+
"url": "https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/456745673456/",
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
|
|
218
|
+
exports[`check config builder for [Function getProfile] 1`] = `
|
|
219
|
+
{
|
|
220
|
+
"method": "GET",
|
|
221
|
+
"params": {
|
|
222
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
223
|
+
},
|
|
224
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/",
|
|
225
|
+
}
|
|
226
|
+
`;
|
|
227
|
+
|
|
228
|
+
exports[`check config builder for [Function getPublicMilestoneContent] 1`] = `
|
|
229
|
+
{
|
|
230
|
+
"method": "GET",
|
|
231
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Milestones/23546789/Content/",
|
|
232
|
+
}
|
|
233
|
+
`;
|
|
234
|
+
|
|
235
|
+
exports[`check config builder for [Function getPublicMilestones] 1`] = `
|
|
236
|
+
{
|
|
237
|
+
"method": "GET",
|
|
238
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Milestones/",
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
|
|
242
|
+
exports[`check config builder for [Function getPublicVendors] 1`] = `
|
|
243
|
+
{
|
|
244
|
+
"method": "GET",
|
|
245
|
+
"params": {
|
|
246
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
247
|
+
},
|
|
248
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Vendors/",
|
|
249
|
+
}
|
|
250
|
+
`;
|
|
251
|
+
|
|
252
|
+
exports[`check config builder for [Function getUniqueWeaponHistory] 1`] = `
|
|
253
|
+
{
|
|
254
|
+
"method": "GET",
|
|
255
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Account/123456/Character/1234658790/Stats/UniqueWeapons/",
|
|
256
|
+
}
|
|
257
|
+
`;
|
|
258
|
+
|
|
259
|
+
exports[`check config builder for [Function getVendor] 1`] = `
|
|
260
|
+
{
|
|
261
|
+
"method": "GET",
|
|
262
|
+
"params": {
|
|
263
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
264
|
+
},
|
|
265
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/Character/1234658790/Vendors/45674576/",
|
|
266
|
+
}
|
|
267
|
+
`;
|
|
268
|
+
|
|
269
|
+
exports[`check config builder for [Function getVendors] 1`] = `
|
|
270
|
+
{
|
|
271
|
+
"method": "GET",
|
|
272
|
+
"params": {
|
|
273
|
+
"components": "400,402,300,301,304,305,306,307,600,308,310,309",
|
|
274
|
+
"filter": "0",
|
|
275
|
+
},
|
|
276
|
+
"url": "https://www.bungie.net/Platform/Destiny2/3/Profile/123456/Character/1234658790/Vendors/",
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
exports[`check config builder for [Function insertSocketPlug] 1`] = `
|
|
281
|
+
{
|
|
282
|
+
"body": {},
|
|
283
|
+
"method": "POST",
|
|
284
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/InsertSocketPlug/",
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
287
|
+
|
|
288
|
+
exports[`check config builder for [Function pullFromPostmaster] 1`] = `
|
|
289
|
+
{
|
|
290
|
+
"body": {},
|
|
291
|
+
"method": "POST",
|
|
292
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/PullFromPostmaster/",
|
|
293
|
+
}
|
|
294
|
+
`;
|
|
295
|
+
|
|
296
|
+
exports[`check config builder for [Function reportOffensivePostGameCarnageReportPlayer] 1`] = `
|
|
297
|
+
{
|
|
298
|
+
"body": {},
|
|
299
|
+
"method": "POST",
|
|
300
|
+
"url": "https://stats.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/456745673456/Report/",
|
|
301
|
+
}
|
|
302
|
+
`;
|
|
303
|
+
|
|
304
|
+
exports[`check config builder for [Function searchDestinyEntities] 1`] = `
|
|
305
|
+
{
|
|
306
|
+
"method": "GET",
|
|
307
|
+
"params": {
|
|
308
|
+
"page": "2",
|
|
309
|
+
},
|
|
310
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Armory/Search/DestinyInventoryItemDefinition/something/",
|
|
311
|
+
}
|
|
312
|
+
`;
|
|
313
|
+
|
|
314
|
+
exports[`check config builder for [Function searchDestinyPlayerByBungieName] 1`] = `
|
|
315
|
+
{
|
|
316
|
+
"method": "POST",
|
|
317
|
+
"url": "https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayerByBungieName/3/",
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
320
|
+
|
|
321
|
+
exports[`check config builder for [Function setItemLockState] 1`] = `
|
|
322
|
+
{
|
|
323
|
+
"body": {},
|
|
324
|
+
"method": "POST",
|
|
325
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/SetLockState/",
|
|
326
|
+
}
|
|
327
|
+
`;
|
|
328
|
+
|
|
329
|
+
exports[`check config builder for [Function setQuestTrackedState] 1`] = `
|
|
330
|
+
{
|
|
331
|
+
"body": {},
|
|
332
|
+
"method": "POST",
|
|
333
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/SetTrackedState/",
|
|
334
|
+
}
|
|
335
|
+
`;
|
|
336
|
+
|
|
337
|
+
exports[`check config builder for [Function transferItem] 1`] = `
|
|
338
|
+
{
|
|
339
|
+
"body": {},
|
|
340
|
+
"method": "POST",
|
|
341
|
+
"url": "https://www.bungie.net/Platform/Destiny2/Actions/Items/TransferItem/",
|
|
342
|
+
}
|
|
343
|
+
`;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getDestinyManifest,
|
|
3
|
+
getDestinyEntityDefinition,
|
|
4
|
+
getLinkedProfiles,
|
|
5
|
+
getProfile,
|
|
6
|
+
getCharacter,
|
|
7
|
+
getClanWeeklyRewardState,
|
|
8
|
+
getItem,
|
|
9
|
+
getVendors,
|
|
10
|
+
getVendor,
|
|
11
|
+
getPublicVendors,
|
|
12
|
+
getCollectibleNodeDetails,
|
|
13
|
+
transferItem,
|
|
14
|
+
pullFromPostmaster,
|
|
15
|
+
equipItem,
|
|
16
|
+
equipItems,
|
|
17
|
+
setItemLockState,
|
|
18
|
+
setQuestTrackedState,
|
|
19
|
+
insertSocketPlug,
|
|
20
|
+
getPostGameCarnageReport,
|
|
21
|
+
reportOffensivePostGameCarnageReportPlayer,
|
|
22
|
+
getHistoricalStatsDefinition,
|
|
23
|
+
getClanLeaderboards,
|
|
24
|
+
getClanAggregateStats,
|
|
25
|
+
getLeaderboards,
|
|
26
|
+
getLeaderboardsForCharacter,
|
|
27
|
+
searchDestinyEntities,
|
|
28
|
+
getHistoricalStats,
|
|
29
|
+
getHistoricalStatsForAccount,
|
|
30
|
+
getActivityHistory,
|
|
31
|
+
getUniqueWeaponHistory,
|
|
32
|
+
getDestinyAggregateActivityStats,
|
|
33
|
+
getPublicMilestoneContent,
|
|
34
|
+
getPublicMilestones,
|
|
35
|
+
awaInitializeRequest,
|
|
36
|
+
awaProvideAuthorizationResult,
|
|
37
|
+
awaGetActionToken,
|
|
38
|
+
searchDestinyPlayerByBungieName,
|
|
39
|
+
} from '../generated-src/destiny2/api';
|
|
40
|
+
import { HttpClient } from '../generated-src/http';
|
|
41
|
+
import { DestinyComponentType } from '../generated-src/destiny2/interfaces';
|
|
42
|
+
|
|
43
|
+
// instead of actually performing a fetch,
|
|
44
|
+
// this fake HttpClient returns the HttpConfig it would have used to make the fetch
|
|
45
|
+
// so we can check of the HttpConfig was built right
|
|
46
|
+
const h = ((httpConfig?: any) => Promise.resolve(httpConfig)) as HttpClient;
|
|
47
|
+
|
|
48
|
+
// sample values for the "body" argument
|
|
49
|
+
const b = {} as any;
|
|
50
|
+
|
|
51
|
+
// sample values for parameters
|
|
52
|
+
const p = {
|
|
53
|
+
characterId: '1234658790',
|
|
54
|
+
components: [
|
|
55
|
+
DestinyComponentType.Vendors,
|
|
56
|
+
DestinyComponentType.VendorSales,
|
|
57
|
+
DestinyComponentType.ItemInstances,
|
|
58
|
+
DestinyComponentType.ItemObjectives,
|
|
59
|
+
DestinyComponentType.ItemStats,
|
|
60
|
+
DestinyComponentType.ItemSockets,
|
|
61
|
+
DestinyComponentType.ItemTalentGrids,
|
|
62
|
+
DestinyComponentType.ItemCommonData,
|
|
63
|
+
DestinyComponentType.CurrencyLookups,
|
|
64
|
+
DestinyComponentType.ItemPlugStates,
|
|
65
|
+
DestinyComponentType.ItemReusablePlugs,
|
|
66
|
+
DestinyComponentType.ItemPlugObjectives,
|
|
67
|
+
],
|
|
68
|
+
destinyMembershipId: '123456',
|
|
69
|
+
getAllMemberships: true,
|
|
70
|
+
itemId: '0987654321',
|
|
71
|
+
itemInstanceId: '0987654321',
|
|
72
|
+
itemReferenceHash: 45674576,
|
|
73
|
+
membershipId: '123456',
|
|
74
|
+
membershipType: 3,
|
|
75
|
+
stackSize: 7,
|
|
76
|
+
transferToVault: true,
|
|
77
|
+
vendorHash: 45674576,
|
|
78
|
+
state: true,
|
|
79
|
+
groupId: '78346592834756',
|
|
80
|
+
correlationId: '456734563673',
|
|
81
|
+
count: 10,
|
|
82
|
+
mode: 5,
|
|
83
|
+
modes: [5, 7],
|
|
84
|
+
page: 2,
|
|
85
|
+
maxtop: 6,
|
|
86
|
+
statid: '234624564',
|
|
87
|
+
returnOriginalProfile: true,
|
|
88
|
+
displayName: 'asdf',
|
|
89
|
+
entityType: 'DestinyInventoryItemDefinition',
|
|
90
|
+
hashIdentifier: 23463456,
|
|
91
|
+
dayend: 'YYYY-MM-DD',
|
|
92
|
+
daystart: 'YYYY-MM-DD',
|
|
93
|
+
groups: ['General', 'Weapons'],
|
|
94
|
+
periodType: 'AllTime',
|
|
95
|
+
milestoneHash: 23546789,
|
|
96
|
+
collectiblePresentationNodeHash: 10293847,
|
|
97
|
+
activityId: '456745673456',
|
|
98
|
+
filter: 0,
|
|
99
|
+
type: 'DestinyInventoryItemDefinition',
|
|
100
|
+
searchTerm: 'something',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const testCases: [(..._: any) => any, any[]][] = [
|
|
104
|
+
[getDestinyManifest, [h]],
|
|
105
|
+
[getDestinyEntityDefinition, [h, p]],
|
|
106
|
+
[searchDestinyPlayerByBungieName, [h, p]],
|
|
107
|
+
[getLinkedProfiles, [h, p]],
|
|
108
|
+
[getProfile, [h, p]],
|
|
109
|
+
[getCharacter, [h, p]],
|
|
110
|
+
[getClanWeeklyRewardState, [h, p]],
|
|
111
|
+
[getItem, [h, p]],
|
|
112
|
+
[getVendors, [h, p]],
|
|
113
|
+
[getVendor, [h, p]],
|
|
114
|
+
[getPublicVendors, [h, p]],
|
|
115
|
+
[getCollectibleNodeDetails, [h, p]],
|
|
116
|
+
[transferItem, [h, b]],
|
|
117
|
+
[pullFromPostmaster, [h, b]],
|
|
118
|
+
[equipItem, [h, b]],
|
|
119
|
+
[equipItems, [h, b]],
|
|
120
|
+
[setItemLockState, [h, b]],
|
|
121
|
+
[setQuestTrackedState, [h, b]],
|
|
122
|
+
[insertSocketPlug, [h, b]],
|
|
123
|
+
[getPostGameCarnageReport, [h, p]],
|
|
124
|
+
[reportOffensivePostGameCarnageReportPlayer, [h, p, b]],
|
|
125
|
+
[getHistoricalStatsDefinition, [h]],
|
|
126
|
+
[getClanLeaderboards, [h, p]],
|
|
127
|
+
[getClanAggregateStats, [h, p]],
|
|
128
|
+
[getLeaderboards, [h, p]],
|
|
129
|
+
[getLeaderboardsForCharacter, [h, p]],
|
|
130
|
+
[searchDestinyEntities, [h, p]],
|
|
131
|
+
[getHistoricalStats, [h, p]],
|
|
132
|
+
[getHistoricalStatsForAccount, [h, p]],
|
|
133
|
+
[getActivityHistory, [h, p]],
|
|
134
|
+
[getUniqueWeaponHistory, [h, p]],
|
|
135
|
+
[getDestinyAggregateActivityStats, [h, p]],
|
|
136
|
+
[getPublicMilestoneContent, [h, p]],
|
|
137
|
+
[getPublicMilestones, [h]],
|
|
138
|
+
[awaInitializeRequest, [h, b]],
|
|
139
|
+
[awaProvideAuthorizationResult, [h, b]],
|
|
140
|
+
[awaGetActionToken, [h, p]],
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
test.each(testCases)('check config builder for %p', async (func, args) => {
|
|
144
|
+
expect(await func(...args)).toMatchSnapshot();
|
|
145
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getDestinyManifest } from '../generated-src/destiny2/api';
|
|
2
|
+
import { getDestinyManifestSlice } from '../generated-src/destiny2/manifest';
|
|
3
|
+
import { HttpClientConfig } from '../generated-src/http';
|
|
4
|
+
|
|
5
|
+
async function httpClient(config: HttpClientConfig) {
|
|
6
|
+
return (fetch as any)(config.url, config)
|
|
7
|
+
.then((res: Response) => res.json())
|
|
8
|
+
.catch((e: any) => {
|
|
9
|
+
console.log('DESTINY API ERROR');
|
|
10
|
+
console.log('probably about to fail a promise here. sorry.');
|
|
11
|
+
console.log(console.log(e));
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
test('manifest downloads and getDestinyManifestSlice contains 2 tables', async () => {
|
|
16
|
+
const manifestMetadata = (await getDestinyManifest(httpClient)).Response;
|
|
17
|
+
|
|
18
|
+
const partialManifest = await getDestinyManifestSlice(httpClient, {
|
|
19
|
+
destinyManifest: manifestMetadata,
|
|
20
|
+
tableNames: ['DestinyInventoryItemDefinition', 'DestinyLocationDefinition'],
|
|
21
|
+
language: 'en',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(Object.keys(partialManifest)).toMatchInlineSnapshot(`
|
|
25
|
+
[
|
|
26
|
+
"DestinyInventoryItemDefinition",
|
|
27
|
+
"DestinyLocationDefinition",
|
|
28
|
+
]
|
|
29
|
+
`);
|
|
30
|
+
|
|
31
|
+
// const items = partialManifest.DestinyInventoryItemDefinition;
|
|
32
|
+
// const locations = partialManifest.DestinyLocationDefinition;
|
|
33
|
+
// maybe this is overkill
|
|
34
|
+
// expect(
|
|
35
|
+
// Object.values(items).filter((i) => (i as any).vendorHash || (i as any).locationReleases)
|
|
36
|
+
// ).toHaveLength(0);
|
|
37
|
+
|
|
38
|
+
// expect(
|
|
39
|
+
// Object.values(locations).filter(
|
|
40
|
+
// (l) => (l as any).itemTypeAndTierDisplayName || (l as any).damageTypeHashes
|
|
41
|
+
// )
|
|
42
|
+
// ).toHaveLength(0);
|
|
43
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { getDestinyManifest } from '../lib/destiny2/index.js';
|
|
2
|
+
import { getDestinyManifestSlice } from '../lib/destiny2/manifest.js';
|
|
3
|
+
async function httpClient(config) {
|
|
4
|
+
return fetch(config.url, config)
|
|
5
|
+
.then((res) => res.json())
|
|
6
|
+
.catch((e) => {
|
|
7
|
+
console.log('DESTINY API ERROR');
|
|
8
|
+
console.log('probably about to fail a promise here. sorry.');
|
|
9
|
+
console.log(console.log(e));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
(async () => {
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
14
|
+
const manifestMeta = (await getDestinyManifest(httpClient)).Response;
|
|
15
|
+
// const manifestTable = await getDestinyManifestComponent(httpClient, {
|
|
16
|
+
// destinyManifest: manifestMeta,
|
|
17
|
+
// tableName: 'DestinyInventoryItemDefinition',
|
|
18
|
+
// language: 'en',
|
|
19
|
+
// });
|
|
20
|
+
const partialManifest = await getDestinyManifestSlice(httpClient, {
|
|
21
|
+
destinyManifest: manifestMeta,
|
|
22
|
+
tableNames: ['DestinyInventoryItemDefinition', 'DestinyLocationDefinition'],
|
|
23
|
+
language: 'en',
|
|
24
|
+
});
|
|
25
|
+
const items = partialManifest.DestinyInventoryItemDefinition;
|
|
26
|
+
const locations = partialManifest.DestinyLocationDefinition;
|
|
27
|
+
// grab a gun we know
|
|
28
|
+
const betterDevils =
|
|
29
|
+
(_c =
|
|
30
|
+
(_b = (_a = items[1048266744]) !== null && _a !== void 0 ? _a : items[153979397]) !== null &&
|
|
31
|
+
_b !== void 0
|
|
32
|
+
? _b
|
|
33
|
+
: Object.values(items).find((i) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
return (
|
|
36
|
+
((_b = (_a = i.displayProperties) === null || _a === void 0 ? void 0 : _a.name) ===
|
|
37
|
+
null || _b === void 0
|
|
38
|
+
? void 0
|
|
39
|
+
: _b.toLowerCase()) === 'better devils'
|
|
40
|
+
);
|
|
41
|
+
})) !== null && _c !== void 0
|
|
42
|
+
? _c
|
|
43
|
+
: {};
|
|
44
|
+
// ensure it has attributes we expect and not attributes from another table
|
|
45
|
+
const betterDevilsTests =
|
|
46
|
+
betterDevils.itemTypeAndTierDisplayName !== undefined &&
|
|
47
|
+
betterDevils.inventory &&
|
|
48
|
+
betterDevils.damageTypeHashes &&
|
|
49
|
+
betterDevils.itemCategoryHashes &&
|
|
50
|
+
!betterDevils.vendorHash &&
|
|
51
|
+
!betterDevils.locationReleases;
|
|
52
|
+
const exampleLocation =
|
|
53
|
+
(_e =
|
|
54
|
+
(_d = locations[337241121]) !== null && _d !== void 0 ? _d : Object.values(locations)[0]) !==
|
|
55
|
+
null && _e !== void 0
|
|
56
|
+
? _e
|
|
57
|
+
: {};
|
|
58
|
+
const locationTests =
|
|
59
|
+
exampleLocation.vendorHash !== undefined &&
|
|
60
|
+
exampleLocation.hash !== undefined &&
|
|
61
|
+
exampleLocation.locationReleases &&
|
|
62
|
+
!exampleLocation.itemTypeAndTierDisplayName &&
|
|
63
|
+
!exampleLocation.damageTypeHashes;
|
|
64
|
+
if (!betterDevilsTests || !locationTests) {
|
|
65
|
+
!betterDevilsTests && console.log('betterDevilsTests failed. unexpected data:', betterDevils);
|
|
66
|
+
!locationTests && console.log('locationTests failed. unexpected data:', exampleLocation);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
} else console.log('tests passed'); // manifest downloader worked and expected attributes were present
|
|
69
|
+
})();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./lib/",
|
|
4
|
+
"sourceMap": false,
|
|
5
|
+
"strictNullChecks": true,
|
|
6
|
+
"module": "ES2015",
|
|
7
|
+
"target": "es5",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"emitDeclarationOnly": true,
|
|
11
|
+
"esModuleInterop": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["./generated-src/**/*"]
|
|
14
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": "./generator",
|
|
4
|
+
"outDir": "./build/",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"strictNullChecks": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"module": "NodeNext",
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"moduleResolution": "NodeNext",
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"preserveConstEnums": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["./generator/**/*"]
|
|
17
|
+
}
|