Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-connect-plugin

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-connect-plugin - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/commands/connect/mapping.js

2

index.js

@@ -9,6 +9,8 @@ 'use strict';

require('./lib/commands/connect/status'),
require('./lib/commands/connect/state'),
require('./lib/commands/connect/preauth'),
require('./lib/commands/connect/setup'),
require('./lib/commands/connect/mapping'),
require('./lib/commands/connect/create-mapping'),
require('./lib/commands/connect/delete-mapping')
];

@@ -29,6 +29,16 @@ 'use strict';

let data = {schema_name:schema, db_key:db};
if (context.flags.token) {
data.preauth_token = context.flags.token;
}
api.withUserConnections(context.auth.password, context.app, context.flags).then(function(connections){
connections.forEach(function(connection) {
connection_info(connection);
console.log("");
if (connection.state == 'NEW') {
console.log("Configuring connection with\n", data);
api.request(context.auth.password, 'PATCH', '/api/v3/connections/' + connection.guid, data).then(function(response) {
console.log("Patch result ", response.json);
});
} else {
console.log("Connection ", connection, " already in state: ", connection.state);
}
});

@@ -35,0 +45,0 @@ });

@@ -5,5 +5,16 @@ var https = require('https');

var HOST = 'dev-herokuconnect.herokuapp.com';
var HOST = 'connect.heroku.com';
var ADDON = 'herokuconnect';
var PORT = 443;
var global_config = exports.global_config = function(context) {
if (process.env['CONNECT_ADDON'] === 'connectqa') {
var last_host = HOST;
HOST = 'dev-herokuconnect.herokuapp.com';
ADDON = 'connectqa';
if (HOST != last_host) {
console.error("Using " + HOST + "...");
}
}
}

@@ -26,3 +37,3 @@ var printResponseError = exports.printResponseError = function(response){

// add data to body for POST/PUT requests
if (data !== undefined && ['POST', 'PUT'].indexOf(method) !== -1) {
if (data !== undefined && ['POST', 'PUT', 'PATCH'].indexOf(method) !== -1) {
withBody = true;

@@ -82,2 +93,4 @@ data = JSON.stringify(data);

exports.withUser = function(token) {
global_config();
return request(token, 'GET', '/api/v3/users/me').then(function(response) {

@@ -93,2 +106,4 @@ return Q.Promise(function(resolve, reject) {

var withUserConnections = exports.withUserConnections = function(token, appName, flags){
global_config();
var resource_name = null;

@@ -119,2 +134,4 @@ if (flags && flags.resource) {

exports.withUserConnection = function(token, appName, connectionId){
global_config();
return withUserInstance(token, appName).then(function(instance){

@@ -136,2 +153,4 @@ var connections = instance.connections;

exports.withRequiredFields = function(token, connectionId, objectName){
global_config();
return request(token, 'GET', '/api/v2/connections/' + connectionId + '/schemas/' + objectName).then(function(response){

@@ -150,2 +169,4 @@ var requiredFields = [];

exports.withConnectionMappings = function(token, connectionId) {
global_config();
return request(token, 'GET', '/api/v2/connections/' + connectionId + '/mappings').then(function(response){

@@ -152,0 +173,0 @@ return Q.Promise(function(resolve, reject){

@@ -15,2 +15,3 @@ 'use strict';

command: 'status',
default: true,
description: 'display connection status information',

@@ -17,0 +18,0 @@ help: 'display connection status information',

2

package.json
{
"name": "heroku-connect-plugin",
"description": "Minimal Heroku Connect plugin for Heroku Toolbelt",
"version": "0.0.2",
"version": "0.0.3",
"author": "Scott Persinger @persingerscott",

@@ -6,0 +6,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc