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/ee/app/license/server/methods.ts

33 lines
879 B

import type { ServerMethods } from '@rocket.chat/ui-contexts';
import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';
import type { ILicenseTag } from '../definition/ILicenseTag';
import { getModules, getTags, hasLicense, isEnterprise } from './license';
declare module '@rocket.chat/ui-contexts' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
'license:hasLicense'(feature: string): boolean;
'license:getModules'(): string[];
'license:getTags'(): ILicenseTag[];
'license:isEnterprise'(): boolean;
}
}
Meteor.methods<ServerMethods>({
'license:hasLicense'(feature: string) {
check(feature, String);
return hasLicense(feature);
},
'license:getModules'() {
return getModules();
},
'license:getTags'() {
return getTags();
},
'license:isEnterprise'() {
return isEnterprise();
},
});