1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | const tslib_1 = require("tslib");
|
13 | const axios_1 = tslib_1.__importDefault(require("axios"));
|
14 | const CustomErrors_1 = require("../errors/CustomErrors");
|
15 | async 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 | }
|
29 | exports.default = getLatestVersion;
|