@bitzonegaming/roleplay-engine-sdk
Version:
Roleplay Engine SDK
127 lines (126 loc) • 4.62 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PublicApi = void 0;
class PublicApi {
constructor(client) {
this.client = client;
}
/**
* This endpoint retrieves public configuration for the server.
* @summary Get public configuration
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getConfiguration(options) {
return this.client.get({ url: 'public/configuration', options });
}
/**
* This endpoint retrieves enabled locales for the server.
* @summary Get public locales
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getLocales(options) {
return this.client.get({ url: 'public/locales', options });
}
/**
* This endpoint retrieves localization data for the server based on the provided path and user locale. If no path is specified, it returns the default localization for the user\'s locale.
* @summary Get public localization
* @param {string} [path]
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getLocalization(path, options) {
return this.client.get({ url: 'public/localization', query: { path }, options });
}
/**
* This endpoint retrieves public character genders for the server.
* @summary Get public character genders
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getCharacterGenders(options) {
return this.client.get({ url: 'public/characters/genders', options });
}
/**
* This endpoint retrieves public character nationalities for the server.
* @summary Get public character nationalities
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getCharacterNationalities(options) {
return this.client.get({
url: 'public/characters/nationalities',
options,
});
}
/**
* Resend an e-mail verification link to the specified e-mail address. This is useful if the user did not receive the original verification email or if it has expired.
* @summary Resend e-mail verification
* @param {ResendEmailVerificationRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
resendEmailVerification(request, options) {
return this.client.post({
url: 'public/accounts/email-verifications',
data: request,
options,
});
}
/**
* Verify the e-mail address associated with the account using the provided token. This is typically done after the user clicks on a verification link sent to their e-mail address.
* @summary Verify e-mail address
* @param {VerifyEmailRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
verifyEmail(request, options) {
return this.client.put({
url: 'public/accounts/email-verifications',
data: request,
options,
});
}
/**
* Request a password reset for the specified e-mail address. This will send a password reset link to the user\'s e-mail, allowing them to set a new password.
* @summary Forgot password
* @param {ForgotPasswordRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
forgotPassword(request, options) {
return this.client.post({
url: 'public/accounts/password-resets',
data: request,
options,
});
}
/**
* Reset the password for the account using the provided token. This is typically done after the user clicks on a password reset link sent to their e-mail address.
* @summary Reset password
* @param {ResetPasswordRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
resetPassword(request, options) {
return this.client.put({
url: 'public/accounts/password-resets',
data: request,
options,
});
}
/**
* It returns a list of templates for the server.
* @summary Get public templates
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getTemplates(options) {
return this.client.get({
url: 'public/templates',
options,
});
}
}
exports.PublicApi = PublicApi;