@oclif/plugin-update
Advanced tools
Comparing version 4.4.12 to 4.4.13-dev.0
@@ -5,6 +5,7 @@ import { Config, ux } from '@oclif/core'; | ||
import fileSize from 'filesize'; | ||
import { got } from 'got'; | ||
import { HTTPError, got } from 'got'; | ||
import { existsSync } from 'node:fs'; | ||
import { mkdir, readFile, readdir, rm, stat, symlink, utimes, writeFile } from 'node:fs/promises'; | ||
import { basename, dirname, join } from 'node:path'; | ||
import { ProxyAgent } from 'proxy-agent'; | ||
import { Extractor } from './tar.js'; | ||
@@ -17,2 +18,19 @@ import { ls, wait } from './util.js'; | ||
}; | ||
async function httpGet(url) { | ||
debug(`[${url}] GET`); | ||
return got | ||
.get(url, { | ||
agent: { https: new ProxyAgent() }, | ||
}) | ||
.then((res) => { | ||
debug(`[${url}] ${res.statusCode}`); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
debug(`[${url}] ${error.response?.statusCode ?? error.code}`); | ||
// constructing a new HTTPError here will produce a more actionable stack trace | ||
debug(new HTTPError(error.response)); | ||
throw error; | ||
}); | ||
} | ||
export class Updater { | ||
@@ -30,3 +48,3 @@ config; | ||
try { | ||
const { body } = await got.get(newIndexUrl); | ||
const { body } = await httpGet(newIndexUrl); | ||
return typeof body === 'string' ? JSON.parse(body) : body; | ||
@@ -249,3 +267,3 @@ } | ||
const url = config.s3Url(s3Key); | ||
const { body } = await got.get(url); | ||
const { body } = await httpGet(url); | ||
if (typeof body === 'string') { | ||
@@ -346,3 +364,3 @@ return JSON.parse(body); | ||
try { | ||
const { body } = await got.get(`${config.npmRegistry ?? 'https://registry.npmjs.org'}/${config.pjson.name}`); | ||
const { body } = await httpGet(`${config.npmRegistry ?? 'https://registry.npmjs.org'}/${config.pjson.name}1`); | ||
const tags = body['dist-tags']; | ||
@@ -349,0 +367,0 @@ const tag = Object.keys(tags).find((v) => tags[v] === version) ?? channel; |
@@ -99,3 +99,3 @@ { | ||
}, | ||
"version": "4.4.12" | ||
"version": "4.4.13-dev.0" | ||
} |
{ | ||
"name": "@oclif/plugin-update", | ||
"version": "4.4.12", | ||
"version": "4.4.13-dev.0", | ||
"author": "Salesforce", | ||
@@ -13,2 +13,3 @@ "bugs": "https://github.com/oclif/plugin-update/issues", | ||
"got": "^13", | ||
"proxy-agent": "^6.4.0", | ||
"semver": "^7.6.3", | ||
@@ -15,0 +16,0 @@ "tar-fs": "^2.1.1", |
@@ -58,3 +58,3 @@ # @oclif/plugin-update | ||
_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.4.12/src/commands/update.ts)_ | ||
_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.4.13-dev.0/src/commands/update.ts)_ | ||
<!-- commandsstop --> | ||
@@ -61,0 +61,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36120
849
10
1
+ Addedproxy-agent@^6.4.0
+ Added@tootallnate/quickjs-emscripten@0.23.0(transitive)
+ Addedagent-base@7.1.1(transitive)
+ Addedast-types@0.13.4(transitive)
+ Addedbasic-ftp@5.0.5(transitive)
+ Addeddata-uri-to-buffer@6.0.2(transitive)
+ Addeddegenerator@5.0.1(transitive)
+ Addedescodegen@2.1.0(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfs-extra@11.2.0(transitive)
+ Addedget-uri@6.0.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.5(transitive)
+ Addedip-address@9.0.5(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedlru-cache@7.18.3(transitive)
+ Addednetmask@2.0.2(transitive)
+ Addedpac-proxy-agent@7.0.2(transitive)
+ Addedpac-resolver@7.0.1(transitive)
+ Addedproxy-agent@6.4.0(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.8.3(transitive)
+ Addedsocks-proxy-agent@8.0.4(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addeduniversalify@2.0.1(transitive)