UNPKG

@bitzonegaming/roleplay-engine-sdk

Version:
45 lines (44 loc) 2.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetricApi = void 0; class MetricApi { constructor(client) { this.client = client; } /** * It returns a list of metrics 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:metric<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:metric<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token] * @summary Get metrics * @param {Object} [query] Query parameters * @param {ReferenceCategory} [query.category] Filter metrics by category. Use `ReferenceCategory` enum values. * @param {boolean} [query.localized] If `true`, return localized metric names. * @param {boolean} [query.noCache] If `true`, bypass server cache and fetch fresh data. * @param {number} [query.pageIndex] Page index for pagination. * @param {number} [query.pageSize] Page size for pagination. * @param {ApiOptions} [options] Override HTTP request options. * @throws {EngineError} */ getMetrics(query, options) { return this.client.get({ url: 'metrics', query, options, }); } /** * It returns a list of metric definitions based on the provided category.<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:metric<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:metric<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token] * @summary Get metric definitions * @param {ReferenceCategory} [category] Reference category * @param {Object} [query] Query parameters * @param {boolean} [query.noCache] If `true`, bypass server cache and fetch fresh data. * @param {*} [options] Override http request option. * @throws {EngineError} */ getMetricDefinitions(category, query, options) { return this.client.get({ url: 'metrics/definitions', query: { ...query, category }, options, }); } } exports.MetricApi = MetricApi;