Skip to content

Commit 4f9e03d

Browse files
committed
1.3.37, fixup node paramaters
1 parent 343817e commit 4f9e03d

4 files changed

Lines changed: 42 additions & 36 deletions

File tree

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.36",
3+
"version": "1.3.37",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

OpenFlowNodeRED/src/nodered/nodes/api.html

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<script type="text/javascript">
22
function validate(name) {
33
return function () {
4-
54
if (this[name] == null || this[name] == "") {
6-
console.log(this.type, "false: value null");
5+
console.log(this.type, name + " false: value null");
76
if (name == "entities" && this.inputfield != null) { this[name] = this.inputfield; return true; }
87
return false;
98
}
10-
if (this[name + "type"] == null || this[name + "type"] == "") {
11-
console.log(this.type, "false: type null");
12-
return false;
13-
}
9+
// if (this[name + "type"] == null || this[name + "type"] == "") {
10+
// console.log(this.type, name + " false: type null");
11+
// return false;
12+
// }
1413
return RED.validators.typedInput(name);
1514
}
1615
}
@@ -142,7 +141,7 @@
142141
name: { value: "" },
143142
query: { value: "", validate: validate("querytype") },
144143
querytype: { value: "" },
145-
projection: { value: "", validate: RED.validators.typedInput("projectiontype") },
144+
projection: { value: "", validate: validate("projectiontype") },
146145
projectiontype: { value: "" },
147146
top: { value: 500, validate: validate("toptype"), required: true },
148147
toptype: { value: "" },
@@ -162,43 +161,43 @@
162161
return this.name ? "node_label_italic" : "";
163162
},
164163
oneditprepare: function () {
165-
if (this.skipquerytype === 'val') $("#node-input-querytype").val('str');
164+
if (this.querytype === null) $("#node-input-querytype").val('str');
166165
$("#node-input-query").typedInput({
167166
default: 'str',
168167
typeField: $("#node-input-querytype"),
169168
types: ['msg', 'str', 'flow', 'global', 'json']
170169
});
171-
if (this.projectiontype === 'val') $("#node-input-projectiontype").val('str');
170+
if (this.projectiontype === null) $("#node-input-projectiontype").val('str');
172171
$("#node-input-projection").typedInput({
173172
default: 'str',
174173
typeField: $("#node-input-projectiontype"),
175174
types: ['msg', 'str', 'flow', 'global', 'json']
176175
});
177-
if (this.orderbytype === 'val') $("#node-input-orderbytype").val('str');
176+
if (this.orderbytype === null) $("#node-input-orderbytype").val('str');
178177
$("#node-input-orderby").typedInput({
179178
default: 'str',
180179
typeField: $("#node-input-orderbytype"),
181180
types: ['msg', 'str', 'flow', 'global', 'json']
182181
});
183-
if (this.collectiontype === 'val') $("#node-input-collectiontype").val('str');
182+
if (this.collectiontype === null) $("#node-input-collectiontype").val('str');
184183
$("#node-input-collection").typedInput({
185184
default: 'str',
186185
typeField: $("#node-input-collectiontype"),
187186
types: ['msg', 'str', 'flow', 'global', 'json']
188187
});
189-
if (this.toptype === 'val') $("#node-input-toptype").val('str');
188+
if (this.toptype === null) $("#node-input-toptype").val('num');
190189
$("#node-input-top").typedInput({
191190
default: 'num',
192191
typeField: $("#node-input-toptype"),
193192
types: ['msg', 'num', 'flow', 'global']
194193
});
195-
if (this.skiptype === 'val') $("#node-input-skiptype").val('str');
194+
if (this.skiptype === null) $("#node-input-skiptype").val('num');
196195
$("#node-input-skip").typedInput({
197196
default: 'num',
198197
typeField: $("#node-input-skiptype"),
199198
types: ['msg', 'num', 'flow', 'global']
200199
});
201-
if (this.resultfieldtype === 'val') $("#node-input-resultfieldtype").val('str');
200+
if (this.resultfieldtype === null) $("#node-input-resultfieldtype").val('msg');
202201
$("#node-input-resultfield").typedInput({
203202
default: 'msg',
204203
typeField: $("#node-input-resultfieldtype"),
@@ -266,11 +265,9 @@
266265
writeconcern: { value: "0", required: true },
267266
journal: { value: "false", required: true },
268267
collection: { value: "entities", validate: validate("collection") },
269-
// collection: { value: "entities", validate: RED.validators.typedInput("collection"), required: true },
270268
collectiontype: { value: "" },
271269
entitiestype: { value: "" },
272270
entities: { value: "payload", validate: validate("entities") },
273-
// entities: { value: "payload", validate: RED.validators.typedInput("entities"), required: true },
274271
entitiestype: { value: "" },
275272
entitytype: { value: "" },
276273
entitytypetype: { value: "" },
@@ -473,6 +470,9 @@
473470
entitiestype: { value: "" },
474471
writeconcern: { value: "0", required: true },
475472
journal: { value: "false", required: true },
473+
474+
inputfield: { value: "" },
475+
resultfield: { value: "" }
476476
},
477477
inputs: 1,
478478
outputs: 1,
@@ -579,6 +579,9 @@
579579
entitiestype: { value: "" },
580580
uniqeness: { value: "", validate: validate("uniqenesstype") },
581581
uniqenesstype: { value: "" },
582+
583+
resultfield: { value: "" },
584+
inputfield: { value: "" },
582585
},
583586
inputs: 1,
584587
outputs: 1,
@@ -652,10 +655,13 @@
652655
icon: "font-awesome/fa-trash",
653656
defaults: {
654657
name: { value: "" },
655-
collection: { value: "entities", validate: RED.validators.typedInput("collection"), required: true },
658+
collection: { value: "entities", validate: validate("collection"), required: true },
656659
collectiontype: { value: "" },
657-
entities: { value: "payload", validate: RED.validators.typedInput("entities"), required: true },
660+
entities: { value: "payload", validate: validate("entities"), required: true },
658661
entitiestype: { value: "" },
662+
663+
resultfield: { value: "" },
664+
inputfield: { value: "" },
659665
},
660666
inputs: 1,
661667
outputs: 1,
@@ -673,10 +679,10 @@
673679
types: ['msg', 'str', 'flow', 'global']
674680
});
675681

