'use strict'

const cli = require('heroku-cli-util')

function getRelease (app) {
  return cli.heroku.request({
    path: `/apps/${app}/releases/new`,
    headers: {Accept: 'application/vnd.heroku+json; version=2'}
  })
}

module.exports = {
  getURL: (app) => getRelease(app).then(release => release.repo_get_url),
  putURL: (app) => getRelease(app).then(release => release.repo_put_url),
  getCacheURL: (app) => getRelease(app).then(release => release.cache_get_url),
  putCacheURL: (app) => getRelease(app).then(release => release.cache_put_url)
}

@@ -133,20 +133,22 @@
 pp%7D/
-releases/new
+build-metadata
 %60,%0A 
@@ -210,9 +210,24 @@
 ion=
-2
+3.build-metadata
 '%7D%0A 

use v3 of the API instead of v2