@heroku-cli/command
Advanced tools
@@ -197,3 +197,3 @@ import { HTTP, HTTPError } from '@heroku/http-call'; | ||
| if (retries > 0) { | ||
| if (opts.retryAuth !== false && error.http.statusCode === 401 && error.body.id === 'unauthorized') { | ||
| if (opts.retryAuth !== false && error.http.statusCode === 401) { | ||
| if (process.env.HEROKU_API_KEY) { | ||
@@ -200,0 +200,0 @@ throw new Error('The token provided to HEROKU_API_KEY is invalid. Please double-check that you have the correct token, or run `heroku login` without HEROKU_API_KEY set.'); |
+1
-0
@@ -9,3 +9,4 @@ export * from './api-client.js'; | ||
| export * from './particleboard-client.js'; | ||
| export * from './prompter.js'; | ||
| export * from './vars.js'; | ||
| export * from './yubikey.js'; |
+1
-0
@@ -9,3 +9,4 @@ export * from './api-client.js'; | ||
| export * from './particleboard-client.js'; | ||
| export * from './prompter.js'; | ||
| export * from './vars.js'; | ||
| export * from './yubikey.js'; |
+0
-1
@@ -7,3 +7,2 @@ import type { Config } from '@oclif/core/interfaces'; | ||
| expiresIn?: number; | ||
| keepExistingSession?: boolean; | ||
| method?: 'browser' | 'interactive' | 'sso'; | ||
@@ -10,0 +9,0 @@ } |
+3
-11
@@ -73,10 +73,2 @@ import { HTTP } from '@heroku/http-call'; | ||
| } | ||
| try { | ||
| if (previousToken && !opts.keepExistingSession) | ||
| await this.logout(previousToken); | ||
| } | ||
| catch (error) { | ||
| const message = error instanceof Error ? error.message : String(error); | ||
| ux.warn(message); | ||
| } | ||
| let auth; | ||
@@ -126,3 +118,3 @@ switch (input) { | ||
| } | ||
| if (error.http.statusCode === 401 && error.http.body && error.http.body.id === 'unauthorized') { | ||
| if (error.http.statusCode === 401) { | ||
| return; | ||
@@ -150,3 +142,3 @@ } | ||
| throw error; | ||
| if (error.http.statusCode === 401 && error.http.body && error.http.body.id === 'unauthorized') { | ||
| if (error.http.statusCode === 401) { | ||
| return []; | ||
@@ -244,3 +236,3 @@ } | ||
| return; | ||
| if (error.http.statusCode === 401 && error.http.body && error.http.body.id === 'unauthorized') | ||
| if (error.http.statusCode === 401) | ||
| return; | ||
@@ -247,0 +239,0 @@ throw error; |
+10
-2
@@ -1,6 +0,14 @@ | ||
| import type { Answers } from 'inquirer'; | ||
| import type { Answers, createPromptModule } from 'inquirer'; | ||
| type StreamOptions = NonNullable<Parameters<typeof createPromptModule>[0]>; | ||
| declare class Prompter { | ||
| prompt<T extends Answers = Answers>(questions: any[]): Promise<T>; | ||
| /** | ||
| * Wraps inquirer's prompt module so that prompt UI (question text, mask | ||
| * characters, cursor escapes) writes to stderr by default. Routing to stdout | ||
| * — inquirer's default — corrupts piped output (e.g. `heroku run … | tee`). | ||
| * | ||
| * Tests can override `input` and/or `output` via the optional second arg. | ||
| */ | ||
| prompt<T extends Answers = Answers>(questions: any[], streamOpts?: StreamOptions): Promise<T>; | ||
| } | ||
| export declare const prompter: Prompter; | ||
| export {}; |
+13
-2
| class Prompter { | ||
| async prompt(questions) { | ||
| /** | ||
| * Wraps inquirer's prompt module so that prompt UI (question text, mask | ||
| * characters, cursor escapes) writes to stderr by default. Routing to stdout | ||
| * — inquirer's default — corrupts piped output (e.g. `heroku run … | tee`). | ||
| * | ||
| * Tests can override `input` and/or `output` via the optional second arg. | ||
| */ | ||
| async prompt(questions, streamOpts = {}) { | ||
| const inquirer = (await import('inquirer')).default; | ||
| return inquirer.prompt(questions); | ||
| const promptModule = inquirer.createPromptModule({ | ||
| output: process.stderr, | ||
| ...streamOpts, | ||
| }); | ||
| return promptModule(questions); | ||
| } | ||
| } | ||
| export const prompter = new Prompter(); |
+1
-1
| { | ||
| "name": "@heroku-cli/command", | ||
| "description": "base class for Heroku CLI commands", | ||
| "version": "13.0.0-beta.3", | ||
| "version": "13.0.0-beta.4", | ||
| "author": "Heroku", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/heroku/heroku-cli-command/issues", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 29 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 29 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
157979
0.29%3675
0.33%