@5minds/node-red-contrib-processcube-elasticsearch 0.2.0-develop-3ee190-m3h6d1f1 → 0.2.0-feature-4d4e37-m3fm4udz

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.
@@ -10,22 +10,42 @@ module.exports = function (RED) {
10
10
  let transports = [];
11
11
 
12
12
  // Elastic settings
13
- let url = RED.util.evaluateNodeProperty(config.url, config.urlType, this);
13
+ let url = "";
14
+ if(config.urlType == "global"){
15
+ url = this.context().global.get(config.url);
16
+ } else {
17
+ url = config.url;
18
+ }
14
19
  if (url == "") {
15
20
  this.error("Elastic search url is not set");
16
21
  }
17
22
 
18
- let user = RED.util.evaluateNodeProperty(this.credentials.username, config.usernameType, this);
23
+ let user = "";
24
+ if(config.usernameType == "global") {
25
+ user = this.context().global.get(this.credentials.username);
26
+ } else {
27
+ user = this.credentials.username;
28
+ }
19
29
  if (user == "") {
20
30
  this.error("Elastic search username is not set");
21
31
  }
22
32
 
23
- let password = RED.util.evaluateNodeProperty(this.credentials.password, config.passwordType, this);
33
+ let password = "";
34
+ if(config.passwordType == "global") {
35
+ password = this.context().global.get(this.credentials.password);
36
+ } else {
37
+ password = this.credentials.password;
38
+ }
24
39
  if (password == "") {
25
40
  this.error("Elastic search password is not set");
26
41
  }
27
42
 
28
- let index = RED.util.evaluateNodeProperty(this.credentials.index, config.indexType, this);
43
+ let index = "";
44
+ if(config.indexType == "global") {
45
+ index = this.context().global.get(this.credentials.index);
46
+ } else {
47
+ index = this.credentials.index;
48
+ }
29
49
  if (index == "") {
30
50
  this.error("Elastic search index is not set");
31
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube-elasticsearch",
3
- "version": "0.2.0-develop-3ee190-m3h6d1f1",
3
+ "version": "0.2.0-feature-4d4e37-m3fm4udz",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for Elasticsearch",
6
6
  "scripts": {