@5minds/node-red-contrib-processcube 0.3.3-develop-eaf8b5-lx1oicum → 0.3.3-feature-cefc25-lx7iaahd
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/.node-red/data/.config.nodes.json +129 -0
- package/.node-red/data/.config.nodes.json.backup +119 -1
- package/.node-red/data/.config.users.json.backup +2 -2
- package/.node-red/data/flows.json +218 -0
- package/.node-red/data/uibuilder/.config/sioMiddleware.js-template +53 -0
- package/.node-red/data/uibuilder/.config/sioMsgOut.js-template +22 -0
- package/.node-red/data/uibuilder/.config/sioUse.js-template +43 -0
- package/.node-red/data/uibuilder/.config/uibMiddleware.js-template +26 -0
- package/.node-red/data/uibuilder/common/images/node-blue.ico +0 -0
- package/.node-red/data/uibuilder/package.json +15 -0
- package/.node-red/data/uibuilder/package.json.bak +15 -0
- package/.node-red/data/uibuilder/usertasks/.eslintrc.js +80 -0
- package/.node-red/data/uibuilder/usertasks/LICENSE +178 -0
- package/.node-red/data/uibuilder/usertasks/README.md +57 -0
- package/.node-red/data/uibuilder/usertasks/api/.keep +0 -0
- package/.node-red/data/uibuilder/usertasks/package.json +26 -0
- package/.node-red/data/uibuilder/usertasks/routes/.keep +0 -0
- package/.node-red/data/uibuilder/usertasks/src/index.css +7 -0
- package/.node-red/data/uibuilder/usertasks/src/index.html +26 -0
- package/.node-red/data/uibuilder/usertasks/src/index.js +8 -0
- package/Dockerfile +1 -0
- package/package.json +3 -1
- package/processes/SampleUserTask.bpmn +75 -0
- package/usertask-input.html +31 -0
- package/usertask-input.js +89 -0
- package/usertask-output.html +31 -0
- package/usertask-output.js +45 -0
@@ -547,6 +547,28 @@
|
|
547
547
|
"module": "@5minds/node-red-contrib-processcube",
|
548
548
|
"file": "/data/node_modules/node-red-contrib-processcube/process-start.js"
|
549
549
|
},
|
550
|
+
"UserTaskInput": {
|
551
|
+
"name": "UserTaskInput",
|
552
|
+
"types": [
|
553
|
+
"usertask-input"
|
554
|
+
],
|
555
|
+
"enabled": true,
|
556
|
+
"local": true,
|
557
|
+
"user": false,
|
558
|
+
"module": "@5minds/node-red-contrib-processcube",
|
559
|
+
"file": "/data/node_modules/node-red-contrib-processcube/usertask-input.js"
|
560
|
+
},
|
561
|
+
"UserTaskOutput": {
|
562
|
+
"name": "UserTaskOutput",
|
563
|
+
"types": [
|
564
|
+
"usertask-output"
|
565
|
+
],
|
566
|
+
"enabled": true,
|
567
|
+
"local": true,
|
568
|
+
"user": false,
|
569
|
+
"module": "@5minds/node-red-contrib-processcube",
|
570
|
+
"file": "/data/node_modules/node-red-contrib-processcube/usertask-output.js"
|
571
|
+
},
|
550
572
|
"processcubeEngineConfig": {
|
551
573
|
"name": "processcubeEngineConfig",
|
552
574
|
"types": [
|
@@ -559,5 +581,112 @@
|
|
559
581
|
"file": "/data/node_modules/node-red-contrib-processcube/processcube-engine-config.js"
|
560
582
|
}
|
561
583
|
}
|
584
|
+
},
|
585
|
+
"node-red-contrib-uibuilder": {
|
586
|
+
"name": "node-red-contrib-uibuilder",
|
587
|
+
"version": "6.8.2",
|
588
|
+
"local": false,
|
589
|
+
"user": false,
|
590
|
+
"nodes": {
|
591
|
+
"uibuilder": {
|
592
|
+
"name": "uibuilder",
|
593
|
+
"types": [
|
594
|
+
"uibuilder"
|
595
|
+
],
|
596
|
+
"enabled": true,
|
597
|
+
"local": false,
|
598
|
+
"user": false,
|
599
|
+
"module": "node-red-contrib-uibuilder",
|
600
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js"
|
601
|
+
},
|
602
|
+
"uib-cache": {
|
603
|
+
"name": "uib-cache",
|
604
|
+
"types": [
|
605
|
+
"uib-cache"
|
606
|
+
],
|
607
|
+
"enabled": true,
|
608
|
+
"local": false,
|
609
|
+
"user": false,
|
610
|
+
"module": "node-red-contrib-uibuilder",
|
611
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-cache.js"
|
612
|
+
},
|
613
|
+
"uib-tag": {
|
614
|
+
"name": "uib-tag",
|
615
|
+
"types": [
|
616
|
+
"uib-tag"
|
617
|
+
],
|
618
|
+
"enabled": true,
|
619
|
+
"local": false,
|
620
|
+
"user": false,
|
621
|
+
"module": "node-red-contrib-uibuilder",
|
622
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-tag/customNode.js"
|
623
|
+
},
|
624
|
+
"uib-element": {
|
625
|
+
"name": "uib-element",
|
626
|
+
"types": [
|
627
|
+
"uib-element"
|
628
|
+
],
|
629
|
+
"enabled": true,
|
630
|
+
"local": false,
|
631
|
+
"user": false,
|
632
|
+
"module": "node-red-contrib-uibuilder",
|
633
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-element/customNode.js"
|
634
|
+
},
|
635
|
+
"uib-update": {
|
636
|
+
"name": "uib-update",
|
637
|
+
"types": [
|
638
|
+
"uib-update"
|
639
|
+
],
|
640
|
+
"enabled": true,
|
641
|
+
"local": false,
|
642
|
+
"user": false,
|
643
|
+
"module": "node-red-contrib-uibuilder",
|
644
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-update/customNode.js"
|
645
|
+
},
|
646
|
+
"uib-html": {
|
647
|
+
"name": "uib-html",
|
648
|
+
"types": [
|
649
|
+
"uib-html"
|
650
|
+
],
|
651
|
+
"enabled": true,
|
652
|
+
"local": false,
|
653
|
+
"user": false,
|
654
|
+
"module": "node-red-contrib-uibuilder",
|
655
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-html/customNode.js"
|
656
|
+
},
|
657
|
+
"uib-save": {
|
658
|
+
"name": "uib-save",
|
659
|
+
"types": [
|
660
|
+
"uib-save"
|
661
|
+
],
|
662
|
+
"enabled": true,
|
663
|
+
"local": false,
|
664
|
+
"user": false,
|
665
|
+
"module": "node-red-contrib-uibuilder",
|
666
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-save/customNode.js"
|
667
|
+
},
|
668
|
+
"uib-sender": {
|
669
|
+
"name": "uib-sender",
|
670
|
+
"types": [
|
671
|
+
"uib-sender"
|
672
|
+
],
|
673
|
+
"enabled": true,
|
674
|
+
"local": false,
|
675
|
+
"user": false,
|
676
|
+
"module": "node-red-contrib-uibuilder",
|
677
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-sender.js"
|
678
|
+
},
|
679
|
+
"uib-list": {
|
680
|
+
"name": "uib-list",
|
681
|
+
"types": [
|
682
|
+
"uib-list"
|
683
|
+
],
|
684
|
+
"enabled": true,
|
685
|
+
"local": false,
|
686
|
+
"user": false,
|
687
|
+
"module": "node-red-contrib-uibuilder",
|
688
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-list/customNode.js"
|
689
|
+
}
|
690
|
+
}
|
562
691
|
}
|
563
692
|
}
|
@@ -499,7 +499,7 @@
|
|
499
499
|
},
|
500
500
|
"@5minds/node-red-contrib-processcube": {
|
501
501
|
"name": "@5minds/node-red-contrib-processcube",
|
502
|
-
"version": "0.2.
|
502
|
+
"version": "0.2.6",
|
503
503
|
"local": true,
|
504
504
|
"user": false,
|
505
505
|
"nodes": {
|
@@ -547,6 +547,17 @@
|
|
547
547
|
"module": "@5minds/node-red-contrib-processcube",
|
548
548
|
"file": "/data/node_modules/node-red-contrib-processcube/process-start.js"
|
549
549
|
},
|
550
|
+
"UserTaskInput": {
|
551
|
+
"name": "UserTaskInput",
|
552
|
+
"types": [
|
553
|
+
"usertask-input"
|
554
|
+
],
|
555
|
+
"enabled": true,
|
556
|
+
"local": true,
|
557
|
+
"user": false,
|
558
|
+
"module": "@5minds/node-red-contrib-processcube",
|
559
|
+
"file": "/data/node_modules/node-red-contrib-processcube/usertask-input.js"
|
560
|
+
},
|
550
561
|
"processcubeEngineConfig": {
|
551
562
|
"name": "processcubeEngineConfig",
|
552
563
|
"types": [
|
@@ -559,5 +570,112 @@
|
|
559
570
|
"file": "/data/node_modules/node-red-contrib-processcube/processcube-engine-config.js"
|
560
571
|
}
|
561
572
|
}
|
573
|
+
},
|
574
|
+
"node-red-contrib-uibuilder": {
|
575
|
+
"name": "node-red-contrib-uibuilder",
|
576
|
+
"version": "6.8.2",
|
577
|
+
"local": false,
|
578
|
+
"user": false,
|
579
|
+
"nodes": {
|
580
|
+
"uibuilder": {
|
581
|
+
"name": "uibuilder",
|
582
|
+
"types": [
|
583
|
+
"uibuilder"
|
584
|
+
],
|
585
|
+
"enabled": true,
|
586
|
+
"local": false,
|
587
|
+
"user": false,
|
588
|
+
"module": "node-red-contrib-uibuilder",
|
589
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js"
|
590
|
+
},
|
591
|
+
"uib-cache": {
|
592
|
+
"name": "uib-cache",
|
593
|
+
"types": [
|
594
|
+
"uib-cache"
|
595
|
+
],
|
596
|
+
"enabled": true,
|
597
|
+
"local": false,
|
598
|
+
"user": false,
|
599
|
+
"module": "node-red-contrib-uibuilder",
|
600
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-cache.js"
|
601
|
+
},
|
602
|
+
"uib-tag": {
|
603
|
+
"name": "uib-tag",
|
604
|
+
"types": [
|
605
|
+
"uib-tag"
|
606
|
+
],
|
607
|
+
"enabled": true,
|
608
|
+
"local": false,
|
609
|
+
"user": false,
|
610
|
+
"module": "node-red-contrib-uibuilder",
|
611
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-tag/customNode.js"
|
612
|
+
},
|
613
|
+
"uib-element": {
|
614
|
+
"name": "uib-element",
|
615
|
+
"types": [
|
616
|
+
"uib-element"
|
617
|
+
],
|
618
|
+
"enabled": true,
|
619
|
+
"local": false,
|
620
|
+
"user": false,
|
621
|
+
"module": "node-red-contrib-uibuilder",
|
622
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-element/customNode.js"
|
623
|
+
},
|
624
|
+
"uib-update": {
|
625
|
+
"name": "uib-update",
|
626
|
+
"types": [
|
627
|
+
"uib-update"
|
628
|
+
],
|
629
|
+
"enabled": true,
|
630
|
+
"local": false,
|
631
|
+
"user": false,
|
632
|
+
"module": "node-red-contrib-uibuilder",
|
633
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-update/customNode.js"
|
634
|
+
},
|
635
|
+
"uib-html": {
|
636
|
+
"name": "uib-html",
|
637
|
+
"types": [
|
638
|
+
"uib-html"
|
639
|
+
],
|
640
|
+
"enabled": true,
|
641
|
+
"local": false,
|
642
|
+
"user": false,
|
643
|
+
"module": "node-red-contrib-uibuilder",
|
644
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-html/customNode.js"
|
645
|
+
},
|
646
|
+
"uib-save": {
|
647
|
+
"name": "uib-save",
|
648
|
+
"types": [
|
649
|
+
"uib-save"
|
650
|
+
],
|
651
|
+
"enabled": true,
|
652
|
+
"local": false,
|
653
|
+
"user": false,
|
654
|
+
"module": "node-red-contrib-uibuilder",
|
655
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-save/customNode.js"
|
656
|
+
},
|
657
|
+
"uib-sender": {
|
658
|
+
"name": "uib-sender",
|
659
|
+
"types": [
|
660
|
+
"uib-sender"
|
661
|
+
],
|
662
|
+
"enabled": true,
|
663
|
+
"local": false,
|
664
|
+
"user": false,
|
665
|
+
"module": "node-red-contrib-uibuilder",
|
666
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-sender.js"
|
667
|
+
},
|
668
|
+
"uib-list": {
|
669
|
+
"name": "uib-list",
|
670
|
+
"types": [
|
671
|
+
"uib-list"
|
672
|
+
],
|
673
|
+
"enabled": true,
|
674
|
+
"local": false,
|
675
|
+
"user": false,
|
676
|
+
"module": "node-red-contrib-uibuilder",
|
677
|
+
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-list/customNode.js"
|
678
|
+
}
|
679
|
+
}
|
562
680
|
}
|
563
681
|
}
|
@@ -7,6 +7,14 @@
|
|
7
7
|
"info": "",
|
8
8
|
"env": []
|
9
9
|
},
|
10
|
+
{
|
11
|
+
"id": "fd3c725340de4f74",
|
12
|
+
"type": "tab",
|
13
|
+
"label": "Flow 2",
|
14
|
+
"disabled": false,
|
15
|
+
"info": "",
|
16
|
+
"env": []
|
17
|
+
},
|
10
18
|
{
|
11
19
|
"id": "d042a4c68f51d6ab",
|
12
20
|
"type": "processcube-engine-config",
|
@@ -875,5 +883,215 @@
|
|
875
883
|
"x": 770,
|
876
884
|
"y": 840,
|
877
885
|
"wires": []
|
886
|
+
},
|
887
|
+
{
|
888
|
+
"id": "ec0be0ef92746967",
|
889
|
+
"type": "usertask-input",
|
890
|
+
"z": "fd3c725340de4f74",
|
891
|
+
"name": "",
|
892
|
+
"engine": "d042a4c68f51d6ab",
|
893
|
+
"x": 250,
|
894
|
+
"y": 120,
|
895
|
+
"wires": [
|
896
|
+
[
|
897
|
+
"090d42845540049c",
|
898
|
+
"846c5269df75c7a1"
|
899
|
+
]
|
900
|
+
]
|
901
|
+
},
|
902
|
+
{
|
903
|
+
"id": "090d42845540049c",
|
904
|
+
"type": "debug",
|
905
|
+
"z": "fd3c725340de4f74",
|
906
|
+
"name": "debug 10",
|
907
|
+
"active": false,
|
908
|
+
"tosidebar": true,
|
909
|
+
"console": false,
|
910
|
+
"tostatus": false,
|
911
|
+
"complete": "false",
|
912
|
+
"statusVal": "",
|
913
|
+
"statusType": "auto",
|
914
|
+
"x": 520,
|
915
|
+
"y": 120,
|
916
|
+
"wires": []
|
917
|
+
},
|
918
|
+
{
|
919
|
+
"id": "661e71d204ee957d",
|
920
|
+
"type": "uibuilder",
|
921
|
+
"z": "fd3c725340de4f74",
|
922
|
+
"name": "",
|
923
|
+
"topic": "",
|
924
|
+
"url": "usertasks",
|
925
|
+
"okToGo": true,
|
926
|
+
"fwdInMessages": false,
|
927
|
+
"allowScripts": false,
|
928
|
+
"allowStyles": false,
|
929
|
+
"copyIndex": true,
|
930
|
+
"templateFolder": "blank",
|
931
|
+
"extTemplate": "",
|
932
|
+
"showfolder": false,
|
933
|
+
"reload": true,
|
934
|
+
"sourceFolder": "src",
|
935
|
+
"deployedVersion": "6.8.2",
|
936
|
+
"showMsgUib": false,
|
937
|
+
"title": "",
|
938
|
+
"descr": "",
|
939
|
+
"x": 410,
|
940
|
+
"y": 300,
|
941
|
+
"wires": [
|
942
|
+
[
|
943
|
+
"823445c277179d4e",
|
944
|
+
"4267576c32c782ec"
|
945
|
+
],
|
946
|
+
[
|
947
|
+
"ce674239858cdfa1"
|
948
|
+
]
|
949
|
+
]
|
950
|
+
},
|
951
|
+
{
|
952
|
+
"id": "823445c277179d4e",
|
953
|
+
"type": "debug",
|
954
|
+
"z": "fd3c725340de4f74",
|
955
|
+
"name": "debug 11",
|
956
|
+
"active": true,
|
957
|
+
"tosidebar": true,
|
958
|
+
"console": false,
|
959
|
+
"tostatus": false,
|
960
|
+
"complete": "false",
|
961
|
+
"statusVal": "",
|
962
|
+
"statusType": "auto",
|
963
|
+
"x": 600,
|
964
|
+
"y": 220,
|
965
|
+
"wires": []
|
966
|
+
},
|
967
|
+
{
|
968
|
+
"id": "4078e4fb0a080b04",
|
969
|
+
"type": "uib-element",
|
970
|
+
"z": "fd3c725340de4f74",
|
971
|
+
"name": "",
|
972
|
+
"topic": "",
|
973
|
+
"elementtype": "sform",
|
974
|
+
"parent": "body",
|
975
|
+
"parentSource": "",
|
976
|
+
"parentSourceType": "str",
|
977
|
+
"elementid": "",
|
978
|
+
"elementId": "",
|
979
|
+
"elementIdSourceType": "str",
|
980
|
+
"heading": "",
|
981
|
+
"headingSourceType": "str",
|
982
|
+
"headingLevel": "h2",
|
983
|
+
"data": "payload",
|
984
|
+
"dataSourceType": "msg",
|
985
|
+
"position": "last",
|
986
|
+
"positionSourceType": "str",
|
987
|
+
"passthrough": false,
|
988
|
+
"confData": {},
|
989
|
+
"x": 390,
|
990
|
+
"y": 420,
|
991
|
+
"wires": [
|
992
|
+
[
|
993
|
+
"c59406be55bd5124"
|
994
|
+
]
|
995
|
+
]
|
996
|
+
},
|
997
|
+
{
|
998
|
+
"id": "3b9e8eb5743f557c",
|
999
|
+
"type": "inject",
|
1000
|
+
"z": "fd3c725340de4f74",
|
1001
|
+
"name": "",
|
1002
|
+
"props": [
|
1003
|
+
{
|
1004
|
+
"p": "payload"
|
1005
|
+
}
|
1006
|
+
],
|
1007
|
+
"repeat": "",
|
1008
|
+
"crontab": "",
|
1009
|
+
"once": false,
|
1010
|
+
"onceDelay": 0.1,
|
1011
|
+
"topic": "",
|
1012
|
+
"payload": "[{\"id\":\"r1\",\"type\":\"text\",\"required\":false,\"label\":\"Label for form row 1\",\"value\":\"Foo\",\"title\":\"Some helpful text\"},{\"id\":\"r11\",\"type\":\"email\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r12\",\"type\":\"month\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r14\",\"type\":\"time\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r15\",\"type\":\"week\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r16\",\"type\":\"password\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r2\",\"type\":\"range\",\"required\":true,\"label\":\"Label for form row 1\",\"value\":\"Foo\"},{\"id\":\"r3\",\"type\":\"button\",\"label\":\"Text on button\",\"value\":\"Buttons can have values as well\"}]",
|
1013
|
+
"payloadType": "json",
|
1014
|
+
"x": 80,
|
1015
|
+
"y": 400,
|
1016
|
+
"wires": [
|
1017
|
+
[
|
1018
|
+
"4078e4fb0a080b04"
|
1019
|
+
]
|
1020
|
+
]
|
1021
|
+
},
|
1022
|
+
{
|
1023
|
+
"id": "c59406be55bd5124",
|
1024
|
+
"type": "link out",
|
1025
|
+
"z": "fd3c725340de4f74",
|
1026
|
+
"name": "link out 1",
|
1027
|
+
"mode": "link",
|
1028
|
+
"links": [
|
1029
|
+
"d9edaa2e3c514edc"
|
1030
|
+
],
|
1031
|
+
"x": 545,
|
1032
|
+
"y": 400,
|
1033
|
+
"wires": []
|
1034
|
+
},
|
1035
|
+
{
|
1036
|
+
"id": "d9edaa2e3c514edc",
|
1037
|
+
"type": "link in",
|
1038
|
+
"z": "fd3c725340de4f74",
|
1039
|
+
"name": "link in 1",
|
1040
|
+
"links": [
|
1041
|
+
"c59406be55bd5124"
|
1042
|
+
],
|
1043
|
+
"x": 245,
|
1044
|
+
"y": 300,
|
1045
|
+
"wires": [
|
1046
|
+
[
|
1047
|
+
"661e71d204ee957d"
|
1048
|
+
]
|
1049
|
+
]
|
1050
|
+
},
|
1051
|
+
{
|
1052
|
+
"id": "846c5269df75c7a1",
|
1053
|
+
"type": "function",
|
1054
|
+
"z": "fd3c725340de4f74",
|
1055
|
+
"name": "function 2",
|
1056
|
+
"func": "msg.payload = msg.payload.formFields;\n\nreturn msg;",
|
1057
|
+
"outputs": 1,
|
1058
|
+
"timeout": 0,
|
1059
|
+
"noerr": 0,
|
1060
|
+
"initialize": "",
|
1061
|
+
"finalize": "",
|
1062
|
+
"libs": [],
|
1063
|
+
"x": 100,
|
1064
|
+
"y": 280,
|
1065
|
+
"wires": [
|
1066
|
+
[
|
1067
|
+
"4078e4fb0a080b04"
|
1068
|
+
]
|
1069
|
+
]
|
1070
|
+
},
|
1071
|
+
{
|
1072
|
+
"id": "ce674239858cdfa1",
|
1073
|
+
"type": "debug",
|
1074
|
+
"z": "fd3c725340de4f74",
|
1075
|
+
"name": "debug 12",
|
1076
|
+
"active": false,
|
1077
|
+
"tosidebar": true,
|
1078
|
+
"console": false,
|
1079
|
+
"tostatus": false,
|
1080
|
+
"complete": "false",
|
1081
|
+
"statusVal": "",
|
1082
|
+
"statusType": "auto",
|
1083
|
+
"x": 580,
|
1084
|
+
"y": 320,
|
1085
|
+
"wires": []
|
1086
|
+
},
|
1087
|
+
{
|
1088
|
+
"id": "4267576c32c782ec",
|
1089
|
+
"type": "usertask-output",
|
1090
|
+
"z": "fd3c725340de4f74",
|
1091
|
+
"name": "",
|
1092
|
+
"engine": "d042a4c68f51d6ab",
|
1093
|
+
"x": 740,
|
1094
|
+
"y": 260,
|
1095
|
+
"wires": []
|
878
1096
|
}
|
879
1097
|
]
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/**
|
2
|
+
* Template Socket.IO Connection Middleware for uibuilder.
|
3
|
+
* UPDATED: 2022-04-01
|
4
|
+
*
|
5
|
+
* NOTES & WARNINGS:
|
6
|
+
* 1) This function is only called ONCE - when a new client connects. So any authentication/security processing is limited
|
7
|
+
* because you cannot use this to, for example, timeout/extend a session without further server processing of incoming messages.
|
8
|
+
* However, see the sioUse.js and sioMsgOut.js middlewares for per-msg handling.
|
9
|
+
* 2) Failing to either return or call `next()` will mean that your clients will never connect.
|
10
|
+
* 3) An error in this function will probably cause Node-RED to fail to start at all.
|
11
|
+
* 4) You have to restart Node-RED if you change this file.
|
12
|
+
* 5) To use for authentication/authorisation with Express and sio connection middleware, create a common node.js module.
|
13
|
+
*
|
14
|
+
* Allows custom processing for authentication, session management, connection validation, logging, rate limiting, etc.
|
15
|
+
*
|
16
|
+
* see also: uibRoot/.config/sioUse.js & sioMsgOut.js
|
17
|
+
* https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sheet.html#websocket-implementation-hints
|
18
|
+
*
|
19
|
+
* @param {*} socket Socket.IO socket object
|
20
|
+
* @param {function} next The callback to hand off to the next middleware
|
21
|
+
*/
|
22
|
+
function sioMw(socket, next) {
|
23
|
+
// Some SIO related info that might be useful in security checks
|
24
|
+
console.log('== [sioMiddleware.js] ====================')
|
25
|
+
console.log('New client connected to Namespace')
|
26
|
+
console.log('--socket.request.connection.remoteAddress--', socket.request.connection.remoteAddress)
|
27
|
+
console.log('--socket id--', socket.id)
|
28
|
+
// Added by uibuilder when Namespace is created by uibuilder node instance - Note also that socket.nsp.log can be used to output to the Node-RED log
|
29
|
+
console.log('--socket namespace metadata (server)--', {
|
30
|
+
name: socket.nsp.name,
|
31
|
+
url: socket.nsp.url,
|
32
|
+
nodeId: socket.nsp.nodeId,
|
33
|
+
useSecurity: socket.nsp.useSecurity,
|
34
|
+
})
|
35
|
+
//console.log('--socket handshake--', socket.handshake)
|
36
|
+
//console.log('--socket properties--', Object.keys(socket))
|
37
|
+
// Show the client id (set by uibuilder ExpressJS middleware)
|
38
|
+
console.log('--client id handshake.auth--', socket.handshake.auth.clientId)
|
39
|
+
console.log('--client id in custom header (polling only)--', socket.handshake.headers['x-clientid'])
|
40
|
+
console.log('==========================================\n ')
|
41
|
+
|
42
|
+
// Simplistic auth example
|
43
|
+
let auth = true
|
44
|
+
if (auth !== true) {
|
45
|
+
socket.nsp.log.error(`[uibuilder:sioMiddleware.js] - Authentication error, client disconnected - ID: ${socket.id}`)
|
46
|
+
return next (new Error(`[uibuilder:sioMiddleware.js] - Authentication error, client disconnected - ID: ${socket.id}` ))
|
47
|
+
}
|
48
|
+
|
49
|
+
return next()
|
50
|
+
|
51
|
+
} // Remember to end with a `next()` statement or nothing will work.
|
52
|
+
|
53
|
+
module.exports = sioMw
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/**
|
2
|
+
* Template Socket.IO outbound per-msg middleware for uibuilder. Fn will be called for EVERY outbound msg from Node-RED/uibuilder to a client.
|
3
|
+
* UPDATED: 2022-04-01
|
4
|
+
*
|
5
|
+
* NOTES & WARNINGS:
|
6
|
+
* 1) This function is called whenever any instance of uibuilder sends a msg to any client.
|
7
|
+
* 2) You have to restart Node-RED if you change this file.
|
8
|
+
* 3) You can use this to make changes to the msg before it is sent.
|
9
|
+
*
|
10
|
+
* Allows you to process outgoing data to clients. Use it to add security/user data or anything else.
|
11
|
+
*
|
12
|
+
* @param {object} msg The msg being seny by uibuilder to a client
|
13
|
+
* @param {string} url The uibuilder instance url
|
14
|
+
* @param {string} channel The socket.io channel being used
|
15
|
+
*/
|
16
|
+
function sioMsgOutMw( msg, url, channel ) {
|
17
|
+
|
18
|
+
console.log('[uibuilder:Socket.IO:sioMsgOut.js] msg from server: ', msg, url, channel)
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
module.exports = sioMsgOutMw
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
* Template Socket.IO `use` middleware for uibuilder. Fn will be called for EVERY inbound msg from a client to Node-RED/uibuilder.
|
3
|
+
* UPDATED: 2022-04-01
|
4
|
+
*
|
5
|
+
* NOTES & WARNINGS:
|
6
|
+
* 1) This function is called when a client sends a "packet" of data to the server.
|
7
|
+
* 2) Failing to either return or call `next()` will mean that your clients will never be able to get responses.
|
8
|
+
* 3) You can amend the incoming msg in this middleware.
|
9
|
+
* 4) An error in this function will probably cause Node-RED to fail to start at all.
|
10
|
+
* 5) You have to restart Node-RED if you change this file.
|
11
|
+
* 6) If you call `next( new Error('blah') )` The error is sent back to the client and further proessing of the incoming msg stops.
|
12
|
+
* 7) To use for authentication/authorisation with Express and sio connection middleware, create a common node.js module.
|
13
|
+
*
|
14
|
+
* Allows you to process incoming data from clients.
|
15
|
+
*
|
16
|
+
* see: https://socket.io/docs/v4/server-api/#socketusefn
|
17
|
+
* see also: uibRoot/.config/sioMiddleware.js & sioMsgOut.js
|
18
|
+
* and https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sheet.html#websocket-implementation-hints
|
19
|
+
*
|
20
|
+
* @param {[string,Array<Object>]} data The channel name (strictly the event name) and args send by a client (Socket.IO calls it a "packet"). data[0] is the channel/event name, data[args][0] is the actual msg
|
21
|
+
* @param {function} next The callback to hand off to the next middleware
|
22
|
+
*/
|
23
|
+
function sioUseMw([ channel, ...args ], next) {
|
24
|
+
|
25
|
+
const msg = args[0]
|
26
|
+
|
27
|
+
console.log('[uibuilder:Socket.IO:sioUse.js] msg from client: ', 'Channel Name:', channel, ' Msg:', msg)
|
28
|
+
|
29
|
+
// Simplistic error example - looking for specific property on the inbound msg
|
30
|
+
if ( msg.i_am_an_error ) {
|
31
|
+
// The error is sent back to the client and further processing of the msg stops
|
32
|
+
next(new Error('Oops! Some kind of error happened'))
|
33
|
+
return
|
34
|
+
}
|
35
|
+
|
36
|
+
// You can amend the incoming msg
|
37
|
+
msg._test = 'added by sioUse.js middleware'
|
38
|
+
|
39
|
+
next()
|
40
|
+
|
41
|
+
} // Do not forget to end with a call to `next()` or clients will not be able to connect
|
42
|
+
|
43
|
+
module.exports = sioUseMw
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/**
|
2
|
+
* Template ExpressJS Middleware for uibuilder.
|
3
|
+
* UPDATED: 2022-04-01
|
4
|
+
*
|
5
|
+
* NOTES & WARNINGS:
|
6
|
+
* 1) This function is called EVERY TIME any web call is made to the URL defined by your uib instance.
|
7
|
+
* So it should be kept short and efficient.
|
8
|
+
* 2) Failing to either return or call `next()` will cause an ExpressJS error.
|
9
|
+
* 3) An error in this function will probably cause Node-RED to fail to start at all.
|
10
|
+
* 4) You have to restart Node-RED if you change this file.
|
11
|
+
* 5) To use for authentication/authorisation with sio connection middleware, create a common node.js module.
|
12
|
+
*
|
13
|
+
* Allows custom processing for authentication, session management, custom logging, etc.
|
14
|
+
*
|
15
|
+
* @param {object} req The ExpressJS request object
|
16
|
+
* @param {object} res The ExpressJS result object
|
17
|
+
* @param {function} next The callback to hand off to the next middleware
|
18
|
+
*/
|
19
|
+
function uibMw(req,res,next) {
|
20
|
+
|
21
|
+
console.log('[uibuilder:uibMiddleware.js] Custom ExpressJS middleware called.')
|
22
|
+
next()
|
23
|
+
|
24
|
+
} // Do not forget to end with a call to `next()`
|
25
|
+
|
26
|
+
module.exports = uibMw
|
Binary file
|