import { GNHashtable } from "./../../common/GNData"; import { GenericModels } from "./GenericModels"; import { MasterPlayerModels } from "./MasterPlayerModels"; /** * Groups reusable request and response contracts for Authenticate operations. * * All login and register requests in this namespace use `RequestType.Authenticate` with `RequestRole.Client`. * Every login or register flow except `RefreshAuthToken` requires a non-null `infoRequestParam`. */ export declare namespace AuthenticateModels { /** * Defines the reusable parameter block `infoRequestParam`. * * This object controls which optional profile fields should be returned together with the auth response. * Every boolean flag defaults to `false`, so omit fields you do not need. */ class InfoRequestParam { /** Include linked external identity data. */ external?: boolean; /** Include segment assignments. */ segments?: boolean; /** Include custom data entries, optionally filtered by `customDataKeys`. */ customDatas?: boolean; /** Include display-name data. */ displayName?: boolean; /** Include avatar data. */ avatar?: boolean; tsCreate?: boolean; tags?: boolean; playerBan?: boolean; playerCurrencies?: boolean; playerStatistics?: boolean; playerDatas?: boolean; ipAddressCreate?: boolean; countryCode?: boolean; email?: boolean; tsLastLogin?: boolean; pushNotifications?: boolean; /** Filter the returned player data fields. */ playerDataKeys?: Array; /** Filter the returned player currency fields. */ playerCurrencyKeys?: Array; /** Filter the returned player statistics fields. */ playerStatisticsKeys?: Array; /** Filter the returned custom-data fields. */ customDataKeys?: Array; /** Filter the returned tags by key. */ tagKeys?: Array; } /** * Defines the request payload for `loginByAccount`. * * Use this flow when the player authenticates with a GearN username and password. */ class LoginByAccountRequestData { username: string; password: string; /** Controls which optional profile fields should be returned together with the auth payload. */ infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByAndroidDeviceId. */ class LoginByAndroidDeviceIdRequestData { androidDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByApple. */ class LoginByAppleRequestData { token: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByCustomDeviceId. */ class LoginByCustomDeviceIdRequestData { customDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByCustomId. */ class LoginByCustomIdRequestData { customId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByEditorDeviceId. */ class LoginByEditorDeviceIdRequestData { editorDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByFacebook. */ class LoginByFacebookRequestData { token: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for `loginByGenericService`. * * `serviceData` is provider-defined and is not constrained by a public typed schema beyond `GNHashtable`. */ class LoginByGenericServiceRequestData { serviceName: string; /** Provider-defined payload consumed by the backend integration for `serviceName`. */ serviceData: GNHashtable; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for `loginByGoogle`. * * `type` should be mapped with the public `GoogleLoginType` enum. */ class LoginByGoogleRequestData { token: string; type: number; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByGooglePlayGameService. */ class LoginByGooglePlayGameServiceRequestData { token: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByGameCenter. */ class LoginByGameCenterRequestData { playerId: string; name: string; publicKeyUrl: string; signature: string; salt: string; timestamp: number; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByiOSDeviceId. */ class LoginByiOSDeviceIdRequestData { iOSDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByLinuxDeviceId. */ class LoginByLinuxDeviceIdRequestData { linuxDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByMacOSDeviceId. */ class LoginByMacOSDeviceIdRequestData { macOSDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByWindowsDeviceId. */ class LoginByWindowsDeviceIdRequestData { windowsDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for LoginByWindowsPhoneDeviceId. */ class LoginByWindowsPhoneDeviceIdRequestData { windowsPhoneDeviceId: string; createPlayerIfNotExists?: boolean; infoRequestParam: InfoRequestParam; } /** * Defines the request payload for `registerAccount`. * * This creates a GearN account and returns the same profile-style payload shape used by the normal login flows. */ class RegisterAccountRequestData { username: string; password: string; /** Controls which optional profile fields should be returned together with the auth payload. */ infoRequestParam: InfoRequestParam; } /** * Defines the request payload for `refreshAuthToken`. * * The request body is intentionally empty. The current auth context comes from the stored auth token * or from `overrideAuthToken` passed to the API call. */ class RefreshAuthTokenRequestData { } /** * Defines the response payload returned by most login and register flows. * * This payload extends `MasterPlayerWithUserIdResponseData`, so it may already include profile data * requested through `infoRequestParam` in addition to auth-specific fields. */ class AuthenticateResponseData extends MasterPlayerModels.MasterPlayerWithUserIdResponseData { /** Indicates whether the backend created a new player as part of the login flow. */ newlyCreated?: boolean; /** Auth token to cache locally and reuse for future HTTP or socket auth flows. */ authToken?: string; /** Optional ban state returned together with the auth payload. */ playerBan?: GenericModels.BanItem; } /** * Defines the response payload for `loginByGenericService`. * * This extends the normal auth response and adds an optional backend error message for the external provider flow. */ class GenericServiceAuthenticateResponseData extends AuthenticateResponseData { /** Optional provider-specific error message returned by the backend integration. */ errorMessage?: string; } /** * Defines the response payload for `refreshAuthToken`. * * Unlike the normal login flows, this response only returns the refreshed auth token and optional ban state. */ class RefreshAuthTokenResponseData { /** Refreshed auth token that should replace the previously stored token. */ authToken?: string; /** Optional ban state returned together with the refreshed token. */ playerBan?: GenericModels.BanItem; } /** * Defines an intentionally empty response payload. */ class EmptyResponseData { } }