@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
package/build.sh
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/sh -ex
|
|
2
|
+
|
|
3
|
+
rm -rf ./build
|
|
4
|
+
cp package.json generator
|
|
5
|
+
|
|
6
|
+
# Prepare the generated source directory
|
|
7
|
+
rm -rf ./generated-src
|
|
8
|
+
mkdir -p generated-src
|
|
9
|
+
cp generator/http.ts generated-src
|
|
10
|
+
|
|
11
|
+
# Compile and run the generator
|
|
12
|
+
pnpm tsc -p tsconfig.json
|
|
13
|
+
node ./build/generate.js
|
|
14
|
+
|
|
15
|
+
# Build the package from the generated sources
|
|
16
|
+
rm -rf ./lib
|
|
17
|
+
mkdir -p lib
|
|
18
|
+
rsync -a --include '*/' --include '*.d.ts' --exclude '*' generated-src/ lib/
|
|
19
|
+
cp ./generated-src/package.json.notyet ./lib/package.json
|
|
20
|
+
|
|
21
|
+
babel generated-src --out-dir lib --extensions ".ts"
|
|
22
|
+
|
|
23
|
+
pnpm tsc -p tsconfig-package.json
|
|
24
|
+
|
|
25
|
+
pnpm prettier --write lib/**/*
|
|
26
|
+
|
|
27
|
+
# Copy files into lib - we'll publish lib as the package instead of the whole repo, so paths are nicer.
|
|
28
|
+
cp README.md lib/
|
|
29
|
+
cp bungie-api-LICENSE lib/
|
|
30
|
+
rm generator/package.json
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Bungie SDK License Agreement (BSD 3-Clause License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017, Bungie, Inc.
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
ApiUsage,
|
|
17
|
+
Application
|
|
18
|
+
} from './interfaces.js';
|
|
19
|
+
import {
|
|
20
|
+
ServerResponse
|
|
21
|
+
} from '../common.js';
|
|
22
|
+
|
|
23
|
+
const API_BASE = "https://www.bungie.net/Platform/App/";
|
|
24
|
+
|
|
25
|
+
export interface GetApplicationApiUsageParams {
|
|
26
|
+
/** ID of the application to get usage statistics. */
|
|
27
|
+
applicationId: number;
|
|
28
|
+
/** End time for query. Goes to now if not specified. */
|
|
29
|
+
end?: string;
|
|
30
|
+
/** Start time for query. Goes to 24 hours ago if not specified. */
|
|
31
|
+
start?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get API usage by application for time frame specified. You can go as far back as
|
|
36
|
+
* 30 days ago, and can ask for up to a 48 hour window of time in a single request.
|
|
37
|
+
* You must be authenticated with at least the ReadUserData permission to access
|
|
38
|
+
* this endpoint.
|
|
39
|
+
*/
|
|
40
|
+
export function getApplicationApiUsage(http: HttpClient, params: GetApplicationApiUsageParams): Promise<ServerResponse<ApiUsage>> {
|
|
41
|
+
const strParams: Record<string, string> = {};
|
|
42
|
+
if (params.end !== undefined) { strParams.end = params.end; }
|
|
43
|
+
if (params.start !== undefined) { strParams.start = params.start; }
|
|
44
|
+
return get(http, `${API_BASE}ApiUsage/${params.applicationId}/`, strParams);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Get list of applications created by Bungie. */
|
|
48
|
+
export function getBungieApplications(http: HttpClient): Promise<ServerResponse<Application[]>> {
|
|
49
|
+
return get(http, `${API_BASE}FirstParty/`);
|
|
50
|
+
}
|
|
@@ -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,119 @@
|
|
|
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
|
+
UserInfoCard
|
|
15
|
+
} from '../user/interfaces.js';
|
|
16
|
+
|
|
17
|
+
export interface ApiUsage {
|
|
18
|
+
/** Counts for on API calls made for the time range. */
|
|
19
|
+
readonly apiCalls: Series[];
|
|
20
|
+
/**
|
|
21
|
+
* Instances of blocked requests or requests that crossed the warn threshold during
|
|
22
|
+
* the time range.
|
|
23
|
+
*/
|
|
24
|
+
readonly throttledRequests: Series[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Series {
|
|
28
|
+
/** Collection of samples with time and value. */
|
|
29
|
+
readonly datapoints: Datapoint[];
|
|
30
|
+
/** Target to which to datapoints apply. */
|
|
31
|
+
readonly target: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Datapoint {
|
|
35
|
+
/** Timestamp for the related count. */
|
|
36
|
+
readonly time: string;
|
|
37
|
+
/** Count associated with timestamp */
|
|
38
|
+
readonly count?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Application {
|
|
42
|
+
readonly applicationType: OAuthApplicationType;
|
|
43
|
+
/** Unique ID assigned to the application */
|
|
44
|
+
readonly applicationId: number;
|
|
45
|
+
/** Name of the application */
|
|
46
|
+
readonly name: string;
|
|
47
|
+
/** URL used to pass the user's authorization code to the application */
|
|
48
|
+
readonly redirectUrl: string;
|
|
49
|
+
/** Link to website for the application where a user can learn more about the app. */
|
|
50
|
+
readonly link: string;
|
|
51
|
+
/** Permissions the application needs to work */
|
|
52
|
+
readonly scope: string;
|
|
53
|
+
/** Value of the Origin header sent in requests generated by this application. */
|
|
54
|
+
readonly origin: string;
|
|
55
|
+
/** Current status of the application. */
|
|
56
|
+
readonly status: ApplicationStatus;
|
|
57
|
+
/** Date the application was first added to our database. */
|
|
58
|
+
readonly creationDate: string;
|
|
59
|
+
/** Date the application status last changed. */
|
|
60
|
+
readonly statusChanged: string;
|
|
61
|
+
/** Date the first time the application status entered the 'Public' status. */
|
|
62
|
+
readonly firstPublished: string;
|
|
63
|
+
/**
|
|
64
|
+
* List of team members who manage this application on Bungie.net. Will always
|
|
65
|
+
* consist of at least the application owner.
|
|
66
|
+
*/
|
|
67
|
+
readonly team: ApplicationDeveloper[];
|
|
68
|
+
/** An optional override for the Authorize view name. */
|
|
69
|
+
readonly overrideAuthorizeViewName: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const enum OAuthApplicationType {
|
|
73
|
+
None = 0,
|
|
74
|
+
/**
|
|
75
|
+
* Indicates the application is server based and can keep its secrets from end
|
|
76
|
+
* users and other potential snoops.
|
|
77
|
+
*/
|
|
78
|
+
Confidential = 1,
|
|
79
|
+
/**
|
|
80
|
+
* Indicates the application runs in a public place, and it can't be trusted to
|
|
81
|
+
* keep a secret.
|
|
82
|
+
*/
|
|
83
|
+
Public = 2
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const enum ApplicationStatus {
|
|
87
|
+
/** No value assigned */
|
|
88
|
+
None = 0,
|
|
89
|
+
/**
|
|
90
|
+
* Application exists and works but will not appear in any public catalog. New
|
|
91
|
+
* applications start in this state, test applications will remain in this state.
|
|
92
|
+
*/
|
|
93
|
+
Private = 1,
|
|
94
|
+
/** Active applications that can appear in an catalog. */
|
|
95
|
+
Public = 2,
|
|
96
|
+
/**
|
|
97
|
+
* Application disabled by the owner. All authorizations will be treated as
|
|
98
|
+
* terminated while in this state. Owner can move back to private or public state.
|
|
99
|
+
*/
|
|
100
|
+
Disabled = 3,
|
|
101
|
+
/**
|
|
102
|
+
* Application has been blocked by Bungie. It cannot be transitioned out of this
|
|
103
|
+
* state by the owner. Authorizations are terminated when an application is in this
|
|
104
|
+
* state.
|
|
105
|
+
*/
|
|
106
|
+
Blocked = 4
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface ApplicationDeveloper {
|
|
110
|
+
readonly role: DeveloperRole;
|
|
111
|
+
readonly apiEulaVersion: number;
|
|
112
|
+
readonly user: UserInfoCard;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const enum DeveloperRole {
|
|
116
|
+
None = 0,
|
|
117
|
+
Owner = 1,
|
|
118
|
+
TeamMember = 2
|
|
119
|
+
}
|