UNPKG

891 BJavaScriptView Raw
1"use strict";
2/**
3 * Author: Brett Campbell (brett@hackcapital.com)
4 * Date: Friday, 12th April 2019 10:33:26 am
5 * Last Modified By: Brett Campbell (brett@hackcapital.com)
6 * Last Modified Time: Friday, 12th April 2019 10:33:26 am
7 *
8 * DESCRIPTION
9 *
10 */
11Object.defineProperty(exports, "__esModule", { value: true });
12const tslib_1 = require("tslib");
13const axios_1 = tslib_1.__importDefault(require("axios"));
14const CustomErrors_1 = require("../errors/CustomErrors");
15async function getLatestVersion() {
16 try {
17 const { data } = await axios_1.default({
18 method: 'GET',
19 url: '/@cto.ai/ops',
20 baseURL: 'https://registry.npmjs.org/',
21 });
22 const { latest } = data['dist-tags'];
23 return latest;
24 }
25 catch (err) {
26 throw new CustomErrors_1.CouldNotGetLatestVersion(err);
27 }
28}
29exports.default = getLatestVersion;