@heroku-cli/plugin-run
Advanced tools
Comparing version 3.5.13 to 3.5.14
@@ -1,1 +0,1 @@ | ||
{"version":"3.5.13","commands":{"console":{"id":"console","description":"\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run:detached":{"id":"run:detached","description":"run a detached dyno, where output is sent to your logs\nExample:\n\n $ heroku run:detached ls\n Running ls on app [detached]... up, run.1\n Run heroku logs -a app -p run.1 to view the output.\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"tail":{"name":"tail","type":"boolean","char":"t","description":"stream logs from the dyno","required":false},"type":{"name":"type","type":"option","description":"process type","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run:inside":{"id":"run:inside","description":"run a one-off process inside an existing heroku dyno\nExamples:\n\n $ heroku run:inside web.1 bash\n Running bash on web.1.... up\n ~ $\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"exit-code":{"name":"exit-code","type":"boolean","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","description":"environment variables to set (use ';' to split multiple vars)","required":false},"listen":{"name":"listen","type":"boolean","description":"listen on a local port","hidden":true,"required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"logs":{"id":"logs","description":"display recent log output\nExample:\n\n $ heroku logs\n 2012-01-01T12:00:00+00:00 heroku[api]: Config add EXAMPLE by email@example.com\n 2012-01-01T12:00:01+00:00 heroku[api]: Release v1 created by email@example.com\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"num":{"name":"num","type":"option","char":"n","description":"number of lines to display","required":false},"ps":{"name":"ps","type":"option","char":"p","description":"hidden alias for dyno","hidden":true,"required":false},"dyno":{"name":"dyno","type":"option","char":"d","description":"dyno to limit filter by","required":false},"source":{"name":"source","type":"option","char":"s","description":"log source to limit filter by","required":false},"tail":{"name":"tail","type":"boolean","char":"t","description":"continually stream logs","required":false},"force-colors":{"name":"force-colors","type":"boolean","description":"force use of colors (even on non-tty output)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"rake":{"id":"rake","description":"\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"exit-code":{"name":"exit-code","type":"boolean","char":"x","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"no-tty":{"name":"no-tty","type":"boolean","description":"force the command to not run in a tty","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run":{"id":"run","description":"run a one-off process inside a heroku dyno\nExamples:\n\n $ heroku run bash\n Running bash on app.... up, run.1\n ~ $\n\n $ heroku run -s hobby -- myscript.sh -a arg1 -s arg2\n Running myscript.sh -a arg1 -s arg2 on app.... up, run.1\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"type":{"name":"type","type":"option","description":"process type","required":false},"exit-code":{"name":"exit-code","type":"boolean","char":"x","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"no-tty":{"name":"no-tty","type":"boolean","description":"force the command to not run in a tty","required":false},"listen":{"name":"listen","type":"boolean","description":"listen on a local port","hidden":true,"required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]}}} | ||
{"version":"3.5.14","commands":{"console":{"id":"console","description":"\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run:detached":{"id":"run:detached","description":"run a detached dyno, where output is sent to your logs\nExample:\n\n $ heroku run:detached ls\n Running ls on app [detached]... up, run.1\n Run heroku logs -a app -p run.1 to view the output.\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"tail":{"name":"tail","type":"boolean","char":"t","description":"stream logs from the dyno","required":false},"type":{"name":"type","type":"option","description":"process type","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run:inside":{"id":"run:inside","description":"run a one-off process inside an existing heroku dyno\nExamples:\n\n $ heroku run:inside web.1 bash\n Running bash on web.1.... up\n ~ $\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"exit-code":{"name":"exit-code","type":"boolean","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","description":"environment variables to set (use ';' to split multiple vars)","required":false},"listen":{"name":"listen","type":"boolean","description":"listen on a local port","hidden":true,"required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"logs":{"id":"logs","description":"display recent log output\nExample:\n\n $ heroku logs\n 2012-01-01T12:00:00+00:00 heroku[api]: Config add EXAMPLE by email@example.com\n 2012-01-01T12:00:01+00:00 heroku[api]: Release v1 created by email@example.com\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"num":{"name":"num","type":"option","char":"n","description":"number of lines to display","required":false},"ps":{"name":"ps","type":"option","char":"p","description":"hidden alias for dyno","hidden":true,"required":false},"dyno":{"name":"dyno","type":"option","char":"d","description":"dyno to limit filter by","required":false},"source":{"name":"source","type":"option","char":"s","description":"log source to limit filter by","required":false},"tail":{"name":"tail","type":"boolean","char":"t","description":"continually stream logs","required":false},"force-colors":{"name":"force-colors","type":"boolean","description":"force use of colors (even on non-tty output)","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"rake":{"id":"rake","description":"\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":true,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"exit-code":{"name":"exit-code","type":"boolean","char":"x","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"no-tty":{"name":"no-tty","type":"boolean","description":"force the command to not run in a tty","required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]},"run":{"id":"run","description":"run a one-off process inside a heroku dyno\nExamples:\n\n $ heroku run bash\n Running bash on app.... up, run.1\n ~ $\n\n $ heroku run -s hobby -- myscript.sh -a arg1 -s arg2\n Running myscript.sh -a arg1 -s arg2 on app.... up, run.1\n","pluginName":"@heroku-cli/plugin-run","pluginType":"core","hidden":false,"aliases":[],"flags":{"size":{"name":"size","type":"option","char":"s","description":"dyno size","required":false},"type":{"name":"type","type":"option","description":"process type","required":false},"exit-code":{"name":"exit-code","type":"boolean","char":"x","description":"passthrough the exit code of the remote command","required":false},"env":{"name":"env","type":"option","char":"e","description":"environment variables to set (use ';' to split multiple vars)","required":false},"no-tty":{"name":"no-tty","type":"boolean","description":"force the command to not run in a tty","required":false},"listen":{"name":"listen","type":"boolean","description":"listen on a local port","hidden":true,"required":false},"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"remote":{"name":"remote","type":"option","char":"r","description":"git remote of app to use"}},"args":[]}}} |
'use strict' | ||
let cli = require('heroku-cli-util') | ||
let EventSource = require('eventsource') | ||
let url = require('url') | ||
let liner = require('../lib/line_transform') | ||
@@ -43,2 +45,11 @@ | ||
function readLogs (logplexURL) { | ||
let u = url.parse(logplexURL) | ||
if (u.query && u.query.includes('srv')) { | ||
return readLogsV1(logplexURL) | ||
} else { | ||
return readLogsV2(logplexURL) | ||
} | ||
} | ||
function readLogsV1 (logplexURL) { | ||
return new Promise(function (resolve, reject) { | ||
@@ -55,2 +66,33 @@ let res = cli.got.stream(logplexURL) | ||
function readLogsV2 (logplexURL) { | ||
return new Promise(function (resolve, reject) { | ||
let u = url.parse(logplexURL, true) | ||
let isTail = u.query.tail && u.query.tail === 'true' | ||
let userAgent = process.env.HEROKU_DEBUG_USER_AGENT || 'heroku-run' | ||
let es = new EventSource(logplexURL, { | ||
headers: { | ||
'User-Agent': userAgent | ||
} | ||
}) | ||
es.onerror = function (err) { | ||
if (!isTail) { | ||
resolve() | ||
es.close() | ||
} | ||
if (err && (err.status === 404 || err.status === 403)) { | ||
reject(new Error('Log stream timed out. Please try again.')) | ||
es.close() | ||
} | ||
} | ||
es.onmessage = function (e) { | ||
e.data.trim().split(/\n+/).forEach((line) => { | ||
cli.log(colorize(line)) | ||
}) | ||
} | ||
}) | ||
} | ||
function logDisplayer (heroku, options) { | ||
@@ -57,0 +99,0 @@ process.stdout.on('error', () => process.exit(1)) |
{ | ||
"name": "@heroku-cli/plugin-run", | ||
"description": "Heroku CLI plugin to run one-off dyno processes.", | ||
"version": "3.5.13", | ||
"version": "3.5.14", | ||
"author": "Jeff Dickey (@dickeyxxx)", | ||
@@ -22,2 +22,3 @@ "bugs": { | ||
"co": "4.6.0", | ||
"eventsource": "^1.0.5", | ||
"fs-extra": "^5.0.0", | ||
@@ -24,0 +25,0 @@ "heroku-cli-util": "^8.0.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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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 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
33833
673
6
5
5
+ Addedeventsource@^1.0.5
+ Addedeventsource@1.1.2(transitive)