heroku-connect-plugin
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -9,12 +9,2 @@ 'use strict' | ||
let US_HOST = regions.prodRegionsMap.virginia | ||
let EU_HOST = regions.prodRegionsMap.dublin | ||
if (process.env['CONNECT_ADDON'] === 'connectqa') { | ||
US_HOST = regions.qaRegionsMap.virginia | ||
EU_HOST = regions.qaRegionsMap.dublin | ||
} | ||
let PORT = 443 | ||
exports.HOST = US_HOST | ||
exports.printResponseError = function (response) { | ||
@@ -48,3 +38,2 @@ console.log('Status code = ', response.statusCode, 'body = ', response.json) | ||
hostname: hostname, | ||
port: PORT, | ||
path: path, | ||
@@ -118,20 +107,3 @@ method: method, | ||
let response = yield request(context, 'GET', '/api/v3/connections', {deep: true, app: appName, resource_id: flags.resource_id}) | ||
return co(function * () { | ||
let connections = response.json.results | ||
if (connections.length === 0 && exports.HOST !== EU_HOST && heroku) { | ||
// Nothing found in the US, check again in the EU | ||
let app = yield heroku.apps(appName).info() | ||
if (app.region.name === 'eu') { | ||
let connections = yield withUserConnections(context, appName, flags, allowNone, heroku) | ||
return yield Promise.resolve(connections) | ||
} else { | ||
exports.HOST = US_HOST | ||
return yield Promise.resolve(connections) | ||
} | ||
} else { | ||
return yield Promise.resolve(connections) | ||
} | ||
}) | ||
return yield Promise.resolve(response.json.results) | ||
}) | ||
@@ -138,0 +110,0 @@ |
@@ -15,2 +15,5 @@ 'use strict' | ||
}) | ||
// Also map Cedar-based regions to the right places | ||
qaRegionsMap['us'] = `hc-qa-virginia.herokai.com` | ||
qaRegionsMap['eu'] = `hc-qa-dublin.herokai.com` | ||
@@ -44,3 +47,7 @@ exports.prodRegions = prodRegions | ||
exports.urlFromRegion = regionName => prodRegionsMap[regionName] | ||
if (process.env['CONNECT_ADDON'] === 'connectqa') { | ||
exports.urlFromRegion = regionName => qaRegionsMap[regionName] | ||
} else { | ||
exports.urlFromRegion = regionName => prodRegionsMap[regionName] | ||
} | ||
@@ -47,0 +54,0 @@ exports.requireRegion = function (fn) { |
{ | ||
"name": "heroku-connect-plugin", | ||
"description": "Heroku Connect plugin for Heroku Toolbelt", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"author": "Heroku (@heroku)", | ||
@@ -6,0 +6,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
91802
846