@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,52 @@
|
|
|
1
|
+
export type HttpQueryParams = Record<string, string>;
|
|
2
|
+
|
|
3
|
+
export interface HttpClientConfig {
|
|
4
|
+
method: 'GET' | 'POST';
|
|
5
|
+
url: string;
|
|
6
|
+
/** Query string params */
|
|
7
|
+
params?: HttpQueryParams;
|
|
8
|
+
/** Request body */
|
|
9
|
+
body?: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A generic, minimal type for providing an HTTP client function.
|
|
14
|
+
* This gets the necessary config provided as an argument, and then
|
|
15
|
+
* should produce a promise for the parsed JSON as a result. The API
|
|
16
|
+
* helper functions will use this to return the right type.
|
|
17
|
+
*/
|
|
18
|
+
export type HttpClient = <Return>(config: HttpClientConfig) => Promise<Return>;
|
|
19
|
+
|
|
20
|
+
export function get<Return>(
|
|
21
|
+
http: HttpClient,
|
|
22
|
+
url: string,
|
|
23
|
+
params?: HttpQueryParams
|
|
24
|
+
): Promise<Return> {
|
|
25
|
+
return http(
|
|
26
|
+
params
|
|
27
|
+
? {
|
|
28
|
+
method: 'GET',
|
|
29
|
+
url,
|
|
30
|
+
params,
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
url,
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function post<Return>(http: HttpClient, url: string, body?: any): Promise<Return> {
|
|
40
|
+
return http(
|
|
41
|
+
body
|
|
42
|
+
? {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
url,
|
|
45
|
+
body,
|
|
46
|
+
}
|
|
47
|
+
: {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
url,
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 * as AppImport from './app/index.js';
|
|
14
|
+
import * as UserImport from './user/index.js';
|
|
15
|
+
import * as ContentImport from './content/index.js';
|
|
16
|
+
import * as ForumImport from './forum/index.js';
|
|
17
|
+
import * as GroupV2Import from './groupv2/index.js';
|
|
18
|
+
import * as TokensImport from './tokens/index.js';
|
|
19
|
+
import * as Destiny2Import from './destiny2/index.js';
|
|
20
|
+
import * as CommunityContentImport from './communitycontent/index.js';
|
|
21
|
+
import * as TrendingImport from './trending/index.js';
|
|
22
|
+
import * as FireteamImport from './fireteam/index.js';
|
|
23
|
+
import * as SocialImport from './social/index.js';
|
|
24
|
+
import * as CoreImport from './core/index.js';
|
|
25
|
+
|
|
26
|
+
export const App = AppImport;
|
|
27
|
+
export const User = UserImport;
|
|
28
|
+
export const Content = ContentImport;
|
|
29
|
+
export const Forum = ForumImport;
|
|
30
|
+
export const GroupV2 = GroupV2Import;
|
|
31
|
+
export const Tokens = TokensImport;
|
|
32
|
+
export const Destiny2 = Destiny2Import;
|
|
33
|
+
export const CommunityContent = CommunityContentImport;
|
|
34
|
+
export const Trending = TrendingImport;
|
|
35
|
+
export const Fireteam = FireteamImport;
|
|
36
|
+
export const Social = SocialImport;
|
|
37
|
+
export const Core = CoreImport;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bungie-api-ts",
|
|
3
|
+
"version": "5.10.0",
|
|
4
|
+
"description": "TypeScript mappings for the Bungie.net API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"scripts": {},
|
|
8
|
+
"jest": {
|
|
9
|
+
"preset": "ts-jest/presets/js-with-babel-esm",
|
|
10
|
+
"testEnvironment": "node",
|
|
11
|
+
"moduleNameMapper": {
|
|
12
|
+
"^(\\.{1,2}/.*)\\.js$": "$1"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=13.2.0"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/DestinyItemManager/bungie-api-ts.git"
|
|
21
|
+
},
|
|
22
|
+
"author": "Ben Hollis",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/DestinyItemManager/bungie-api-ts/issues"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"Destiny",
|
|
29
|
+
"Bungie",
|
|
30
|
+
"Bungie.net",
|
|
31
|
+
"TypeScript"
|
|
32
|
+
],
|
|
33
|
+
"homepage": "https://github.com/DestinyItemManager/bungie-api-ts",
|
|
34
|
+
"devDependencies": {},
|
|
35
|
+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
|
|
36
|
+
"main": "./index.js",
|
|
37
|
+
"types": "./index.d.ts",
|
|
38
|
+
"module": "./index.js",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"default": "./index.js",
|
|
42
|
+
"types": "./index.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./http": {
|
|
45
|
+
"default": "./http.js",
|
|
46
|
+
"types": "./http.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json",
|
|
49
|
+
"./app": {
|
|
50
|
+
"default": "./app/index.js",
|
|
51
|
+
"types": "./app/index.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"./user": {
|
|
54
|
+
"default": "./user/index.js",
|
|
55
|
+
"types": "./user/index.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./content": {
|
|
58
|
+
"default": "./content/index.js",
|
|
59
|
+
"types": "./content/index.d.ts"
|
|
60
|
+
},
|
|
61
|
+
"./forum": {
|
|
62
|
+
"default": "./forum/index.js",
|
|
63
|
+
"types": "./forum/index.d.ts"
|
|
64
|
+
},
|
|
65
|
+
"./groupv2": {
|
|
66
|
+
"default": "./groupv2/index.js",
|
|
67
|
+
"types": "./groupv2/index.d.ts"
|
|
68
|
+
},
|
|
69
|
+
"./tokens": {
|
|
70
|
+
"default": "./tokens/index.js",
|
|
71
|
+
"types": "./tokens/index.d.ts"
|
|
72
|
+
},
|
|
73
|
+
"./destiny2": {
|
|
74
|
+
"default": "./destiny2/index.js",
|
|
75
|
+
"types": "./destiny2/index.d.ts"
|
|
76
|
+
},
|
|
77
|
+
"./communitycontent": {
|
|
78
|
+
"default": "./communitycontent/index.js",
|
|
79
|
+
"types": "./communitycontent/index.d.ts"
|
|
80
|
+
},
|
|
81
|
+
"./trending": {
|
|
82
|
+
"default": "./trending/index.js",
|
|
83
|
+
"types": "./trending/index.d.ts"
|
|
84
|
+
},
|
|
85
|
+
"./fireteam": {
|
|
86
|
+
"default": "./fireteam/index.js",
|
|
87
|
+
"types": "./fireteam/index.d.ts"
|
|
88
|
+
},
|
|
89
|
+
"./social": {
|
|
90
|
+
"default": "./social/index.js",
|
|
91
|
+
"types": "./social/index.d.ts"
|
|
92
|
+
},
|
|
93
|
+
"./core": {
|
|
94
|
+
"default": "./core/index.js",
|
|
95
|
+
"types": "./core/index.d.ts"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"dependencies": {}
|
|
99
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export interface IgnoreResponse {
|
|
14
|
+
readonly isIgnored: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* This enum represents a set of flags - use bitwise operators to check which of
|
|
17
|
+
* these match your value.
|
|
18
|
+
*/
|
|
19
|
+
readonly ignoreFlags: IgnoreStatus;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This enum represents a set of flags - use bitwise operators to check which of
|
|
24
|
+
* these match your value.
|
|
25
|
+
*/
|
|
26
|
+
export const enum IgnoreStatus {
|
|
27
|
+
NotIgnored = 0,
|
|
28
|
+
IgnoredUser = 1,
|
|
29
|
+
IgnoredGroup = 2,
|
|
30
|
+
IgnoredByGroup = 4,
|
|
31
|
+
IgnoredPost = 8,
|
|
32
|
+
IgnoredTag = 16,
|
|
33
|
+
IgnoredGlobal = 32
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TagResponse {
|
|
37
|
+
readonly tagText: string;
|
|
38
|
+
readonly ignoreStatus: IgnoreResponse;
|
|
39
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
BungieFriendListResponse,
|
|
17
|
+
BungieFriendRequestListResponse,
|
|
18
|
+
PlatformFriendResponse,
|
|
19
|
+
PlatformFriendType
|
|
20
|
+
} from './interfaces.js';
|
|
21
|
+
import {
|
|
22
|
+
ServerResponse
|
|
23
|
+
} from '../common.js';
|
|
24
|
+
|
|
25
|
+
const API_BASE = "https://www.bungie.net/Platform/Social/";
|
|
26
|
+
|
|
27
|
+
/** Returns your Bungie Friend list */
|
|
28
|
+
export function getFriendList(http: HttpClient): Promise<ServerResponse<BungieFriendListResponse>> {
|
|
29
|
+
return get(http, `${API_BASE}Friends/`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Returns your friend request queue. */
|
|
33
|
+
export function getFriendRequestList(http: HttpClient): Promise<ServerResponse<BungieFriendRequestListResponse>> {
|
|
34
|
+
return get(http, `${API_BASE}Friends/Requests/`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IssueFriendRequestParams {
|
|
38
|
+
/** The membership id of the user you wish to add. */
|
|
39
|
+
membershipId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Requests a friend relationship with the target user. Any of the target user's
|
|
44
|
+
* linked membership ids are valid inputs.
|
|
45
|
+
*/
|
|
46
|
+
export function issueFriendRequest(http: HttpClient, params: IssueFriendRequestParams): Promise<ServerResponse<boolean>> {
|
|
47
|
+
return post(http, `${API_BASE}Friends/Add/${params.membershipId}/`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AcceptFriendRequestParams {
|
|
51
|
+
/** The membership id of the user you wish to accept. */
|
|
52
|
+
membershipId: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Accepts a friend relationship with the target user. The user must be on your
|
|
57
|
+
* incoming friend request list, though no error will occur if they are not.
|
|
58
|
+
*/
|
|
59
|
+
export function acceptFriendRequest(http: HttpClient, params: AcceptFriendRequestParams): Promise<ServerResponse<boolean>> {
|
|
60
|
+
return post(http, `${API_BASE}Friends/Requests/Accept/${params.membershipId}/`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DeclineFriendRequestParams {
|
|
64
|
+
/** The membership id of the user you wish to decline. */
|
|
65
|
+
membershipId: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Declines a friend relationship with the target user. The user must be on your
|
|
70
|
+
* incoming friend request list, though no error will occur if they are not.
|
|
71
|
+
*/
|
|
72
|
+
export function declineFriendRequest(http: HttpClient, params: DeclineFriendRequestParams): Promise<ServerResponse<boolean>> {
|
|
73
|
+
return post(http, `${API_BASE}Friends/Requests/Decline/${params.membershipId}/`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface RemoveFriendParams {
|
|
77
|
+
/** The membership id of the user you wish to remove. */
|
|
78
|
+
membershipId: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Remove a friend relationship with the target user. The user must be on your
|
|
83
|
+
* friend list, though no error will occur if they are not.
|
|
84
|
+
*/
|
|
85
|
+
export function removeFriend(http: HttpClient, params: RemoveFriendParams): Promise<ServerResponse<boolean>> {
|
|
86
|
+
return post(http, `${API_BASE}Friends/Remove/${params.membershipId}/`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface RemoveFriendRequestParams {
|
|
90
|
+
/** The membership id of the user you wish to remove. */
|
|
91
|
+
membershipId: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Remove a friend relationship with the target user. The user must be on your
|
|
96
|
+
* outgoing request friend list, though no error will occur if they are not.
|
|
97
|
+
*/
|
|
98
|
+
export function removeFriendRequest(http: HttpClient, params: RemoveFriendRequestParams): Promise<ServerResponse<boolean>> {
|
|
99
|
+
return post(http, `${API_BASE}Friends/Requests/Remove/${params.membershipId}/`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface GetPlatformFriendListParams {
|
|
103
|
+
/** The platform friend type. */
|
|
104
|
+
friendPlatform: PlatformFriendType;
|
|
105
|
+
/** The zero based page to return. Page size is 100. */
|
|
106
|
+
page: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Gets the platform friend of the requested type, with additional information if
|
|
111
|
+
* they have Bungie accounts. Must have a recent login session with said platform.
|
|
112
|
+
*/
|
|
113
|
+
export function getPlatformFriendList(http: HttpClient, params: GetPlatformFriendListParams): Promise<ServerResponse<PlatformFriendResponse>> {
|
|
114
|
+
return get(http, `${API_BASE}PlatformFriends/${params.friendPlatform}/${params.page}/`);
|
|
115
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export * from '../common.js';
|
|
14
|
+
export * from '../platform.js';
|
|
15
|
+
export type {HttpClientConfig, HttpClient} from '../http.js';
|
|
16
|
+
export * from './api.js';
|
|
17
|
+
export * from './interfaces.js';
|
|
@@ -0,0 +1,89 @@
|
|
|
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 {
|
|
14
|
+
BungieMembershipType
|
|
15
|
+
} from '../common.js';
|
|
16
|
+
import {
|
|
17
|
+
GeneralUser
|
|
18
|
+
} from '../user/interfaces.js';
|
|
19
|
+
|
|
20
|
+
export const enum PlatformFriendType {
|
|
21
|
+
Unknown = 0,
|
|
22
|
+
Xbox = 1,
|
|
23
|
+
PSN = 2,
|
|
24
|
+
Steam = 3,
|
|
25
|
+
Egs = 4
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface BungieFriendListResponse {
|
|
29
|
+
readonly friends: BungieFriend[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface BungieFriend {
|
|
33
|
+
readonly lastSeenAsMembershipId: string;
|
|
34
|
+
readonly lastSeenAsBungieMembershipType: BungieMembershipType;
|
|
35
|
+
readonly bungieGlobalDisplayName: string;
|
|
36
|
+
readonly bungieGlobalDisplayNameCode?: number;
|
|
37
|
+
readonly onlineStatus: PresenceStatus;
|
|
38
|
+
/**
|
|
39
|
+
* This enum represents a set of flags - use bitwise operators to check which of
|
|
40
|
+
* these match your value.
|
|
41
|
+
*/
|
|
42
|
+
readonly onlineTitle: PresenceOnlineStateFlags;
|
|
43
|
+
readonly relationship: FriendRelationshipState;
|
|
44
|
+
readonly bungieNetUser: GeneralUser;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const enum PresenceStatus {
|
|
48
|
+
OfflineOrUnknown = 0,
|
|
49
|
+
Online = 1
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* This enum represents a set of flags - use bitwise operators to check which of
|
|
54
|
+
* these match your value.
|
|
55
|
+
*/
|
|
56
|
+
export const enum PresenceOnlineStateFlags {
|
|
57
|
+
None = 0,
|
|
58
|
+
Destiny1 = 1,
|
|
59
|
+
Destiny2 = 2
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const enum FriendRelationshipState {
|
|
63
|
+
Unknown = 0,
|
|
64
|
+
Friend = 1,
|
|
65
|
+
IncomingRequest = 2,
|
|
66
|
+
OutgoingRequest = 3
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BungieFriendRequestListResponse {
|
|
70
|
+
readonly incomingRequests: BungieFriend[];
|
|
71
|
+
readonly outgoingRequests: BungieFriend[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PlatformFriendResponse {
|
|
75
|
+
readonly itemsPerPage: number;
|
|
76
|
+
readonly currentPage: number;
|
|
77
|
+
readonly hasMore: boolean;
|
|
78
|
+
readonly platformFriends: PlatformFriend[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PlatformFriend {
|
|
82
|
+
readonly platformDisplayName: string;
|
|
83
|
+
readonly friendPlatform: PlatformFriendType;
|
|
84
|
+
readonly destinyMembershipId?: string;
|
|
85
|
+
readonly destinyMembershipType?: BungieMembershipType;
|
|
86
|
+
readonly bungieNetMembershipId?: string;
|
|
87
|
+
readonly bungieGlobalDisplayName: string;
|
|
88
|
+
readonly bungieGlobalDisplayNameCode?: number;
|
|
89
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
BungieMembershipType,
|
|
17
|
+
ServerResponse
|
|
18
|
+
} from '../common.js';
|
|
19
|
+
import {
|
|
20
|
+
BungieRewardDisplay,
|
|
21
|
+
PartnerOfferClaimRequest,
|
|
22
|
+
PartnerOfferSkuHistoryResponse,
|
|
23
|
+
PartnerRewardHistoryResponse
|
|
24
|
+
} from './interfaces.js';
|
|
25
|
+
|
|
26
|
+
const API_BASE = "https://www.bungie.net/Platform/Tokens/";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Twitch Drops self-repair function - scans twitch for drops not marked as
|
|
30
|
+
* fulfilled and resyncs them.
|
|
31
|
+
*/
|
|
32
|
+
export function forceDropsRepair(http: HttpClient): Promise<ServerResponse<boolean>> {
|
|
33
|
+
return post(http, `${API_BASE}Partner/ForceDropsRepair/`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Claim a partner offer as the authenticated user. */
|
|
37
|
+
export function claimPartnerOffer(http: HttpClient, body: PartnerOfferClaimRequest): Promise<ServerResponse<boolean>> {
|
|
38
|
+
return post(http, `${API_BASE}Partner/ClaimOffer/`, body);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ApplyMissingPartnerOffersWithoutClaimParams {
|
|
42
|
+
/** The partner application identifier. */
|
|
43
|
+
partnerApplicationId: number;
|
|
44
|
+
/**
|
|
45
|
+
* The bungie.net user to apply missing offers to. If not self, elevated
|
|
46
|
+
* permissions are required.
|
|
47
|
+
*/
|
|
48
|
+
targetBnetMembershipId: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Apply a partner offer to the targeted user. This endpoint does not claim a new
|
|
53
|
+
* offer, but any already claimed offers will be applied to the game if not already.
|
|
54
|
+
*/
|
|
55
|
+
export function applyMissingPartnerOffersWithoutClaim(http: HttpClient, params: ApplyMissingPartnerOffersWithoutClaimParams): Promise<ServerResponse<boolean>> {
|
|
56
|
+
return post(http, `${API_BASE}Partner/ApplyMissingOffers/${params.partnerApplicationId}/${params.targetBnetMembershipId}/`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface GetPartnerOfferSkuHistoryParams {
|
|
60
|
+
/** The partner application identifier. */
|
|
61
|
+
partnerApplicationId: number;
|
|
62
|
+
/**
|
|
63
|
+
* The bungie.net user to apply missing offers to. If not self, elevated
|
|
64
|
+
* permissions are required.
|
|
65
|
+
*/
|
|
66
|
+
targetBnetMembershipId: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns the partner sku and offer history of the targeted user. Elevated
|
|
71
|
+
* permissions are required to see users that are not yourself.
|
|
72
|
+
*/
|
|
73
|
+
export function getPartnerOfferSkuHistory(http: HttpClient, params: GetPartnerOfferSkuHistoryParams): Promise<ServerResponse<PartnerOfferSkuHistoryResponse[]>> {
|
|
74
|
+
return get(http, `${API_BASE}Partner/History/${params.partnerApplicationId}/${params.targetBnetMembershipId}/`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface GetPartnerRewardHistoryParams {
|
|
78
|
+
/** The partner application identifier. */
|
|
79
|
+
partnerApplicationId: number;
|
|
80
|
+
/** The bungie.net user to return reward history for. */
|
|
81
|
+
targetBnetMembershipId: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Returns the partner rewards history of the targeted user, both partner offers
|
|
86
|
+
* and Twitch drops.
|
|
87
|
+
*/
|
|
88
|
+
export function getPartnerRewardHistory(http: HttpClient, params: GetPartnerRewardHistoryParams): Promise<ServerResponse<PartnerRewardHistoryResponse>> {
|
|
89
|
+
return get(http, `${API_BASE}Partner/History/${params.targetBnetMembershipId}/Application/${params.partnerApplicationId}/`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface GetBungieRewardsForUserParams {
|
|
93
|
+
/**
|
|
94
|
+
* bungie.net user membershipId for requested user rewards. If not self, elevated
|
|
95
|
+
* permissions are required.
|
|
96
|
+
*/
|
|
97
|
+
membershipId: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Returns the bungie rewards for the targeted user. */
|
|
101
|
+
export function getBungieRewardsForUser(http: HttpClient, params: GetBungieRewardsForUserParams): Promise<ServerResponse<{ [key: string]: BungieRewardDisplay }>> {
|
|
102
|
+
return get(http, `${API_BASE}Rewards/GetRewardsForUser/${params.membershipId}/`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface GetBungieRewardsForPlatformUserParams {
|
|
106
|
+
/**
|
|
107
|
+
* users platform membershipId for requested user rewards. If not self, elevated
|
|
108
|
+
* permissions are required.
|
|
109
|
+
*/
|
|
110
|
+
membershipId: string;
|
|
111
|
+
/** The target Destiny 2 membership type. */
|
|
112
|
+
membershipType: BungieMembershipType;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Returns the bungie rewards for the targeted user when a platform membership Id
|
|
117
|
+
* and Type are used.
|
|
118
|
+
*/
|
|
119
|
+
export function getBungieRewardsForPlatformUser(http: HttpClient, params: GetBungieRewardsForPlatformUserParams): Promise<ServerResponse<{ [key: string]: BungieRewardDisplay }>> {
|
|
120
|
+
return get(http, `${API_BASE}Rewards/GetRewardsForPlatformUser/${params.membershipId}/${params.membershipType}/`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Returns a list of the current bungie rewards */
|
|
124
|
+
export function getBungieRewardsList(http: HttpClient): Promise<ServerResponse<{ [key: string]: BungieRewardDisplay }>> {
|
|
125
|
+
return get(http, `${API_BASE}Rewards/BungieRewards/`);
|
|
126
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export * from '../common.js';
|
|
14
|
+
export * from '../platform.js';
|
|
15
|
+
export type {HttpClientConfig, HttpClient} from '../http.js';
|
|
16
|
+
export * from './api.js';
|
|
17
|
+
export * from './interfaces.js';
|