UNPKG

quria

Version:

A user-friendly Destiny 2 API Wrapper written with TypeScript and approved by -Axis Minds- Oryx.

256 lines (251 loc) 18.7 kB
import { ITokens, APIResponse, GroupTheme, BungieMembershipType, GroupDateRange, GroupType, GroupV2Card, GroupSortBy, GroupSearchResponse, GroupResponse, GroupOptionalConversation, ChatSecuritySetting, RuntimeGroupMemberType, SearchResultOfGroupMember, GroupMemberLeaveResult, IgnoreLength, SearchResultOfGroupBan, SearchResultOfGroupEditHistory, SearchResultOfGroupMemberApplication, EntityActionResult, UserMembership, GroupsForMemberFilter, GetGroupsForMemberResponse, GroupMembershipSearchResponse, GroupPotentialMemberStatus, GroupPotentialMembershipSearchResponse, GroupApplicationResponse } from "../../types"; export declare class GroupV2 { private url; private headers; constructor(url: string, headers: Record<string, string>); /** * Returns a list of all available group avatars for the signed-in user. * @returns Returns a list of all available group avatars for the signed-in user. */ GetAvailableAvatars(tokens?: ITokens): Promise<APIResponse<Record<number, string>>>; /** * Returns a list of all available group themes. * @returns Returns a list of all available group themes. */ GetAvailableThemes(tokens?: ITokens): Promise<APIResponse<GroupTheme[]>>; /** * Gets the state of the user's clan invite preferences for a particular membership type - true if they wish to be invited to clans, false otherwise. * @param mType The Destiny membership type of the account we wish to access settings. * @returns Gets the state of the user's clan invite preferences for a particular membership type - true if they wish to be invited to clans, false otherwise. */ GetUserClanInviteSetting(mType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<boolean>>; /** * Gets groups recommended for you based on the groups to whom those you follow belong. * @param createDateRange Requested range in which to pull recommended groups * @param groupType Type of groups requested * @returns Gets groups recommended for you based on the groups to whom those you follow belong. */ GetRecommendedGroups(createDateRange: GroupDateRange, groupType: GroupType, tokens?: ITokens): Promise<APIResponse<GroupV2Card[]>>; /** * Search for Groups. * @returns Search for Groups. */ GroupSearch(name: string, groupType: GroupType, creationDate: GroupDateRange, sortBy: GroupSortBy, groupMemberCountFilter: number | null, localeFilter: string, tagText: string, itemsPerPage: number, currentPage: number, requestContinuationToken: string, tokens?: ITokens): Promise<APIResponse<GroupSearchResponse>>; /** * Get information about a specific group of the given ID. * @param groupId Requested group's id. * @returns Get information about a specific group of the given ID. */ GetGroup(groupId: string, tokens?: ITokens): Promise<APIResponse<GroupResponse>>; /** * Get information about a specific group with the given name and type. * @param groupName Exact name of the group to find. * @param groupType Type of group to find. * @returns Get information about a specific group with the given name and type. */ GetGroupByName(groupName: string, groupType: GroupType, tokens?: ITokens): Promise<APIResponse<GroupResponse>>; /** * Get information about a specific group with the given name and type. The POST version. * @returns Get information about a specific group with the given name and type. The POST version. */ GetGroupByNameV2(groupName: string, groupType: GroupType, tokens?: ITokens): Promise<APIResponse<GroupResponse>>; /** * Gets a list of available optional conversation channels and their settings. * @param groupId Requested group's id. * @returns Gets a list of available optional conversation channels and their settings. */ GetGroupOptionalConversations(groupId: string, tokens?: ITokens): Promise<APIResponse<GroupOptionalConversation[]>>; /** * Edit an existing group. You must have suitable permissions in the group to perform this operation. This latest revision will only edit the fields you pass in - pass null for properties you want to leave unaltered. * @param groupId Group ID of the group to edit. * @returns Edit an existing group. You must have suitable permissions in the group to perform this operation. This latest revision will only edit the fields you pass in - pass null for properties you want to leave unaltered. */ EditGroup(groupId: string, name: string, about: string, motto: string, theme: string, avatarImageIndex: number | null, tags: string, isPublic: boolean | null, membershipOption: number | null, isPublicTopicAdminOnly: boolean | null, allowChat: boolean | null, chatSecurity: number | null, callsign: string, locale: string, homepage: number | null, enableInvitationMessagingForAdmins: boolean | null, defaultPublicity: number | null, tokens?: ITokens): Promise<APIResponse<number>>; /** * Edit an existing group's clan banner. You must have suitable permissions in the group to perform this operation. All fields are required. * @param groupId Group ID of the group to edit. * @returns Edit an existing group's clan banner. You must have suitable permissions in the group to perform this operation. All fields are required. */ EditClanBanner(groupId: string, decalId: number, decalColorId: number, decalBackgroundColorId: number, gonfalonId: number, gonfalonColorId: number, gonfalonDetailId: number, gonfalonDetailColorId: number, tokens?: ITokens): Promise<APIResponse<number>>; /** * Edit group options only available to a founder. You must have suitable permissions in the group to perform this operation. * @param groupId Group ID of the group to edit. * @returns Edit group options only available to a founder. You must have suitable permissions in the group to perform this operation. */ EditFounderOptions(groupId: string, InvitePermissionOverride: boolean | null, UpdateCulturePermissionOverride: boolean | null, HostGuidedGamePermissionOverride: number | null, UpdateBannerPermissionOverride: boolean | null, JoinLevel: number | null, tokens?: ITokens): Promise<APIResponse<number>>; /** * Add a new optional conversation/chat channel. Requires admin permissions to the group. * @param groupId Group ID of the group to edit. * @returns Add a new optional conversation/chat channel. Requires admin permissions to the group. */ AddOptionalConversation(groupId: string, chatName: string, chatSecurity: ChatSecuritySetting, tokens?: ITokens): Promise<APIResponse<string>>; /** * Edit the settings of an optional conversation/chat channel. Requires admin permissions to the group. * @param conversationId Conversation Id of the channel being edited. * @param groupId Group ID of the group to edit. * @returns Edit the settings of an optional conversation/chat channel. Requires admin permissions to the group. */ EditOptionalConversation(conversationId: string, groupId: string, chatEnabled: boolean | null, chatName: string, chatSecurity: number | null, tokens?: ITokens): Promise<APIResponse<string>>; /** * Get the list of members in a given group. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 items per page. * @param groupId The ID of the group. * @param memberType Filter out other member types. Use None for all members. * @param nameSearch The name fragment upon which a search should be executed for members with matching display or unique names. * @returns Get the list of members in a given group. */ GetMembersOfGroup(currentpage: number, groupId: string, queryString: { memberType?: RuntimeGroupMemberType; nameSearch?: string; } | null, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupMember>>; /** * Get the list of members in a given group who are of admin level or higher. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 items per page. * @param groupId The ID of the group. * @returns Get the list of members in a given group who are of admin level or higher. */ GetAdminsAndFounderOfGroup(currentpage: number, groupId: string, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupMember>>; /** * Edit the membership type of a given member. You must have suitable permissions in the group to perform this operation. * @param groupId ID of the group to which the member belongs. * @param membershipId Membership ID to modify. * @param membershipType Membership type of the provide membership ID. * @param memberType New membertype for the specified member. * @returns Edit the membership type of a given member. You must have suitable permissions in the group to perform this operation. */ EditGroupMembership(groupId: string, membershipId: string, membershipType: BungieMembershipType, memberType: RuntimeGroupMemberType, tokens?: ITokens): Promise<APIResponse<number>>; /** * Kick a member from the given group, forcing them to reapply if they wish to re-join the group. You must have suitable permissions in the group to perform this operation. * @param groupId Group ID to kick the user from. * @param membershipId Membership ID to kick. * @param membershipType Membership type of the provided membership ID. * @returns Kick a member from the given group, forcing them to reapply if they wish to re-join the group. You must have suitable permissions in the group to perform this operation. */ KickMember(groupId: string, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<GroupMemberLeaveResult>>; /** * Bans the requested member from the requested group for the specified period of time. * @param groupId Group ID that has the member to ban. * @param membershipId Membership ID of the member to ban from the group. * @param membershipType Membership type of the provided membership ID. * @returns Bans the requested member from the requested group for the specified period of time. */ BanMember(groupId: string, membershipId: string, membershipType: BungieMembershipType, comment: string, length: IgnoreLength, tokens?: ITokens): Promise<APIResponse<number>>; /** * Unbans the requested member, allowing them to re-apply for membership. * @param groupId * @param membershipId Membership ID of the member to unban from the group * @param membershipType Membership type of the provided membership ID. * @returns Unbans the requested member, allowing them to re-apply for membership. */ UnbanMember(groupId: string, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<number>>; /** * Get the list of banned members in a given group. Only accessible to group Admins and above. Not applicable to all groups. Check group features. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 entries. * @param groupId Group ID whose banned members you are fetching * @returns Get the list of banned members in a given group. Only accessible to group Admins and above. Not applicable to all groups. Check group features. */ GetBannedMembersOfGroup(currentpage: number, groupId: string, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupBan>>; /** * Get the list of edits made to a given group. Only accessible to group Admins and above. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 entries. * @param groupId Group ID whose edit history you are fetching * @returns Get the list of edits made to a given group. Only accessible to group Admins and above. */ GetGroupEditHistory(currentpage: number, groupId: string, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupEditHistory>>; /** * An administrative method to allow the founder of a group or clan to give up their position to another admin permanently. * @param founderIdNew The new founder for this group. Must already be a group admin. * @param groupId The target group id. * @param membershipType Membership type of the provided founderIdNew. * @returns An administrative method to allow the founder of a group or clan to give up their position to another admin permanently. */ AbdicateFoundership(founderIdNew: string, groupId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<boolean>>; /** * Get the list of users who are awaiting a decision on their application to join a given group. Modified to include application info. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 items per page. * @param groupId ID of the group. * @returns Get the list of users who are awaiting a decision on their application to join a given group. Modified to include application info. */ GetPendingMemberships(currentpage: number, groupId: string, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupMemberApplication>>; /** * Get the list of users who have been invited into the group. * @param currentpage Page number (starting with 1). Each page has a fixed size of 50 items per page. * @param groupId ID of the group. * @returns Get the list of users who have been invited into the group. */ GetInvitedIndividuals(currentpage: number, groupId: string, tokens?: ITokens): Promise<APIResponse<SearchResultOfGroupMemberApplication>>; /** * Approve all of the pending users for the given group. * @param groupId ID of the group. * @returns Approve all of the pending users for the given group. */ ApproveAllPending(groupId: string, message: string, tokens?: ITokens): Promise<APIResponse<EntityActionResult[]>>; /** * Deny all of the pending users for the given group. * @param groupId ID of the group. * @returns Deny all of the pending users for the given group. */ DenyAllPending(groupId: string, message: string, tokens?: ITokens): Promise<APIResponse<EntityActionResult[]>>; /** * Approve all of the pending users for the given group. * @param groupId ID of the group. * @returns Approve all of the pending users for the given group. */ ApprovePendingForList(groupId: string, memberships: UserMembership[], message: string, tokens?: ITokens): Promise<APIResponse<EntityActionResult[]>>; /** * Approve the given membershipId to join the group/clan as long as they have applied. * @param groupId ID of the group. * @param membershipId The membership id being approved. * @param membershipType Membership type of the supplied membership ID. * @returns Approve the given membershipId to join the group/clan as long as they have applied. */ ApprovePending(groupId: string, membershipId: string, membershipType: BungieMembershipType, message: string, tokens?: ITokens): Promise<APIResponse<boolean>>; /** * Deny all of the pending users for the given group that match the passed-in . * @param groupId ID of the group. * @returns Deny all of the pending users for the given group that match the passed-in . */ DenyPendingForList(groupId: string, memberships: UserMembership[], message: string, tokens?: ITokens): Promise<APIResponse<EntityActionResult[]>>; /** * Get information about the groups that a given member has joined. * @param filter Filter apply to list of joined groups. * @param groupType Type of group the supplied member founded. * @param membershipId Membership ID to for which to find founded groups. * @param membershipType Membership type of the supplied membership ID. * @returns Get information about the groups that a given member has joined. */ GetGroupsForMember(filter: GroupsForMemberFilter, groupType: GroupType, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<GetGroupsForMemberResponse>>; /** * Allows a founder to manually recover a group they can see in game but not on bungie.net * @param groupType Type of group the supplied member founded. * @param membershipId Membership ID to for which to find founded groups. * @param membershipType Membership type of the supplied membership ID. * @returns Allows a founder to manually recover a group they can see in game but not on bungie.net */ RecoverGroupForFounder(groupType: GroupType, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<GroupMembershipSearchResponse>>; /** * Get information about the groups that a given member has applied to or been invited to. * @param filter Filter apply to list of potential joined groups. * @param groupType Type of group the supplied member applied. * @param membershipId Membership ID to for which to find applied groups. * @param membershipType Membership type of the supplied membership ID. * @returns Get information about the groups that a given member has applied to or been invited to. */ GetPotentialGroupsForMember(filter: GroupPotentialMemberStatus, groupType: GroupType, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<GroupPotentialMembershipSearchResponse>>; /** * Invite a user to join this group. * @param groupId ID of the group you would like to join. * @param membershipId Membership id of the account being invited. * @param membershipType MembershipType of the account being invited. * @returns Invite a user to join this group. */ IndividualGroupInvite(groupId: string, membershipId: string, membershipType: BungieMembershipType, message: string, tokens?: ITokens): Promise<APIResponse<GroupApplicationResponse>>; /** * Cancels a pending invitation to join a group. * @param groupId ID of the group you would like to join. * @param membershipId Membership id of the account being cancelled. * @param membershipType MembershipType of the account being cancelled. * @returns Cancels a pending invitation to join a group. */ IndividualGroupInviteCancel(groupId: string, membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<GroupApplicationResponse>>; }