@cto.ai/ops
Version:
💻 CTO.ai - The CLI built for Teams 🚀
31 lines (30 loc) • 944 B
JavaScript
;
/**
* 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 });
exports.getLatestVersion = void 0;
const tslib_1 = require("tslib");
const axios_1 = tslib_1.__importDefault(require("axios"));
const CustomErrors_1 = require("../errors/CustomErrors");
const getLatestVersion = async () => {
try {
const { data } = await (0, 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);
}
};
exports.getLatestVersion = getLatestVersion;