@interopio/desktop-cli
Version:
CLI tool for setting up, building and packaging io.Connect Desktop projects
75 lines • 2.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentsRegistry = void 0;
/**
* Central registry of all known components with their static metadata
* It is best if this goes to cli configuration
*/
class ComponentsRegistry {
COMPONENT_REGISTRY = {
iocd: {
displayName: 'io.Connect Desktop',
name: 'iocd',
licenseRequired: true,
platforms: ['win32', 'darwin'],
description: 'The main io.Connect Desktop application runtime',
},
'bbg-v2': {
displayName: 'Bloomberg V2 Adapter',
name: 'bbg-v2',
licenseRequired: true,
platforms: ['win32'],
description: 'Bloomberg Terminal V2 integration adapter',
},
'bbg-v3': {
displayName: 'Bloomberg V3 Adapter',
name: 'bbg-v3',
licenseRequired: true,
platforms: ['win32', 'darwin'],
description: 'Bloomberg Terminal V3 integration adapter',
},
'teams-adapter': {
displayName: 'Microsoft Teams Adapter',
name: 'teams-adapter',
licenseRequired: true,
platforms: ['win32'],
description: 'Microsoft Teams integration adapter',
},
'excel-adapter': {
displayName: 'Excel Adapter',
name: 'excel-adapter',
licenseRequired: true,
platforms: ['win32'],
description: 'Microsoft Excel integration adapter',
}
};
/**
* Get component definition by name
*/
getComponentDefinition(componentName) {
return this.COMPONENT_REGISTRY[componentName];
}
/**
* Get all known component names
*/
getAllComponentNames() {
return Object.keys(this.COMPONENT_REGISTRY);
}
/**
* Get components that support a specific platform
*/
getComponentsForPlatform(platform) {
return Object.entries(this.COMPONENT_REGISTRY)
.filter(([_, def]) => def.platforms.includes(platform))
.map(([name, _]) => name);
}
/**
* Check if a component exists and supports a platform
*/
isComponentSupported(componentName, platform) {
const definition = this.getComponentDefinition(componentName);
return definition ? definition.platforms.includes(platform) : false;
}
}
exports.ComponentsRegistry = ComponentsRegistry;
//# sourceMappingURL=components.registry.js.map