676-
if (this.inputfieldtype === 'val') $("#node-input-inputfieldtype").val('str');
677-
$("#node-input-inputfield").typedInput({
682+
if (this.entitiestype === 'val') $("#node-input-entitiestype").val('str');
683+
$("#node-input-entities").typedInput({
678684
default: 'msg',
679-
typeField: $("#node-input-inputfieldtype"),
685+
typeField: $("#node-input-entitiestype"),
680686
types: ['msg']
681687
});
682688

@@ -718,9 +724,9 @@
718724
icon: "font-awesome/fa-trash",
719725
defaults: {
720726
name: { value: "" },
721-
query: { value: "payload", validate: RED.validators.typedInput("querytype"), required: true },
727+
query: { value: "payload", validate: validate("querytype"), required: true },
722728
querytype: { value: "" },
723-
collection: { value: "entities", validate: RED.validators.typedInput("collectiontype"), required: true },
729+
collection: { value: "entities", validate: validate("collectiontype"), required: true },
724730
collectiontype: { value: "" },
725731
},
726732
inputs: 1,
@@ -1315,12 +1321,12 @@
13151321
writeconcern: { value: "0", required: true },
13161322
journal: { value: "false", required: true },
13171323
action: { value: "updateOne", required: true },
1318-
collection: { value: "entities", validate: RED.validators.typedInput("collectiontype"), required: true },
1324+
collection: { value: "entities", validate: validate("collectiontype"), required: true },
13191325
collectiontype: { value: "" },
1320-
query: { value: "", validate: RED.validators.typedInput("querytype"), required: true },
1326+
query: { value: "", validate: validate("querytype"), required: true },
13211327
querytype: { value: "" },
13221328

1323-
updatedocument: { value: "{ \"$inc\": { \"count\": 1}}", validate: RED.validators.typedInput("updatedocumenttype"), required: true },
1329+
updatedocument: { value: "{ \"$inc\": { \"count\": 1}}", validate: validate("updatedocumenttype"), required: true },
13241330
updatedocumenttype: { value: "" },
13251331
},
13261332
inputs: 1,
@@ -1396,10 +1402,10 @@
13961402
icon: "font-awesome/fa-bar-chart",
13971403
defaults: {
13981404
name: { value: "" },
1399-
aggregates: { value: "[ {\"$group\" : {\"_id\":\"$_type\", \"count\":{\"$sum\":1}} } ]", validate: RED.validators.typedInput("aggregatestype"), required: true },
1405+
aggregates: { value: "[ {\"$group\" : {\"_id\":\"$_type\", \"count\":{\"$sum\":1}} } ]", validate: validate("aggregatestype"), required: true },
14001406
aggregatestype: { value: "" },
14011407

1402-
collection: { value: "entities", validate: RED.validators.typedInput("collectiontype"), required: true },
1408+
collection: { value: "entities", validate: validate("collectiontype"), required: true },
14031409
collectiontype: { value: "" },
14041410

14051411
},
@@ -1462,9 +1468,9 @@
14621468
paletteLabel: 'download',
14631469
icon: "font-awesome/fa-download",
14641470
defaults: {
1465-
fileid: { value: "", validate: RED.validators.typedInput("fileidtype") },
1471+
fileid: { value: "", validate: validate("fileidtype") },
14661472
fileidtype: { value: "" },
1467-
filename: { value: "", validate: RED.validators.typedInput("filenametype"), required: true },
1473+
filename: { value: "", validate: validate("filenametype"), required: true },
14681474
filenametype: { value: "" },
14691475
name: { value: "" }
14701476
},
@@ -1528,9 +1534,9 @@
15281534
paletteLabel: 'upload',
15291535
icon: "font-awesome/fa-upload",
15301536
defaults: {
1531-
filename: { value: "", validate: RED.validators.typedInput("filenametype"), required: true },
1537+
filename: { value: "", validate: validate("filenametype"), required: true },
15321538
filenametype: { value: "" },
1533-
mimeType: { value: "", validate: RED.validators.typedInput("mimeTypetype"), required: true },
1539+
mimeType: { value: "", validate: validate("mimeTypetype"), required: true },
15341540
mimeTypetype: { value: "" },
15351541
name: { value: "" }
15361542
},
@@ -1702,7 +1708,7 @@
17021708
icon: "font-awesome/fa-list",
17031709
defaults: {
17041710
name: { value: "" },
1705-
results: { value: "payload", validate: RED.validators.typedInput("resultstype"), required: true },
1711+
results: { value: "payload", validate: validate("resultstype"), required: true },
17061712
resultstype: { value: "", required: true },
17071713
},
17081714
inputs: 1,

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.36
1+
1.3.37

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.36",
3+
"version": "1.3.37",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)