@bitzonegaming/roleplay-engine-sdk
Version:
Roleplay Engine SDK
77 lines (76 loc) • 4.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocaleApi = void 0;
class LocaleApi {
constructor(client) {
this.client = client;
}
/**
* It returns a list of locales based on the provided filters. If noCache is true, it will not use the cache.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:read:localization<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:localization<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Get locales
* @param {Object} [query] Query parameters
* @param {boolean} [query.enabled] Filter by enabled status.
* @param {boolean} [query.noCache] If `true`, bypass server cache and fetch fresh data.
* @param {ApiOptions} [options] Override HTTP request options.
* @throws {EngineError}
*/
getLocales(query, options) {
return this.client.get({ url: 'locales', query, options });
}
/**
* It adds a new locale to the server.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:localization<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:localization<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Add locale
* @param {AddLocaleRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
addLocale(request, options) {
return this.client.post({
url: `locales`,
data: request,
options,
});
}
/**
* It enables a locale for the server by its code.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:localization<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:localization<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Enable locale
* @param {string} locale
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
enableLocale(locale, options) {
return this.client.put({
url: `locales/${locale}/enabled`,
options,
});
}
/**
* It disables a locale for the server by its code.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:localization<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:localization<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Disable locale
* @param {string} locale
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
disableLocale(locale, options) {
return this.client.put({
url: `locales/${locale}/disabled`,
options,
});
}
/**
* It changes the order of a locale for the server by its code.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:localization<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:localization<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Update locale order
* @param {string} locale
* @param {UpdateLocaleOrderRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
updateLocaleOrder(locale, request, options) {
return this.client.put({
url: `locales/${locale}/order`,
data: request,
options,
});
}
}
exports.LocaleApi = LocaleApi;