node-red-contrib-remote 1.5.1 → 1.5.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.
package/README.md CHANGED
@@ -36,9 +36,12 @@ You will find more information on [www.remote-red-com](https://www.remote-red.co
36
36
 
37
37
  ## Version History
38
38
 
39
+ Version 1.5.2
40
+ - Compatibility to 'node-red-contrib-remote-cli'
41
+
39
42
  Version 1.5.1
40
43
  - Added support for running Node-RED with a self signed https certificate.
41
- - Notifications and Questions will automatically convert values to string if a string is needed (e.g. title and body).
44
+ - Notifications and Questions will automatically convert values to string if a string is needed (e.g. title and body).
42
45
 
43
46
  Version 1.5.0
44
47
  - Geofencing! You can add geofences in the apps. Entering and leaving them will trigger a message on the new output of the remote access node.
@@ -34,11 +34,22 @@ module.exports = function(RED) {
34
34
  res.json(ipData);
35
35
  });
36
36
 
37
- RED.httpAdmin.get("/contrib-remote/requestInstanceHash/:region", RED.auth.needsPermission('remote-config.read'), function(req,res) {
37
+ RED.httpAdmin.get("/contrib-remote/requestInstanceHash/:regionorserver", RED.auth.needsPermission('remote-config.read'), function(req,res) {
38
38
  // Call API for a instacehash and a instanceauth
39
39
  const axiosInstance = commons.createAxiosInstance();
40
- console.log('https://contact-' + req.params.region + '.remote-red.com/instanceHashRequest')
41
- axiosInstance.post('https://contact-' + req.params.region + '.remote-red.com/instanceHashRequest', {})
40
+
41
+ // Region or server?
42
+ let url = '';
43
+ if (req.params.regionorserver.includes('.')) {
44
+ // server
45
+ url = 'https://api-' + req.params.regionorserver + '/instanceHashRequest';
46
+ } else {
47
+ // region
48
+ url = 'https://contact-' + req.params.regionorserver + '.remote-red.com/instanceHashRequest';
49
+ }
50
+
51
+ // Call API
52
+ axiosInstance.post(url, {})
42
53
  .then(response => {
43
54
  res.json(response.data);
44
55
  })
@@ -56,11 +67,12 @@ module.exports = function(RED) {
56
67
  });
57
68
 
58
69
  RED.httpAdmin.post("/contrib-remote/registerApp", RED.auth.needsPermission('remote-config.read'), function(req,res) {
59
- // Call API for a instacehash and a instanceauth
70
+ // Call API for a appHash and password
60
71
  const axiosInstance = commons.createAxiosInstance();
61
72
  axiosInstance.post(`https://api-${req.body.server}/registerApp`, {
62
73
  'instancehash': req.body.instancehash,
63
- 'instanceauth': req.body.instanceauth
74
+ 'instanceauth': req.body.instanceauth,
75
+ 'customerhash': req.body.customerhash
64
76
  })
65
77
  .then(response => {
66
78
  var localip = req.body.host;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-remote",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Remote-RED is an ecosystem to bring remote access, push notification and geofencing to Node-RED. There are also additional functions like directly answer on a notification and homescreen widgets.",
5
5
  "author": "Thorsten Heilmann",
6
6
  "license": "GPL-3.0",