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

56 lines
1.0 KiB

interface IBundle {
[key: string]: string[];
}
const bundles: IBundle = {
enterprise: [
'auditing',
'canned-responses',
'ldap-enterprise',
'livechat-enterprise',
'omnichannel-mobile-enterprise',
'engagement-dashboard',
'push-privacy',
'scalability',
'teams-mention',
'saml-enterprise',
],
pro: [
],
};
export const getBundleFromModule = (moduleName: string): string|undefined => {
const match = moduleName.match(/(.*):\*$/);
if (!match) {
return;
}
return match[1];
};
export function isBundle(moduleName: string): boolean {
if (moduleName === '*') {
return true;
}
const bundle = getBundleFromModule(moduleName);
if (!bundle) {
return false;
}
return true;
}
export function getBundleModules(moduleName: string): string[] {
if (moduleName === '*') {
return Object.keys(bundles)
.reduce<string[]>((modules, bundle) => modules.concat(bundles[bundle]), []);
}
const bundle = getBundleFromModule(moduleName);
if (!bundle || !bundles[bundle]) {
return [];
}
return bundles[bundle];
}