UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

35 lines 1.53 kB
import Controller from '../controller.js'; import { NONE } from '../../types/permissions.js'; import { createResponseSchema } from '../../openapi/util/create-response-schema.js'; import { telemetrySettingsSchema, } from '../../openapi/spec/telemetry-settings-schema.js'; class TelemetryController extends Controller { constructor(config, { openApiService }) { super(config); this.openApiService = openApiService; this.route({ method: 'get', path: '/settings', handler: this.getTelemetrySettings, permission: NONE, middleware: [ openApiService.validPath({ tags: ['Telemetry'], summary: 'Get telemetry settings', description: 'Provides the configured settings for [telemetry information collection](https://docs.getunleash.io/topics/data-collection)', operationId: 'getTelemetrySettings', responses: { 200: createResponseSchema('telemetrySettingsSchema'), }, }), ], }); } async getTelemetrySettings(_req, res) { this.openApiService.respondWithValidation(200, res, telemetrySettingsSchema.$id, { versionInfoCollectionEnabled: this.config.versionCheck.enable, featureInfoCollectionEnabled: this.config.telemetry, }); } } export default TelemetryController; //# sourceMappingURL=telemetry.js.map