Something went wrong. Try again.
TypeScript client for accessing TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190import Lacuna from '../lacuna';import Endpoint from '../core/endpoint';import * as E from '../types/empire';
class Empire extends Endpoint { lacuna: Lacuna; module: string;
constructor(lacuna: Lacuna, module: string) { super(); this.lacuna = lacuna; this.module = module; }
isNameAvailable(params: E.IsNameAvailableParams) { return this.callWithoutSession<E.IsNameAvailableResponse>('is_name_available', params); }
fetchCaptcha(params: E.FetchCaptchaParams = {}) { return this.callWithSession<E.FetchCaptchaResponse>('fetch_captcha', params); }
/** * Creates an empire, which then has to be founded (optionally updating its * species first) before it can be played. A captcha can only be used once, * so a 1014 carries a fresh one in its error data for the next attempt. */ create(params: E.CreateParams) { return this.callWithoutSession<E.CreateResponse>('create', params); }
/** Sets an empire up on its home world. Its species can't be changed afterwards. */ found(params: E.FoundParams) { return this.callWithoutSession<E.FoundResponse>('found', params); }
getInviteFriendUrl(params: E.GetInviteFriendUrlParams = {}) { return this.callWithSession<E.GetInviteFriendUrlResponse>('get_invite_friend_url', params); }
inviteFriend(params: E.InviteFriendParams) { return this.callWithSession<E.InviteFriendResponse>('invite_friend', params); }
viewBoosts(params: E.ViewBoostsParams = {}) { return this.callWithSession<E.ViewBoostsResult>('view_boosts', params); }
getStatus(params: E.GetStatusParams = {}) { return this.callWithSession<E.GetStatusResponse>('get_status', params); }
login(params: E.LoginParams) { return this.callWithoutSession<E.LoginResponse>('login', params); }
logout() { return this.callWithSession<E.LogoutResponse>('logout', {}); }
viewProfile(params: E.ViewProfileParams = {}) { return this.callWithSession<E.ViewProfileResponse>('view_profile', params); }
/** Only the properties present in `profile` are updated. */ editProfile(params: E.EditProfileParams) { return this.callWithSession<E.EditProfileResponse>('edit_profile', params); }
viewPublicProfile(params: E.ViewPublicProfileParams) { return this.callWithSession<E.ViewPublicProfileResponse>('view_public_profile', params); }
/** Emails a reset key to the empire, for `resetPassword` to consume. */ sendPasswordResetMessage(params: E.SendPasswordResetMessageParams = {}) { return this.callWithoutSession<E.SendPasswordResetMessageResponse>( 'send_password_reset_message', params ); }
resetPassword(params: E.ResetPasswordParams) { return this.callWithoutSession<E.ResetPasswordResponse>('reset_password', params); }
changePassword(params: E.ChangePasswordParams) { return this.callWithSession<E.ChangePasswordResponse>('change_password', params); }
find(params: E.FindParams) { return this.callWithSession<E.FindResponse>('find', params); }
setStatusMessage(params: E.SetStatusMessageParams) { return this.callWithSession<E.SetStatusMessageResponse>('set_status_message', params); }
boostFood(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_food', params); }
boostWater(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_water', params); }
boostEnergy(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_energy', params); }
boostOre(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_ore', params); }
boostHappiness(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_happiness', params); }
boostBuilding(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_building', params); }
boostSpyTraining(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_spy_training', params); }
boostStorage(params: E.BoostParams = {}) { return this.callWithSession<E.ViewBoostsResult>('boost_storage', params); }
/** Starts a 24 hour countdown, after which the empire is vaporized. */ enableSelfDestruct(params: E.EnableSelfDestructParams = {}) { return this.callWithSession<E.EnableSelfDestructResponse>('enable_self_destruct', params); }
disableSelfDestruct(params: E.DisableSelfDestructParams = {}) { return this.callWithSession<E.DisableSelfDestructResponse>('disable_self_destruct', params); }
redeemEssentiaCode(params: E.RedeemEssentiaCodeParams) { return this.callWithSession<E.RedeemEssentiaCodeResponse>('redeem_essentia_code', params); }
/** * Sets the species of an empire that has been created but not yet founded. * Use `redefineSpecies` once it has been founded. Sessionless despite the * spec marking it otherwise: the empire is identified by `empire_id`, and * there's no session to be had until the empire is founded anyway. */ updateSpecies(params: E.UpdateSpeciesParams) { return this.callWithoutSession<E.UpdateSpeciesResponse>('update_species', params); }
// The spec has this one unauthenticated, but the server reads the empire off // the session to work out its limits, so it's a session call in practice. redefineSpeciesLimits(params: E.RedefineSpeciesLimitsParams = {}) { return this.callWithSession<E.RedefineSpeciesLimitsResponse>('redefine_species_limits', params); }
/** * Spends essentia to redefine a founded empire's species. Can't be redone * for a month afterwards, so prompt the user before calling it. */ redefineSpecies(params: E.RedefineSpeciesParams) { return this.callWithSession<E.RedefineSpeciesResponse>('redefine_species', params); }
viewSpeciesStats(params: E.ViewSpeciesStatsParams = {}) { return this.callWithSession<E.ViewSpeciesStatsResponse>('view_species_stats', params); }
/** Ready-made species to populate an `updateSpecies` form with. */ getSpeciesTemplates(params: E.GetSpeciesTemplatesParams = {}) { return this.callWithoutSession<E.GetSpeciesTemplatesResponse>('get_species_templates', params); }
viewAuthorizedSitters(params: E.ViewAuthorizedSittersParams = {}) { return this.callWithSession<E.ViewAuthorizedSittersResponse>('view_authorized_sitters', params); }
authorizeSitters(params: E.AuthorizeSittersParams) { return this.callWithSession<E.AuthorizeSittersResponse>('authorize_sitters', params); }
deauthorizeSitters(params: E.DeauthorizeSittersParams) { return this.callWithSession<E.DeauthorizeSittersResponse>('deauthorize_sitters', params); }}
export default Empire;