The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/methods/getSetupWizardParameters.ts

28 lines
883 B

import type { ISetting } from '@rocket.chat/core-typings';
import { Settings } from '@rocket.chat/models';
import type { ServerMethods } from '@rocket.chat/ui-contexts';
import { Meteor } from 'meteor/meteor';
import { settings } from '../../app/settings/server';
declare module '@rocket.chat/ui-contexts' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
getSetupWizardParameters(): Promise<{
settings: ISetting[];
serverAlreadyRegistered: boolean;
}>;
}
}
Meteor.methods<ServerMethods>({
async getSetupWizardParameters() {
const setupWizardSettings = await Settings.findSetupWizardSettings().toArray();
const serverAlreadyRegistered = !!settings.get('Cloud_Workspace_Client_Id') || process.env.DEPLOY_PLATFORM === 'rocket-cloud';
return {
settings: setupWizardSettings,
serverAlreadyRegistered,
};
},
});