UNPKG

@bitzonegaming/roleplay-engine-sdk

Version:
51 lines (50 loc) 3.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocalizationApi = void 0; class LocalizationApi { constructor(client) { this.client = client; } /** * It returns the localization data for the server based on the provided locale and path. 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 localization * @param {Object} [query] Query parameters * @param {string} [query.locale] Locale code to fetch translations for. * @param {string} [query.path] Path to the specific localization resource. * @param {boolean} [query.noCache] If `true`, bypass server cache and fetch fresh data. * @param {ApiOptions} [options] Override HTTP request options. * @throws {EngineError} */ getLocalization(query, options) { return this.client.get({ url: 'localization', query, options }); } /** * It updates the localization definitions for the server. The request body should contain a dictionary of localization definitions.<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 localization definitions * @param {Localization} definitionsByLocale * @param {*} [options] Override http request option. * @throws {EngineError} */ updateLocalizationDefinitions(definitionsByLocale, options) { return this.client.patch({ url: 'localization/definitions', data: definitionsByLocale, options, }); } /** * It customizes the localization for the server. The request body should contain a dictionary of localization customizations.<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 localization customization * @param {LocalizationCustomization} customizationByLocale * @param {*} [options] Override http request option. * @throws {EngineError} */ updateLocalizationCustomization(customizationByLocale, options) { return this.client.patch({ url: 'localization/customization', data: customizationByLocale, options, }); } } exports.LocalizationApi = LocalizationApi;