@bitzonegaming/roleplay-engine-sdk
Version:
Roleplay Engine SDK
58 lines (57 loc) • 3.45 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurationApi = void 0;
class ConfigurationApi {
constructor(client) {
this.client = client;
}
/**
* It returns a list of configuration based on the provided filters.<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:configuration<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:configuration<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Get configuration
* @param {Object} [query] Query parameters.
* @param {boolean} [query.localized] If `true`, return localized configuration values.
* @param {boolean} [query.withOptions] If `true`, include available option values.
* @param {boolean} [query.onlyPublic] If `true`, return only public configurations.
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getConfiguration(query, options) {
return this.client.get({
url: 'configuration',
query,
options,
});
}
/**
* It returns a list of grouped configuration based on the provided filters.<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:configuration<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:configuration<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Get grouped configuration
* @param {Object} [query] Query parameters.
* @param {boolean} [query.localized] If `true`, return localized configuration values.
* @param {boolean} [query.withOptions] If `true`, include available option values.
* @param {boolean} [query.onlyPublic] If `true`, return only public configurations.
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getGroupedConfiguration(query, options) {
return this.client.get({
url: 'configuration/grouped',
query,
options,
});
}
/**
* It updates the server configuration. The request body should contain a dictionary of configuration values.<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:configuration<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:configuration<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Update configuration
* @param {UpdateConfigurationRequest} [request]
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
updateConfiguration(request, options) {
return this.client.patch({
url: 'configuration',
data: request,
options,
});
}
}
exports.ConfigurationApi = ConfigurationApi;