-
Notifications
You must be signed in to change notification settings - Fork 10
/
interfaces.ts
646 lines (597 loc) · 18.3 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/**
* Bungie.Net API
* 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.
*
* OpenAPI spec version: 2.3.5
* Contact: support@bungie.com
*
* NOTE: This class is auto generated by the bungie-api-ts code generator program.
* https://github.com/DestinyItemManager/bugie-api-ts
* Do not edit these files manually.
*/
import {
BungieMembershipType,
PagedQuery,
PlatformErrorCodes
} from '../common';
import {
DestinyProgression
} from '../destiny2/interfaces';
import {
UserInfoCard,
UserMembership
} from '../user/interfaces';
export interface GroupResponse {
readonly detail: GroupV2;
readonly founder: GroupMember;
readonly alliedIds: string[];
readonly parentGroup: GroupV2;
readonly allianceStatus: GroupAllianceStatus;
readonly groupJoinInviteCount: number;
/**
* This property will be populated if the authenticated user is a member of the
* group. Note that because of account linking, a user can sometimes be part of a
* clan more than once. As such, this returns the highest member type available.
*/
readonly currentUserMemberMap: { [key in BungieMembershipType]: GroupMember };
/**
* This property will be populated if the authenticated user is an applicant or has
* an outstanding invitation to join. Note that because of account linking, a user
* can sometimes be part of a clan more than once.
*/
readonly currentUserPotentialMemberMap: { [key in BungieMembershipType]: GroupPotentialMember };
}
export interface GroupV2 {
readonly groupId: string;
readonly name: string;
readonly groupType: GroupType;
readonly membershipIdCreated: string;
readonly creationDate: string;
readonly modificationDate: string;
readonly about: string;
readonly tags: string[];
readonly memberCount: number;
readonly isPublic: boolean;
readonly isPublicTopicAdminOnly: boolean;
readonly motto: string;
readonly allowChat: boolean;
readonly isDefaultPostPublic: boolean;
readonly chatSecurity: ChatSecuritySetting;
readonly locale: string;
readonly avatarImageIndex: number;
readonly homepage: GroupHomepage;
readonly membershipOption: MembershipOption;
readonly defaultPublicity: GroupPostPublicity;
readonly theme: string;
readonly bannerPath: string;
readonly avatarPath: string;
readonly conversationId: string;
readonly enableInvitationMessagingForAdmins: boolean;
readonly banExpireDate?: string;
readonly features: GroupFeatures;
readonly clanInfo: GroupV2ClanInfoAndInvestment;
}
export const enum GroupType {
General = 0,
Clan = 1
}
export const enum ChatSecuritySetting {
Group = 0,
Admins = 1
}
export const enum GroupHomepage {
Wall = 0,
Forum = 1,
AllianceForum = 2
}
export const enum MembershipOption {
Reviewed = 0,
Open = 1,
Closed = 2
}
export const enum GroupPostPublicity {
Public = 0,
Alliance = 1,
Private = 2
}
export interface GroupFeatures {
readonly maximumMembers: number;
/**
* Maximum number of groups of this type a typical membership may join. For example,
* a user may join about 50 General groups with their Bungie.net account. They may
* join one clan per Destiny membership.
*/
readonly maximumMembershipsOfGroupType: number;
/**
* This enum represents a set of flags - use bitwise operators to check which of
* these match your value.
*/
readonly capabilities: Capabilities;
readonly membershipTypes: BungieMembershipType[];
/**
* Minimum Member Level allowed to invite new members to group
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly invitePermissionOverride: boolean;
/**
* Minimum Member Level allowed to update group culture
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly updateCulturePermissionOverride: boolean;
/**
* Minimum Member Level allowed to host guided games
*
* Always Allowed: Founder, Acting Founder, Admin
*
* Allowed Overrides: None, Member, Beginner
*
* Default is Member for clans, None for groups, although this means nothing for
* groups.
*/
readonly hostGuidedGamePermissionOverride: HostGuidedGamesPermissionLevel;
/**
* Minimum Member Level allowed to update banner
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly updateBannerPermissionOverride: boolean;
/**
* Level to join a member at when accepting an invite, application, or joining an
* open clan
*
* Default is Beginner.
*/
readonly joinLevel: RuntimeGroupMemberType;
}
/**
* This enum represents a set of flags - use bitwise operators to check which of
* these match your value.
*/
export const enum Capabilities {
None = 0,
Leaderboards = 1,
Callsign = 2,
OptionalConversations = 4,
ClanBanner = 8,
D2InvestmentData = 16,
Tags = 32,
Alliances = 64
}
/**
* Used for setting the guided game permission level override (admins and founders
* can always host guided games).
*/
export const enum HostGuidedGamesPermissionLevel {
None = 0,
Beginner = 1,
Member = 2
}
/**
* The member levels used by all V2 Groups API. Individual group types use their
* own mappings in their native storage (general uses BnetDbGroupMemberType and D2
* clans use ClanMemberLevel), but they are all translated to this in the runtime
* api. These runtime values should NEVER be stored anywhere, so the values can be
* changed as necessary.
*/
export const enum RuntimeGroupMemberType {
None = 0,
Beginner = 1,
Member = 2,
Admin = 3,
ActingFounder = 4,
Founder = 5
}
/** The same as GroupV2ClanInfo, but includes any investment data. */
export interface GroupV2ClanInfoAndInvestment {
readonly d2ClanProgressions: { [key: number]: DestinyProgression };
readonly clanCallsign: string;
readonly clanBannerData: ClanBanner;
}
export interface ClanBanner {
readonly decalId: number;
readonly decalColorId: number;
readonly decalBackgroundColorId: number;
readonly gonfalonId: number;
readonly gonfalonColorId: number;
readonly gonfalonDetailId: number;
readonly gonfalonDetailColorId: number;
}
export interface GroupMember {
readonly memberType: RuntimeGroupMemberType;
readonly isOnline: boolean;
readonly lastOnlineStatusChange: string;
readonly groupId: string;
readonly destinyUserInfo: UserInfoCard;
readonly bungieNetUserInfo: UserInfoCard;
readonly joinDate: string;
}
export const enum GroupAllianceStatus {
Unallied = 0,
Parent = 1,
Child = 2
}
export interface GroupPotentialMember {
readonly potentialStatus: GroupPotentialMemberStatus;
readonly groupId: string;
readonly destinyUserInfo: UserInfoCard;
readonly bungieNetUserInfo: UserInfoCard;
readonly joinDate: string;
}
export const enum GroupPotentialMemberStatus {
None = 0,
Applicant = 1,
Invitee = 2
}
export const enum GroupDateRange {
All = 0,
PastDay = 1,
PastWeek = 2,
PastMonth = 3,
PastYear = 4
}
/**
* NOTE: GroupQuery, as of Destiny 2, has essentially two totally different and
* incompatible "modes".
*
* If you are querying for a group, you can pass any of the properties below.
*
* If you are querying for a Clan, you MUST NOT pass any of the following
* properties (they must be null or undefined in your request, not just empty
* string/default values):
*
* - groupMemberCountFilter - localeFilter - tagText
*
* If you pass these, you will get a useless InvalidParameters error.
*/
export interface GroupQuery {
readonly name: string;
readonly groupType: GroupType;
readonly creationDate: GroupDateRange;
readonly sortBy: GroupSortBy;
readonly groupMemberCountFilter?: number;
readonly localeFilter: string;
readonly tagText: string;
readonly itemsPerPage: number;
readonly currentPage: number;
readonly requestContinuationToken: string;
}
export interface GroupNameSearchRequest {
readonly groupName: string;
readonly groupType: GroupType;
}
export interface GroupEditAction {
readonly name: string;
readonly about: string;
readonly motto: string;
readonly theme: string;
readonly avatarImageIndex?: number;
readonly tags: string;
readonly isPublic?: boolean;
readonly membershipOption?: number;
readonly isPublicTopicAdminOnly?: boolean;
readonly allowChat?: boolean;
readonly chatSecurity?: number;
readonly callsign: string;
readonly locale: string;
readonly homepage?: number;
readonly enableInvitationMessagingForAdmins?: boolean;
readonly defaultPublicity?: number;
}
export interface GroupOptionsEditAction {
/**
* Minimum Member Level allowed to invite new members to group
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly InvitePermissionOverride?: boolean;
/**
* Minimum Member Level allowed to update group culture
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly UpdateCulturePermissionOverride?: boolean;
/**
* Minimum Member Level allowed to host guided games
*
* Always Allowed: Founder, Acting Founder, Admin
*
* Allowed Overrides: None, Member, Beginner
*
* Default is Member for clans, None for groups, although this means nothing for
* groups.
*/
readonly HostGuidedGamePermissionOverride?: number;
/**
* Minimum Member Level allowed to update banner
*
* Always Allowed: Founder, Acting Founder
*
* True means admins have this power, false means they don't
*
* Default is false for clans, true for groups.
*/
readonly UpdateBannerPermissionOverride?: boolean;
/**
* Level to join a member at when accepting an invite, application, or joining an
* open clan
*
* Default is Beginner.
*/
readonly JoinLevel?: number;
}
export interface GroupOptionalConversationAddRequest {
readonly chatName: string;
readonly chatSecurity: ChatSecuritySetting;
}
export interface GroupOptionalConversationEditRequest {
readonly chatEnabled?: boolean;
readonly chatName: string;
readonly chatSecurity?: number;
}
export interface GroupBanRequest {
readonly comment: string;
readonly length: IgnoreLength;
}
export interface GroupApplicationRequest {
readonly message: string;
}
export interface GroupApplicationListRequest {
readonly memberships: UserMembership[];
readonly message: string;
}
export const enum GroupsForMemberFilter {
All = 0,
Founded = 1,
NonFounded = 2
}
export interface GroupTheme {
readonly name: string;
readonly folder: string;
readonly description: string;
}
/**
* A small infocard of group information, usually used for when a list of groups
* are returned
*/
export interface GroupV2Card {
readonly groupId: string;
readonly name: string;
readonly groupType: GroupType;
readonly creationDate: string;
readonly about: string;
readonly motto: string;
readonly memberCount: number;
readonly locale: string;
readonly membershipOption: MembershipOption;
/**
* This enum represents a set of flags - use bitwise operators to check which of
* these match your value.
*/
readonly capabilities: Capabilities;
readonly clanInfo: GroupV2ClanInfo;
readonly avatarPath: string;
readonly theme: string;
}
/**
* This contract contains clan-specific group information. It does not include any
* investment data.
*/
export interface GroupV2ClanInfo {
readonly clanCallsign: string;
readonly clanBannerData: ClanBanner;
}
export const enum GroupSortBy {
Name = 0,
Date = 1,
Popularity = 2,
Id = 3
}
export interface GroupSearchResponse {
readonly results: GroupV2Card[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupOptionalConversation {
readonly groupId: string;
readonly conversationId: string;
readonly chatEnabled: boolean;
readonly chatName: string;
readonly chatSecurity: ChatSecuritySetting;
}
export interface SearchResultOfGroupMember {
readonly results: GroupMember[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupMemberLeaveResult {
readonly group: GroupV2;
readonly groupDeleted: boolean;
}
export const enum IgnoreLength {
None = 0,
Week = 1,
TwoWeeks = 2,
ThreeWeeks = 3,
Month = 4,
ThreeMonths = 5,
SixMonths = 6,
Year = 7,
Forever = 8,
ThreeMinutes = 9,
Hour = 10,
ThirtyDays = 11
}
export interface SearchResultOfGroupBan {
readonly results: GroupBan[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupBan {
readonly groupId: string;
readonly lastModifiedBy: UserInfoCard;
readonly createdBy: UserInfoCard;
readonly dateBanned: string;
readonly dateExpires: string;
readonly comment: string;
readonly bungieNetUserInfo: UserInfoCard;
readonly destinyUserInfo: UserInfoCard;
}
export interface SearchResultOfGroupMemberApplication {
readonly results: GroupMemberApplication[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupMemberApplication {
readonly groupId: string;
readonly creationDate: string;
readonly resolveState: GroupApplicationResolveState;
readonly resolveDate?: string;
readonly resolvedByMembershipId?: string;
readonly requestMessage: string;
readonly resolveMessage: string;
readonly destinyUserInfo: UserInfoCard;
readonly bungieNetUserInfo: UserInfoCard;
}
export const enum GroupApplicationResolveState {
Unresolved = 0,
Accepted = 1,
Denied = 2,
Rescinded = 3
}
export interface EntityActionResult {
readonly entityId: string;
readonly result: PlatformErrorCodes;
}
export interface GroupMembershipSearchResponse {
readonly results: GroupMembership[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupMembership {
readonly member: GroupMember;
readonly group: GroupV2;
}
export interface GroupPotentialMembershipSearchResponse {
readonly results: GroupPotentialMembership[];
readonly totalResults: number;
readonly hasMore: boolean;
readonly query: PagedQuery;
readonly replacementContinuationToken: string;
/**
* If useTotalResults is true, then totalResults represents an accurate count.
*
* If False, it does not, and may be estimated/only the size of the current page.
*
* Either way, you should probably always only trust hasMore.
*
* This is a long-held historical throwback to when we used to do paging with known
* total results. Those queries toasted our database, and we were left to hastily
* alter our endpoints and create backward- compatible shims, of which
* useTotalResults is one.
*/
readonly useTotalResults: boolean;
}
export interface GroupPotentialMembership {
readonly member: GroupPotentialMember;
readonly group: GroupV2;
}
export interface GroupApplicationResponse {
readonly resolution: GroupApplicationResolveState;
}