UNPKG

@bitzonegaming/roleplay-engine-sdk

Version:
34 lines (33 loc) 2.73 kB
import { ApiOptions, EngineClient } from '../core/engine-client'; import { DiscordUserAccountInfo } from './models/discord-user-account-info'; import { ImplicitDiscordAuthRequest } from './models/implicit-discord-auth-request'; import { GrantAccessResult } from '../account/models/grant-access-result'; import { DiscordOAuthTokenRequest } from './models/discord-oauth-token-request'; export declare class DiscordApi { private readonly client; constructor(client: EngineClient); /** * Retrieves a Discord user with the guild membership information by their unique identifier. This endpoint is used to fetch Discord user details for a specific player.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:account * @summary Get Discord user by id * @param {string} discordUserId * @param {*} [options] Override http request option. * @throws {EngineError} */ getDiscordUserById(discordUserId: string, options?: ApiOptions): Promise<DiscordUserAccountInfo>; /** * This endpoint allows players to authenticate with Discord using the implicit flow. It returns a grant access result containing the player\'s account information and access token.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:player_auth * @summary Authorize with implicit Discord flow * @param {ImplicitDiscordAuthRequest} request * @param {*} [options] Override http request option. * @throws {EngineError} */ authImplicitFlow(request: ImplicitDiscordAuthRequest, options?: ApiOptions): Promise<GrantAccessResult>; /** * This endpoint allows players to authenticate with Discord using OAuth tokens. It returns a grant access result containing the player\'s account information and access token.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:player_auth * @summary Authorize with Discord OAuth token * @param {DiscordOAuthTokenRequest} request * @param {*} [options] Override http request option. * @throws {EngineError} */ authOAuthFlow(request: DiscordOAuthTokenRequest, options?: ApiOptions): Promise<GrantAccessResult>; }