heroku-cli-addons
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -12,2 +12,3 @@ 'use strict' | ||
const formatState = util.formatState | ||
const grandfatheredPrice = util.grandfatheredPrice | ||
const printf = require('printf') | ||
@@ -26,3 +27,6 @@ | ||
if (app) { // don't disploy attachments globally | ||
addons = api.get(`/apps/${app}/addons`, {headers: {'Accept-Expansion': 'addon_service,plan'}}) | ||
addons = api.get(`/apps/${app}/addons`, {headers: { | ||
'Accept-Expansion': 'addon_service,plan', | ||
'Accept': 'application/vnd.heroku+json; version=3.with-addon-billing-info' | ||
}}) | ||
@@ -47,3 +51,6 @@ let sudoHeaders = JSON.parse(process.env.HEROKU_HEADERS || '{}') | ||
path: '/addons', | ||
headers: {'Accept-Expansion': 'addon_service,plan'} | ||
headers: { | ||
'Accept-Expansion': 'addon_service,plan', | ||
'Accept': 'application/vnd.heroku+json; version=3.with-addon-billing-info' | ||
} | ||
}) | ||
@@ -72,2 +79,4 @@ } | ||
} | ||
addon.plan.price = grandfatheredPrice(addon) | ||
}) | ||
@@ -74,0 +83,0 @@ |
@@ -6,2 +6,3 @@ 'use strict' | ||
let grandfatheredPrice = require('../../lib/util').grandfatheredPrice | ||
let formatPrice = require('../../lib/util').formatPrice | ||
@@ -14,9 +15,21 @@ let formatState = require('../../lib/util').formatState | ||
return co(function * () { | ||
let addon = yield resolve.addon(api, ctx.app, ctx.args.addon) | ||
let resolvedAddon = yield resolve.addon(api, ctx.app, ctx.args.addon) | ||
addon.attachments = yield api.request({ | ||
method: 'GET', | ||
path: `/addons/${addon.id}/addon-attachments` | ||
}) | ||
// the resolve call uses a variant so we cannot also use the | ||
// with-addon-billing-info in the resolve call so we have to run out | ||
// and grab the addon again, but can bundle with the attachments request | ||
let [addon, attachments] = yield [ | ||
api.get(`/addons/${resolvedAddon.id}`, {headers: { | ||
'Accept-Expansion': 'addon_service,plan', | ||
'Accept': 'application/vnd.heroku+json; version=3.with-addon-billing-info' | ||
}}), | ||
api.request({ | ||
method: 'GET', | ||
path: `/addons/${resolvedAddon.id}/addon-attachments` | ||
}) | ||
] | ||
addon.plan.price = grandfatheredPrice(addon) | ||
addon.attachments = attachments | ||
cli.styledHeader(style('addon', addon.name)) | ||
@@ -23,0 +36,0 @@ cli.styledHash({ |
@@ -26,2 +26,7 @@ 'use strict' | ||
grandfatheredPrice: function (addon) { | ||
const price = addon.plan.price | ||
return Object.assign({}, price, {cents: addon.billed_price_cents}) | ||
}, | ||
formatPrice: function (price) { | ||
@@ -28,0 +33,0 @@ const printf = require('printf') |
{ | ||
"name": "heroku-cli-addons", | ||
"description": "`heroku addons:*` commands", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"author": "Bo Jeanes @bjeanes", | ||
@@ -6,0 +6,0 @@ "bugs": { |
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
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
45264
1145