@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,120 @@
|
|
|
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
|
+
import { HttpClient } from '../http.js';
|
|
13
|
+
import { BungieMembershipType, ServerResponse } from '../common.js';
|
|
14
|
+
import {
|
|
15
|
+
BungieRewardDisplay,
|
|
16
|
+
PartnerOfferClaimRequest,
|
|
17
|
+
PartnerOfferSkuHistoryResponse,
|
|
18
|
+
PartnerRewardHistoryResponse,
|
|
19
|
+
} from './interfaces.js';
|
|
20
|
+
/**
|
|
21
|
+
* Twitch Drops self-repair function - scans twitch for drops not marked as
|
|
22
|
+
* fulfilled and resyncs them.
|
|
23
|
+
*/
|
|
24
|
+
export declare function forceDropsRepair(http: HttpClient): Promise<ServerResponse<boolean>>;
|
|
25
|
+
/** Claim a partner offer as the authenticated user. */
|
|
26
|
+
export declare function claimPartnerOffer(
|
|
27
|
+
http: HttpClient,
|
|
28
|
+
body: PartnerOfferClaimRequest
|
|
29
|
+
): Promise<ServerResponse<boolean>>;
|
|
30
|
+
export interface ApplyMissingPartnerOffersWithoutClaimParams {
|
|
31
|
+
/** The partner application identifier. */
|
|
32
|
+
partnerApplicationId: number;
|
|
33
|
+
/**
|
|
34
|
+
* The bungie.net user to apply missing offers to. If not self, elevated
|
|
35
|
+
* permissions are required.
|
|
36
|
+
*/
|
|
37
|
+
targetBnetMembershipId: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Apply a partner offer to the targeted user. This endpoint does not claim a new
|
|
41
|
+
* offer, but any already claimed offers will be applied to the game if not already.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyMissingPartnerOffersWithoutClaim(
|
|
44
|
+
http: HttpClient,
|
|
45
|
+
params: ApplyMissingPartnerOffersWithoutClaimParams
|
|
46
|
+
): Promise<ServerResponse<boolean>>;
|
|
47
|
+
export interface GetPartnerOfferSkuHistoryParams {
|
|
48
|
+
/** The partner application identifier. */
|
|
49
|
+
partnerApplicationId: number;
|
|
50
|
+
/**
|
|
51
|
+
* The bungie.net user to apply missing offers to. If not self, elevated
|
|
52
|
+
* permissions are required.
|
|
53
|
+
*/
|
|
54
|
+
targetBnetMembershipId: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns the partner sku and offer history of the targeted user. Elevated
|
|
58
|
+
* permissions are required to see users that are not yourself.
|
|
59
|
+
*/
|
|
60
|
+
export declare function getPartnerOfferSkuHistory(
|
|
61
|
+
http: HttpClient,
|
|
62
|
+
params: GetPartnerOfferSkuHistoryParams
|
|
63
|
+
): Promise<ServerResponse<PartnerOfferSkuHistoryResponse[]>>;
|
|
64
|
+
export interface GetPartnerRewardHistoryParams {
|
|
65
|
+
/** The partner application identifier. */
|
|
66
|
+
partnerApplicationId: number;
|
|
67
|
+
/** The bungie.net user to return reward history for. */
|
|
68
|
+
targetBnetMembershipId: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the partner rewards history of the targeted user, both partner offers
|
|
72
|
+
* and Twitch drops.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getPartnerRewardHistory(
|
|
75
|
+
http: HttpClient,
|
|
76
|
+
params: GetPartnerRewardHistoryParams
|
|
77
|
+
): Promise<ServerResponse<PartnerRewardHistoryResponse>>;
|
|
78
|
+
export interface GetBungieRewardsForUserParams {
|
|
79
|
+
/**
|
|
80
|
+
* bungie.net user membershipId for requested user rewards. If not self, elevated
|
|
81
|
+
* permissions are required.
|
|
82
|
+
*/
|
|
83
|
+
membershipId: string;
|
|
84
|
+
}
|
|
85
|
+
/** Returns the bungie rewards for the targeted user. */
|
|
86
|
+
export declare function getBungieRewardsForUser(
|
|
87
|
+
http: HttpClient,
|
|
88
|
+
params: GetBungieRewardsForUserParams
|
|
89
|
+
): Promise<
|
|
90
|
+
ServerResponse<{
|
|
91
|
+
[key: string]: BungieRewardDisplay;
|
|
92
|
+
}>
|
|
93
|
+
>;
|
|
94
|
+
export interface GetBungieRewardsForPlatformUserParams {
|
|
95
|
+
/**
|
|
96
|
+
* users platform membershipId for requested user rewards. If not self, elevated
|
|
97
|
+
* permissions are required.
|
|
98
|
+
*/
|
|
99
|
+
membershipId: string;
|
|
100
|
+
/** The target Destiny 2 membership type. */
|
|
101
|
+
membershipType: BungieMembershipType;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns the bungie rewards for the targeted user when a platform membership Id
|
|
105
|
+
* and Type are used.
|
|
106
|
+
*/
|
|
107
|
+
export declare function getBungieRewardsForPlatformUser(
|
|
108
|
+
http: HttpClient,
|
|
109
|
+
params: GetBungieRewardsForPlatformUserParams
|
|
110
|
+
): Promise<
|
|
111
|
+
ServerResponse<{
|
|
112
|
+
[key: string]: BungieRewardDisplay;
|
|
113
|
+
}>
|
|
114
|
+
>;
|
|
115
|
+
/** Returns a list of the current bungie rewards */
|
|
116
|
+
export declare function getBungieRewardsList(http: HttpClient): Promise<
|
|
117
|
+
ServerResponse<{
|
|
118
|
+
[key: string]: BungieRewardDisplay;
|
|
119
|
+
}>
|
|
120
|
+
>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { get, post } from '../http.js';
|
|
2
|
+
const API_BASE = 'https://www.bungie.net/Platform/Tokens/';
|
|
3
|
+
export function forceDropsRepair(http) {
|
|
4
|
+
return post(http, `${API_BASE}Partner/ForceDropsRepair/`);
|
|
5
|
+
}
|
|
6
|
+
export function claimPartnerOffer(http, body) {
|
|
7
|
+
return post(http, `${API_BASE}Partner/ClaimOffer/`, body);
|
|
8
|
+
}
|
|
9
|
+
export function applyMissingPartnerOffersWithoutClaim(http, params) {
|
|
10
|
+
return post(
|
|
11
|
+
http,
|
|
12
|
+
`${API_BASE}Partner/ApplyMissingOffers/${params.partnerApplicationId}/${params.targetBnetMembershipId}/`
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export function getPartnerOfferSkuHistory(http, params) {
|
|
16
|
+
return get(
|
|
17
|
+
http,
|
|
18
|
+
`${API_BASE}Partner/History/${params.partnerApplicationId}/${params.targetBnetMembershipId}/`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export function getPartnerRewardHistory(http, params) {
|
|
22
|
+
return get(
|
|
23
|
+
http,
|
|
24
|
+
`${API_BASE}Partner/History/${params.targetBnetMembershipId}/Application/${params.partnerApplicationId}/`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export function getBungieRewardsForUser(http, params) {
|
|
28
|
+
return get(http, `${API_BASE}Rewards/GetRewardsForUser/${params.membershipId}/`);
|
|
29
|
+
}
|
|
30
|
+
export function getBungieRewardsForPlatformUser(http, params) {
|
|
31
|
+
return get(
|
|
32
|
+
http,
|
|
33
|
+
`${API_BASE}Rewards/GetRewardsForPlatformUser/${params.membershipId}/${params.membershipType}/`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export function getBungieRewardsList(http) {
|
|
37
|
+
return get(http, `${API_BASE}Rewards/BungieRewards/`);
|
|
38
|
+
}
|
|
@@ -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 * from '../platform.js';
|
|
14
|
+
export type { HttpClientConfig, HttpClient } from '../http.js';
|
|
15
|
+
export * from './api.js';
|
|
16
|
+
export * from './interfaces.js';
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
import { BungieMembershipType } from '../common.js';
|
|
13
|
+
import {
|
|
14
|
+
DestinyCollectibleDefinition,
|
|
15
|
+
DestinyInventoryItemDefinition,
|
|
16
|
+
DestinyRecordDefinition,
|
|
17
|
+
} from '../destiny2/interfaces.js';
|
|
18
|
+
export interface PartnerOfferClaimRequest {
|
|
19
|
+
readonly PartnerOfferId: string;
|
|
20
|
+
readonly BungieNetMembershipId: string;
|
|
21
|
+
readonly TransactionId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PartnerOfferSkuHistoryResponse {
|
|
24
|
+
readonly SkuIdentifier: string;
|
|
25
|
+
readonly LocalizedName: string;
|
|
26
|
+
readonly LocalizedDescription: string;
|
|
27
|
+
readonly ClaimDate: string;
|
|
28
|
+
readonly AllOffersApplied: boolean;
|
|
29
|
+
readonly TransactionId: string;
|
|
30
|
+
readonly SkuOffers: PartnerOfferHistoryResponse[];
|
|
31
|
+
}
|
|
32
|
+
export interface PartnerOfferHistoryResponse {
|
|
33
|
+
readonly PartnerOfferKey: string;
|
|
34
|
+
readonly MembershipId?: string;
|
|
35
|
+
readonly MembershipType?: BungieMembershipType;
|
|
36
|
+
readonly LocalizedName: string;
|
|
37
|
+
readonly LocalizedDescription: string;
|
|
38
|
+
readonly IsConsumable: boolean;
|
|
39
|
+
readonly QuantityApplied: number;
|
|
40
|
+
readonly ApplyDate?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PartnerRewardHistoryResponse {
|
|
43
|
+
readonly PartnerOffers: PartnerOfferSkuHistoryResponse[];
|
|
44
|
+
readonly TwitchDrops: TwitchDropHistoryResponse[];
|
|
45
|
+
}
|
|
46
|
+
export interface TwitchDropHistoryResponse {
|
|
47
|
+
readonly Title: string;
|
|
48
|
+
readonly Description: string;
|
|
49
|
+
readonly CreatedAt?: string;
|
|
50
|
+
readonly ClaimState?: DropStateEnum;
|
|
51
|
+
}
|
|
52
|
+
export declare const enum DropStateEnum {
|
|
53
|
+
Claimed = 0,
|
|
54
|
+
Applied = 1,
|
|
55
|
+
Fulfilled = 2,
|
|
56
|
+
}
|
|
57
|
+
export interface BungieRewardDisplay {
|
|
58
|
+
readonly UserRewardAvailabilityModel: UserRewardAvailabilityModel;
|
|
59
|
+
readonly ObjectiveDisplayProperties: RewardDisplayProperties;
|
|
60
|
+
readonly RewardDisplayProperties: RewardDisplayProperties;
|
|
61
|
+
}
|
|
62
|
+
export interface UserRewardAvailabilityModel {
|
|
63
|
+
readonly AvailabilityModel: RewardAvailabilityModel;
|
|
64
|
+
readonly IsAvailableForUser: boolean;
|
|
65
|
+
readonly IsUnlockedForUser: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface RewardAvailabilityModel {
|
|
68
|
+
readonly HasExistingCode: boolean;
|
|
69
|
+
readonly RecordDefinitions: DestinyRecordDefinition[];
|
|
70
|
+
readonly CollectibleDefinitions: CollectibleDefinitions[];
|
|
71
|
+
readonly IsOffer: boolean;
|
|
72
|
+
readonly HasOffer: boolean;
|
|
73
|
+
readonly OfferApplied: boolean;
|
|
74
|
+
readonly DecryptedToken: string;
|
|
75
|
+
readonly IsLoyaltyReward: boolean;
|
|
76
|
+
readonly ShopifyEndDate?: string;
|
|
77
|
+
readonly GameEarnByDate: string;
|
|
78
|
+
readonly RedemptionEndDate: string;
|
|
79
|
+
}
|
|
80
|
+
export interface CollectibleDefinitions {
|
|
81
|
+
readonly CollectibleDefinition: DestinyCollectibleDefinition;
|
|
82
|
+
readonly DestinyInventoryItemDefinition: DestinyInventoryItemDefinition;
|
|
83
|
+
}
|
|
84
|
+
export interface RewardDisplayProperties {
|
|
85
|
+
readonly Name: string;
|
|
86
|
+
readonly Description: string;
|
|
87
|
+
readonly ImagePath: string;
|
|
88
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { HttpClient } from '../http.js';
|
|
13
|
+
import {
|
|
14
|
+
SearchResultOfTrendingEntry,
|
|
15
|
+
TrendingCategories,
|
|
16
|
+
TrendingDetail,
|
|
17
|
+
TrendingEntryType,
|
|
18
|
+
} from './interfaces.js';
|
|
19
|
+
import { ServerResponse } from '../common.js';
|
|
20
|
+
/**
|
|
21
|
+
* Returns trending items for Bungie.net, collapsed into the first page of items
|
|
22
|
+
* per category. For pagination within a category, call GetTrendingCategory.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getTrendingCategories(
|
|
25
|
+
http: HttpClient
|
|
26
|
+
): Promise<ServerResponse<TrendingCategories>>;
|
|
27
|
+
export interface GetTrendingCategoryParams {
|
|
28
|
+
/** The ID of the category for whom you want additional results. */
|
|
29
|
+
categoryId: string;
|
|
30
|
+
/** The page # of results to return. */
|
|
31
|
+
pageNumber: number;
|
|
32
|
+
}
|
|
33
|
+
/** Returns paginated lists of trending items for a category. */
|
|
34
|
+
export declare function getTrendingCategory(
|
|
35
|
+
http: HttpClient,
|
|
36
|
+
params: GetTrendingCategoryParams
|
|
37
|
+
): Promise<ServerResponse<SearchResultOfTrendingEntry>>;
|
|
38
|
+
export interface GetTrendingEntryDetailParams {
|
|
39
|
+
/** The identifier for the entity to be returned. */
|
|
40
|
+
identifier: string;
|
|
41
|
+
/** The type of entity to be returned. */
|
|
42
|
+
trendingEntryType: TrendingEntryType;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns the detailed results for a specific trending entry. Note that trending
|
|
46
|
+
* entries are uniquely identified by a combination of *both* the TrendingEntryType
|
|
47
|
+
* *and* the identifier: the identifier alone is not guaranteed to be globally
|
|
48
|
+
* unique.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getTrendingEntryDetail(
|
|
51
|
+
http: HttpClient,
|
|
52
|
+
params: GetTrendingEntryDetailParams
|
|
53
|
+
): Promise<ServerResponse<TrendingDetail>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { get } from '../http.js';
|
|
2
|
+
const API_BASE = 'https://www.bungie.net/Platform/Trending/';
|
|
3
|
+
export function getTrendingCategories(http) {
|
|
4
|
+
return get(http, `${API_BASE}Categories/`);
|
|
5
|
+
}
|
|
6
|
+
export function getTrendingCategory(http, params) {
|
|
7
|
+
return get(http, `${API_BASE}Categories/${params.categoryId}/${params.pageNumber}/`);
|
|
8
|
+
}
|
|
9
|
+
export function getTrendingEntryDetail(http, params) {
|
|
10
|
+
return get(http, `${API_BASE}Details/${params.trendingEntryType}/${params.identifier}/`);
|
|
11
|
+
}
|
|
@@ -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 * from '../platform.js';
|
|
14
|
+
export type { HttpClientConfig, HttpClient } from '../http.js';
|
|
15
|
+
export * from './api.js';
|
|
16
|
+
export * from './interfaces.js';
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
import { ContentItemPublicContract } from '../content/interfaces.js';
|
|
13
|
+
import {
|
|
14
|
+
DestinyMilestoneContent,
|
|
15
|
+
DestinyPublicActivityStatus,
|
|
16
|
+
DestinyPublicMilestone,
|
|
17
|
+
} from '../destiny2/interfaces.js';
|
|
18
|
+
import { PagedQuery } from '../common.js';
|
|
19
|
+
/** The known entity types that you can have returned from Trending. */
|
|
20
|
+
export declare const enum TrendingEntryType {
|
|
21
|
+
News = 0,
|
|
22
|
+
DestinyItem = 1,
|
|
23
|
+
DestinyActivity = 2,
|
|
24
|
+
DestinyRitual = 3,
|
|
25
|
+
SupportArticle = 4,
|
|
26
|
+
Creation = 5,
|
|
27
|
+
Stream = 6,
|
|
28
|
+
Update = 7,
|
|
29
|
+
Link = 8,
|
|
30
|
+
ForumTag = 9,
|
|
31
|
+
Container = 10,
|
|
32
|
+
Release = 11,
|
|
33
|
+
}
|
|
34
|
+
export interface TrendingCategories {
|
|
35
|
+
readonly categories: TrendingCategory[];
|
|
36
|
+
}
|
|
37
|
+
export interface TrendingCategory {
|
|
38
|
+
readonly categoryName: string;
|
|
39
|
+
readonly entries: SearchResultOfTrendingEntry;
|
|
40
|
+
readonly categoryId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface SearchResultOfTrendingEntry {
|
|
43
|
+
readonly results: TrendingEntry[];
|
|
44
|
+
readonly totalResults: number;
|
|
45
|
+
readonly hasMore: boolean;
|
|
46
|
+
readonly query: PagedQuery;
|
|
47
|
+
readonly replacementContinuationToken: string;
|
|
48
|
+
/**
|
|
49
|
+
* If useTotalResults is true, then totalResults represents an accurate count.
|
|
50
|
+
*
|
|
51
|
+
* If False, it does not, and may be estimated/only the size of the current page.
|
|
52
|
+
*
|
|
53
|
+
* Either way, you should probably always only trust hasMore.
|
|
54
|
+
*
|
|
55
|
+
* This is a long-held historical throwback to when we used to do paging with known
|
|
56
|
+
* total results. Those queries toasted our database, and we were left to hastily
|
|
57
|
+
* alter our endpoints and create backward- compatible shims, of which
|
|
58
|
+
* useTotalResults is one.
|
|
59
|
+
*/
|
|
60
|
+
readonly useTotalResults: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The list entry view for trending items. Returns just enough to show the item on
|
|
64
|
+
* the trending page.
|
|
65
|
+
*/
|
|
66
|
+
export interface TrendingEntry {
|
|
67
|
+
/** The weighted score of this trending item. */
|
|
68
|
+
readonly weight: number;
|
|
69
|
+
readonly isFeatured: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* We don't know whether the identifier will be a string, a uint, or a long... so
|
|
72
|
+
* we're going to cast it all to a string. But either way, we need any trending
|
|
73
|
+
* item created to have a single unique identifier for its type.
|
|
74
|
+
*/
|
|
75
|
+
readonly identifier: string;
|
|
76
|
+
/**
|
|
77
|
+
* An enum - unfortunately - dictating all of the possible kinds of trending items
|
|
78
|
+
* that you might get in your result set, in case you want to do custom rendering
|
|
79
|
+
* or call to get the details of the item.
|
|
80
|
+
*/
|
|
81
|
+
readonly entityType: TrendingEntryType;
|
|
82
|
+
/**
|
|
83
|
+
* The localized "display name/article title/'primary localized identifier'" of the
|
|
84
|
+
* entity.
|
|
85
|
+
*/
|
|
86
|
+
readonly displayName: string;
|
|
87
|
+
/**
|
|
88
|
+
* If the entity has a localized tagline/subtitle/motto/whatever, that is found
|
|
89
|
+
* here.
|
|
90
|
+
*/
|
|
91
|
+
readonly tagline: string;
|
|
92
|
+
readonly image: string;
|
|
93
|
+
readonly startDate?: string;
|
|
94
|
+
readonly endDate?: string;
|
|
95
|
+
readonly link: string;
|
|
96
|
+
/**
|
|
97
|
+
* If this is populated, the entry has a related WebM video to show. I am 100%
|
|
98
|
+
* certain I am going to regret putting this directly on TrendingEntry, but it will
|
|
99
|
+
* work so yolo
|
|
100
|
+
*/
|
|
101
|
+
readonly webmVideo: string;
|
|
102
|
+
/**
|
|
103
|
+
* If this is populated, the entry has a related MP4 video to show. I am 100%
|
|
104
|
+
* certain I am going to regret putting this directly on TrendingEntry, but it will
|
|
105
|
+
* work so yolo
|
|
106
|
+
*/
|
|
107
|
+
readonly mp4Video: string;
|
|
108
|
+
/**
|
|
109
|
+
* If isFeatured, this image will be populated with whatever the featured image is.
|
|
110
|
+
* Note that this will likely be a very large image, so don't use it all the time.
|
|
111
|
+
*/
|
|
112
|
+
readonly featureImage: string;
|
|
113
|
+
/**
|
|
114
|
+
* If the item is of entityType TrendingEntryType.Container, it may have items -
|
|
115
|
+
* also Trending Entries - contained within it. This is the ordered list of those
|
|
116
|
+
* to display under the Container's header.
|
|
117
|
+
*/
|
|
118
|
+
readonly items: TrendingEntry[];
|
|
119
|
+
/** If the entry has a date at which it was created, this is that date. */
|
|
120
|
+
readonly creationDate?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface TrendingDetail {
|
|
123
|
+
readonly identifier: string;
|
|
124
|
+
readonly entityType: TrendingEntryType;
|
|
125
|
+
readonly news: TrendingEntryNews;
|
|
126
|
+
readonly support: TrendingEntrySupportArticle;
|
|
127
|
+
readonly destinyItem: TrendingEntryDestinyItem;
|
|
128
|
+
readonly destinyActivity: TrendingEntryDestinyActivity;
|
|
129
|
+
readonly destinyRitual: TrendingEntryDestinyRitual;
|
|
130
|
+
readonly creation: TrendingEntryCommunityCreation;
|
|
131
|
+
}
|
|
132
|
+
export interface TrendingEntryNews {
|
|
133
|
+
readonly article: ContentItemPublicContract;
|
|
134
|
+
}
|
|
135
|
+
export interface TrendingEntrySupportArticle {
|
|
136
|
+
readonly article: ContentItemPublicContract;
|
|
137
|
+
}
|
|
138
|
+
export interface TrendingEntryDestinyItem {
|
|
139
|
+
readonly itemHash: number;
|
|
140
|
+
}
|
|
141
|
+
export interface TrendingEntryDestinyActivity {
|
|
142
|
+
readonly activityHash: number;
|
|
143
|
+
readonly status: DestinyPublicActivityStatus;
|
|
144
|
+
}
|
|
145
|
+
export interface TrendingEntryDestinyRitual {
|
|
146
|
+
readonly image: string;
|
|
147
|
+
readonly icon: string;
|
|
148
|
+
readonly title: string;
|
|
149
|
+
readonly subtitle: string;
|
|
150
|
+
readonly dateStart?: string;
|
|
151
|
+
readonly dateEnd?: string;
|
|
152
|
+
/**
|
|
153
|
+
* A destiny event does not necessarily have a related Milestone, but if it does
|
|
154
|
+
* the details will be returned here.
|
|
155
|
+
*/
|
|
156
|
+
readonly milestoneDetails: DestinyPublicMilestone;
|
|
157
|
+
/**
|
|
158
|
+
* A destiny event will not necessarily have milestone "custom content", but if it
|
|
159
|
+
* does the details will be here.
|
|
160
|
+
*/
|
|
161
|
+
readonly eventContent: DestinyMilestoneContent;
|
|
162
|
+
}
|
|
163
|
+
export interface TrendingEntryCommunityCreation {
|
|
164
|
+
readonly media: string;
|
|
165
|
+
readonly title: string;
|
|
166
|
+
readonly author: string;
|
|
167
|
+
readonly authorMembershipId: string;
|
|
168
|
+
readonly postId: string;
|
|
169
|
+
readonly body: string;
|
|
170
|
+
readonly upvotes: number;
|
|
171
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
import { HttpClient } from '../http.js';
|
|
13
|
+
import {
|
|
14
|
+
BungieCredentialType,
|
|
15
|
+
GeneralUser,
|
|
16
|
+
GetCredentialTypesForAccountResponse,
|
|
17
|
+
HardLinkedUserMembership,
|
|
18
|
+
UserMembershipData,
|
|
19
|
+
UserSearchPrefixRequest,
|
|
20
|
+
UserSearchResponse,
|
|
21
|
+
UserTheme,
|
|
22
|
+
} from './interfaces.js';
|
|
23
|
+
import { BungieMembershipType, ServerResponse } from '../common.js';
|
|
24
|
+
export interface GetBungieNetUserByIdParams {
|
|
25
|
+
/** The requested Bungie.net membership id. */
|
|
26
|
+
id: string;
|
|
27
|
+
}
|
|
28
|
+
/** Loads a bungienet user by membership id. */
|
|
29
|
+
export declare function getBungieNetUserById(
|
|
30
|
+
http: HttpClient,
|
|
31
|
+
params: GetBungieNetUserByIdParams
|
|
32
|
+
): Promise<ServerResponse<GeneralUser>>;
|
|
33
|
+
export interface GetSanitizedPlatformDisplayNamesParams {
|
|
34
|
+
/** The requested membership id to load. */
|
|
35
|
+
membershipId: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets a list of all display names linked to this membership id but sanitized (
|
|
39
|
+
* profanity filtered). Obeys all visibility rules of calling user and is heavily
|
|
40
|
+
* cached.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getSanitizedPlatformDisplayNames(
|
|
43
|
+
http: HttpClient,
|
|
44
|
+
params: GetSanitizedPlatformDisplayNamesParams
|
|
45
|
+
): Promise<
|
|
46
|
+
ServerResponse<{
|
|
47
|
+
[key in BungieCredentialType]: string;
|
|
48
|
+
}>
|
|
49
|
+
>;
|
|
50
|
+
export interface GetCredentialTypesForTargetAccountParams {
|
|
51
|
+
/** The user's membership id */
|
|
52
|
+
membershipId: string;
|
|
53
|
+
}
|
|
54
|
+
/** Returns a list of credential types attached to the requested account */
|
|
55
|
+
export declare function getCredentialTypesForTargetAccount(
|
|
56
|
+
http: HttpClient,
|
|
57
|
+
params: GetCredentialTypesForTargetAccountParams
|
|
58
|
+
): Promise<ServerResponse<GetCredentialTypesForAccountResponse[]>>;
|
|
59
|
+
/** Returns a list of all available user themes. */
|
|
60
|
+
export declare function getAvailableThemes(http: HttpClient): Promise<ServerResponse<UserTheme[]>>;
|
|
61
|
+
export interface GetMembershipDataByIdParams {
|
|
62
|
+
/** The membership ID of the target user. */
|
|
63
|
+
membershipId: string;
|
|
64
|
+
/** Type of the supplied membership ID. */
|
|
65
|
+
membershipType: BungieMembershipType;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns a list of accounts associated with the supplied membership ID and
|
|
69
|
+
* membership type. This will include all linked accounts (even when hidden) if
|
|
70
|
+
* supplied credentials permit it.
|
|
71
|
+
*/
|
|
72
|
+
export declare function getMembershipDataById(
|
|
73
|
+
http: HttpClient,
|
|
74
|
+
params: GetMembershipDataByIdParams
|
|
75
|
+
): Promise<ServerResponse<UserMembershipData>>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns a list of accounts associated with signed in user. This is useful for
|
|
78
|
+
* OAuth implementations that do not give you access to the token response.
|
|
79
|
+
*/
|
|
80
|
+
export declare function getMembershipDataForCurrentUser(
|
|
81
|
+
http: HttpClient
|
|
82
|
+
): Promise<ServerResponse<UserMembershipData>>;
|
|
83
|
+
export interface GetMembershipFromHardLinkedCredentialParams {
|
|
84
|
+
/** The credential to look up. Must be a valid SteamID64. */
|
|
85
|
+
credential: string;
|
|
86
|
+
/** The credential type. 'SteamId' is the only valid value at present. */
|
|
87
|
+
crType: BungieCredentialType;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Gets any hard linked membership given a credential. Only works for credentials
|
|
91
|
+
* that are public (just SteamID64 right now). Cross Save aware.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getMembershipFromHardLinkedCredential(
|
|
94
|
+
http: HttpClient,
|
|
95
|
+
params: GetMembershipFromHardLinkedCredentialParams
|
|
96
|
+
): Promise<ServerResponse<HardLinkedUserMembership>>;
|
|
97
|
+
export interface SearchByGlobalNamePrefixParams {
|
|
98
|
+
/** The display name prefix you're looking for. */
|
|
99
|
+
displayNamePrefix: string;
|
|
100
|
+
/** The zero-based page of results you desire. */
|
|
101
|
+
page: number;
|
|
102
|
+
}
|
|
103
|
+
/** [OBSOLETE] Do not use this to search users, use SearchByGlobalNamePost instead. */
|
|
104
|
+
export declare function searchByGlobalNamePrefix(
|
|
105
|
+
http: HttpClient,
|
|
106
|
+
params: SearchByGlobalNamePrefixParams
|
|
107
|
+
): Promise<ServerResponse<UserSearchResponse>>;
|
|
108
|
+
export interface SearchByGlobalNamePostParams {
|
|
109
|
+
/** The zero-based page of results you desire. */
|
|
110
|
+
page: number;
|
|
111
|
+
}
|
|
112
|
+
/** Given the prefix of a global display name, returns all users who share that name. */
|
|
113
|
+
export declare function searchByGlobalNamePost(
|
|
114
|
+
http: HttpClient,
|
|
115
|
+
params: SearchByGlobalNamePostParams,
|
|
116
|
+
body: UserSearchPrefixRequest
|
|
117
|
+
): Promise<ServerResponse<UserSearchResponse>>;
|