heroku-cli-addons
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -8,3 +8,3 @@ 'use strict' | ||
let app = context.app | ||
let addon = yield heroku.get(`/addons/${context.args.addon_name}`) | ||
let addon = yield heroku.get(`/addons/${encodeURIComponent(context.args.addon_name)}`) | ||
@@ -11,0 +11,0 @@ function createAttachment (app, as, confirm) { |
@@ -81,3 +81,3 @@ 'use strict' | ||
// find the add-on to be changed | ||
addon = yield resolver.addon(heroku, app, name).catch((e) => handleAPIError(e)) | ||
addon = yield resolver.addon(h, app, name).catch((e) => handleAPIError(e)) | ||
@@ -84,0 +84,0 @@ service = addon.addon_service.name |
@@ -12,2 +12,4 @@ 'use strict' | ||
require('./commands/addons/detach'), | ||
require('./commands/addons/destroy').destroy, | ||
require('./commands/addons/destroy').remove, | ||
require('./commands/addons/docs'), | ||
@@ -14,0 +16,0 @@ require('./commands/addons/info'), |
@@ -6,19 +6,17 @@ 'use strict' | ||
exports.addon = memoize(function (heroku, app, id, headers) { | ||
headers = headers || {} | ||
let getAddon = function (id) { | ||
return heroku.request({ | ||
path: `/addons/${encodeURIComponent(id)}`, | ||
headers: headers || {} | ||
}) | ||
return heroku.get(`/addons/${encodeURIComponent(id)}`, {headers}) | ||
} | ||
if (!app || id.indexOf('::') !== -1) return getAddon(id) | ||
return heroku.request({ | ||
path: `/apps/${app}/addons/${encodeURIComponent(id)}`, | ||
headers: headers || {} | ||
}).catch(function (err) { if (err.statusCode === 404) return getAddon(id); else throw err }) | ||
}) | ||
return heroku.get(`/apps/${app}/addons/${encodeURIComponent(id)}`, {headers}) | ||
.catch(function (err) { if (err.statusCode === 404) return getAddon(id); else throw err }) | ||
}, (_, app, id) => `${app}-${id}`) | ||
exports.attachment = function (heroku, app, id) { | ||
exports.attachment = function (heroku, app, id, headers) { | ||
headers = headers || {} | ||
function getAttachment (id) { | ||
return heroku.get(`/addon-attachments/${encodeURIComponent(id)}`) | ||
return heroku.get(`/addon-attachments/${encodeURIComponent(id)}`, {headers}) | ||
.catch(function (err) { if (err.statusCode !== 404) throw err }) | ||
@@ -29,3 +27,3 @@ } | ||
if (!app || id.indexOf('::') !== -1) return getAttachment(id) | ||
return heroku.get(`/apps/${app}/addon-attachments/${encodeURIComponent(id)}`) | ||
return heroku.get(`/apps/${app}/addon-attachments/${encodeURIComponent(id)}`, {headers}) | ||
.catch(function (err) { if (err.statusCode !== 404) throw err }) | ||
@@ -35,3 +33,3 @@ } | ||
function getAppAddonAttachment (addon, app) { | ||
return heroku.get(`/addons/${encodeURIComponent(addon.id)}/addon-attachments`) | ||
return heroku.get(`/addons/${encodeURIComponent(addon.id)}/addon-attachments`, {headers}) | ||
.then((attachments) => attachments.find((att) => att.app.name === app)) | ||
@@ -38,0 +36,0 @@ } |
{ | ||
"name": "heroku-cli-addons", | ||
"description": "`heroku addons:*` commands", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "Bo Jeanes @bjeanes", | ||
@@ -11,3 +11,3 @@ "bugs": { | ||
"co": "4.6.0", | ||
"heroku-cli-util": "6.0.11", | ||
"heroku-cli-util": "6.0.14", | ||
"lodash.groupby": "4.4.0", | ||
@@ -18,4 +18,5 @@ "lodash.memoize": "4.1.0", | ||
"lodash.sortby": "4.5.0", | ||
"lodash.topairs": "4.1.1", | ||
"lodash.values": "4.1.0", | ||
"printf": "0.2.3" | ||
"printf": "0.2.5" | ||
}, | ||
@@ -25,9 +26,8 @@ "devDependencies": { | ||
"codeclimate-test-reporter": "0.3.3", | ||
"coveralls": "2.11.9", | ||
"mocha": "^2.2.5", | ||
"nock": "8.0.0", | ||
"nyc": "6.6.1", | ||
"nyc": "7.0.0", | ||
"standard": "7.1.2", | ||
"time-require": "0.1.2", | ||
"unexpected": "10.13.3" | ||
"unexpected": "10.15.0" | ||
}, | ||
@@ -42,3 +42,2 @@ "homepage": "https://github.com/heroku/heroku-cli-addons", | ||
"scripts": { | ||
"coverage": "nyc report --reporter=text-lcov | codeclimate-test-reporter && nyc report --reporter=text-lcov | coveralls", | ||
"postversion": "npm publish && git push && git push --tags", | ||
@@ -45,0 +44,0 @@ "preversion": "npm test", |
# heroku-cli-addons [![Circle CI](https://circleci.com/gh/heroku/heroku-cli-addons.svg?style=svg)](https://circleci.com/gh/heroku/heroku-cli-addons) | ||
[![Code Climate](https://codeclimate.com/github/heroku/heroku-cli-addons/badges/gpa.svg)](https://codeclimate.com/github/heroku/heroku-cli-addons) | ||
[![Test Coverage](https://codeclimate.com/github/heroku/heroku-cli-addons/badges/coverage.svg)](https://codeclimate.com/github/heroku/heroku-cli-addons/coverage) | ||
[![codecov](https://codecov.io/gh/heroku/heroku-cli-addons/branch/master/graph/badge.svg)](https://codecov.io/gh/heroku/heroku-cli-addons) | ||
[![npm version](https://badge.fury.io/js/heroku-cli-addons.svg)](https://badge.fury.io/js/heroku-cli-addons) | ||
@@ -6,0 +6,0 @@ [![License](https://img.shields.io/github/license/heroku/heroku-cli-addons.svg)](https://github.com/heroku/heroku-cli-addons/blob/master/LICENSE) |
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
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
34407
8
20
819
10
5
+ Addedlodash.topairs@4.1.1
+ Addedheroku-cli-util@6.0.14(transitive)
+ Addedlodash.topairs@4.1.1(transitive)
+ Addedprintf@0.2.5(transitive)
- Removedheroku-cli-util@6.0.11(transitive)
- Removedprintf@0.2.3(transitive)
Updatedheroku-cli-util@6.0.14
Updatedprintf@0.2.5