@interopio/desktop-cli
Version:
io.Connect Desktop Seed Repository CLI Tools
80 lines • 2.64 kB
JavaScript
;
/**
* Central registry of all known components with their static metadata
* This eliminates the need for users to configure component details in .iocdrc
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.COMPONENT_REGISTRY = void 0;
exports.getComponentDefinition = getComponentDefinition;
exports.getAllComponentNames = getAllComponentNames;
exports.getComponentsForPlatform = getComponentsForPlatform;
exports.isComponentSupported = isComponentSupported;
/**
* Registry of all known components
*/
exports.COMPONENT_REGISTRY = {
iocd: {
displayName: 'io.Connect Desktop',
fileName: 'io-connect-desktop',
defaultVersions: ['latest'],
licenseRequired: true,
platforms: ['win32', 'darwin', 'linux'],
description: 'The main io.Connect Desktop application runtime',
githubRepo: 'desktop'
},
'bbg-v2': {
displayName: 'Bloomberg V2 Adapter',
fileName: 'bbg-v2',
defaultVersions: ['latest'],
licenseRequired: true,
platforms: ['win32'],
description: 'Bloomberg Terminal V2 integration adapter',
githubRepo: 'bbg-v2-adapter'
},
'teams-adapter': {
displayName: 'Microsoft Teams Adapter',
fileName: 'teams-adapter',
defaultVersions: ['latest'],
licenseRequired: true,
platforms: ['win32'],
description: 'Microsoft Teams integration adapter',
githubRepo: 'teams-adapter'
},
'excel-adapter': {
displayName: 'Excel Adapter',
fileName: 'excel-adapter',
defaultVersions: ['latest'],
licenseRequired: true,
platforms: ['win32'],
description: 'Microsoft Excel integration adapter',
githubRepo: 'excel-adapter'
}
};
/**
* Get component definition by name
*/
function getComponentDefinition(componentName) {
return exports.COMPONENT_REGISTRY[componentName];
}
/**
* Get all known component names
*/
function getAllComponentNames() {
return Object.keys(exports.COMPONENT_REGISTRY);
}
/**
* Get components that support a specific platform
*/
function getComponentsForPlatform(platform) {
return Object.entries(exports.COMPONENT_REGISTRY)
.filter(([_, def]) => def.platforms.includes(platform))
.map(([name, _]) => name);
}
/**
* Check if a component exists and supports a platform
*/
function isComponentSupported(componentName, platform) {
const definition = getComponentDefinition(componentName);
return definition ? definition.platforms.includes(platform) : false;
}
//# sourceMappingURL=component-registry.js.map