import type { ISettingsService } from '@rocket.chat/core-services'; import { ServiceClassInternal } from '@rocket.chat/core-services'; import type { SettingValue } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; import { notifyOnSettingChangedById } from '../../lib/notifyListener'; import { settings } from '../../settings'; import { verifyFingerPrint } from '../../settings/misc'; export class SettingsService extends ServiceClassInternal implements ISettingsService { protected name = 'settings'; async get(settingId: string): Promise { return settings.get(settingId); } async set(settingId: string, value: T): Promise { const update = await Settings.updateValueById(settingId, value); if (update.modifiedCount) { void notifyOnSettingChangedById(settingId); } } override async started() { settings.change('Site_Url', () => { void verifyFingerPrint(); }); } }