@interopio/desktop-cli
Version:
io.Connect Desktop Seed Repository CLI Tools
24 lines • 934 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentStorageFactory = void 0;
const github_storage_1 = require("./github-storage");
const http_storage_1 = require("./http-storage");
class ComponentStorageFactory {
static create(storageType) {
const type = storageType || process.env.IOCD_STORAGE_TYPE || 'http';
switch (type.toLowerCase()) {
case 'github':
return new github_storage_1.GitHubStorage();
case 'http':
case 'https':
return new http_storage_1.HttpStorage();
default:
throw new Error(`Unknown storage type: ${type}. Supported types: github, http, https`);
}
}
static getAvailableStorageTypes() {
return ['github', 'http', 'https'];
}
}
exports.ComponentStorageFactory = ComponentStorageFactory;
//# sourceMappingURL=storage-factory.js.map