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

32 lines
920 B

import { type ILicenseTag, type LicenseModule } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { License } from '@rocket.chat/license';
import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';
declare module '@rocket.chat/ddp-client' {
// 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 License.hasModule(feature as LicenseModule);
},
'license:getModules'() {
return License.getModules();
},
'license:getTags'() {
return License.getTags();
},
'license:isEnterprise'() {
return License.hasValidLicense();
},
});