@gregoriusrippenstein/node-red-contrib-introspection 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ module.exports = function(RED) {
11
11
 
12
12
  node.on("input", function(msg, send, done) {
13
13
  var sendFlow = (hdrs, got) => {
14
- got.post( cfg.hostUrl + "/flows", {
14
+ got.post( (cfg.hostUrl || msg.hostUrl) + "/flows", {
15
15
  headers: {
16
16
  "Node-RED-API-Version": cfg.flowVersion,
17
17
  "Content-type": "application/json",
@@ -20,8 +20,6 @@ module.exports = function(RED) {
20
20
  },
21
21
  body: JSON.stringify(msg.payload)
22
22
  }).then( res => {
23
- var bodySize = res.body.length;
24
-
25
23
  send({
26
24
  ...msg,
27
25
  payload: res.body
@@ -72,7 +70,7 @@ module.exports = function(RED) {
72
70
  }
73
71
 
74
72
  import('got').then( (module) => {
75
- module.got.post( cfg.hostUrl + "/auth/token", {
73
+ module.got.post( (cfg.hostUrl || msg.hostUrl) + "/auth/token", {
76
74
  json: data
77
75
  }).then( res => {
78
76
  node.status({
@@ -40,7 +40,7 @@ module.exports = function(RED) {
40
40
  return node.error("msg.payload not well defined", msg)
41
41
  }
42
42
 
43
- got.post( cfg.hostUrl + "/nodes", {
43
+ got.post( (cfg.hostUrl || msg.hostUrl) + "/nodes", {
44
44
  headers: {
45
45
  ...headers,
46
46
  ...hdrs
@@ -97,7 +97,7 @@ module.exports = function(RED) {
97
97
  }
98
98
 
99
99
  import('got').then( (module) => {
100
- module.got.post( cfg.hostUrl + "/auth/token", {
100
+ module.got.post( (cfg.hostUrl || msg.hostUrl) + "/auth/token", {
101
101
  json: data
102
102
  }).then( res => {
103
103
  node.status({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",