UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

36 lines 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getModels = void 0; const user_1 = require("../../components/user"); const infrastructure_1 = require("../../infrastructure"); const project_1 = require("../project"); async function getModels(props) { const { yes, projectUuid } = props; await (0, user_1.checkUserIsLoggedInComponent)({ yes }); const { username } = await (0, infrastructure_1.CliAuthenticationClient)().getInfo(); const rpcClient = (0, infrastructure_1.CliRpcClient)(); let projectModels = []; if (projectUuid) { await (0, project_1.validateIsUserProject)({ project: projectUuid }); const project = await (0, infrastructure_1.CliRpcClient)().getProjectByUUID({ uuid: projectUuid }); projectModels = await (0, infrastructure_1.CliRpcClient)().getProjectModels({ project_id: project.id }); } { const publicModelVersions = await rpcClient.listPublicModelVersions(); const privateModelVersions = await rpcClient.listPrivateModelVersions({ publisher: username }); const allModelVersions = [ ...publicModelVersions, ...privateModelVersions, ...projectModels ]; return allModelVersions; } } exports.getModels = getModels; //# sourceMappingURL=get-models.js.map