UNPKG

@cto.ai/ops

Version:

💻 CTO.ai Ops - The CLI built for Teams 🚀

29 lines (28 loc) • 861 B
"use strict"; /** * Author: Brett Campbell (brett@hackcapital.com) * Date: Friday, 12th April 2019 10:33:26 am * Last Modified By: Brett Campbell (brett@hackcapital.com) * Last Modified Time: Friday, 12th April 2019 10:33:26 am * * DESCRIPTION * */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const axios_1 = tslib_1.__importDefault(require("axios")); const CustomErrors_1 = require("../errors/CustomErrors"); exports.getLatestVersion = async () => { try { const { data } = await axios_1.default({ method: 'GET', url: '/@cto.ai/ops', baseURL: 'https://registry.npmjs.org/', }); const { latest } = data['dist-tags']; return latest; } catch (err) { throw new CustomErrors_1.CouldNotGetLatestVersion(err); } };