@5minds/node-red-contrib-processcube 0.2.6-feature-1b79c0-lvmvp9ag → 0.2.6-feature-56f704-lvnqzr5u

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.
@@ -570,5 +570,112 @@
570
570
  "file": "/data/node_modules/node-red-contrib-processcube/processcube-engine-config.js"
571
571
  }
572
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
+ }
573
680
  }
574
681
  }
@@ -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": [
@@ -889,11 +889,12 @@
889
889
  "z": "fd3c725340de4f74",
890
890
  "name": "",
891
891
  "engine": "d042a4c68f51d6ab",
892
- "x": 290,
893
- "y": 360,
892
+ "x": 250,
893
+ "y": 120,
894
894
  "wires": [
895
895
  [
896
- "090d42845540049c"
896
+ "090d42845540049c",
897
+ "846c5269df75c7a1"
897
898
  ]
898
899
  ]
899
900
  },
@@ -909,8 +910,158 @@
909
910
  "complete": "false",
910
911
  "statusVal": "",
911
912
  "statusType": "auto",
912
- "x": 510,
913
- "y": 360,
913
+ "x": 520,
914
+ "y": 120,
914
915
  "wires": []
916
+ },
917
+ {
918
+ "id": "661e71d204ee957d",
919
+ "type": "uibuilder",
920
+ "z": "fd3c725340de4f74",
921
+ "name": "",
922
+ "topic": "",
923
+ "url": "usertasks",
924
+ "okToGo": true,
925
+ "fwdInMessages": false,
926
+ "allowScripts": false,
927
+ "allowStyles": false,
928
+ "copyIndex": true,
929
+ "templateFolder": "blank",
930
+ "extTemplate": "",
931
+ "showfolder": false,
932
+ "reload": true,
933
+ "sourceFolder": "src",
934
+ "deployedVersion": "6.8.2",
935
+ "showMsgUib": false,
936
+ "title": "",
937
+ "descr": "",
938
+ "x": 410,
939
+ "y": 300,
940
+ "wires": [
941
+ [
942
+ "823445c277179d4e"
943
+ ],
944
+ []
945
+ ]
946
+ },
947
+ {
948
+ "id": "823445c277179d4e",
949
+ "type": "debug",
950
+ "z": "fd3c725340de4f74",
951
+ "name": "debug 11",
952
+ "active": true,
953
+ "tosidebar": true,
954
+ "console": false,
955
+ "tostatus": false,
956
+ "complete": "false",
957
+ "statusVal": "",
958
+ "statusType": "auto",
959
+ "x": 590,
960
+ "y": 280,
961
+ "wires": []
962
+ },
963
+ {
964
+ "id": "4078e4fb0a080b04",
965
+ "type": "uib-element",
966
+ "z": "fd3c725340de4f74",
967
+ "name": "",
968
+ "topic": "",
969
+ "elementtype": "sform",
970
+ "parent": "body",
971
+ "parentSource": "",
972
+ "parentSourceType": "str",
973
+ "elementid": "",
974
+ "elementId": "",
975
+ "elementIdSourceType": "str",
976
+ "heading": "",
977
+ "headingSourceType": "str",
978
+ "headingLevel": "h2",
979
+ "data": "payload",
980
+ "dataSourceType": "msg",
981
+ "position": "last",
982
+ "positionSourceType": "str",
983
+ "passthrough": false,
984
+ "confData": {},
985
+ "x": 390,
986
+ "y": 420,
987
+ "wires": [
988
+ [
989
+ "c59406be55bd5124"
990
+ ]
991
+ ]
992
+ },
993
+ {
994
+ "id": "3b9e8eb5743f557c",
995
+ "type": "inject",
996
+ "z": "fd3c725340de4f74",
997
+ "name": "",
998
+ "props": [
999
+ {
1000
+ "p": "payload"
1001
+ }
1002
+ ],
1003
+ "repeat": "",
1004
+ "crontab": "",
1005
+ "once": false,
1006
+ "onceDelay": 0.1,
1007
+ "topic": "",
1008
+ "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\"}]",
1009
+ "payloadType": "json",
1010
+ "x": 80,
1011
+ "y": 400,
1012
+ "wires": [
1013
+ [
1014
+ "4078e4fb0a080b04"
1015
+ ]
1016
+ ]
1017
+ },
1018
+ {
1019
+ "id": "c59406be55bd5124",
1020
+ "type": "link out",
1021
+ "z": "fd3c725340de4f74",
1022
+ "name": "link out 1",
1023
+ "mode": "link",
1024
+ "links": [
1025
+ "d9edaa2e3c514edc"
1026
+ ],
1027
+ "x": 545,
1028
+ "y": 400,
1029
+ "wires": []
1030
+ },
1031
+ {
1032
+ "id": "d9edaa2e3c514edc",
1033
+ "type": "link in",
1034
+ "z": "fd3c725340de4f74",
1035
+ "name": "link in 1",
1036
+ "links": [
1037
+ "c59406be55bd5124"
1038
+ ],
1039
+ "x": 245,
1040
+ "y": 300,
1041
+ "wires": [
1042
+ [
1043
+ "661e71d204ee957d"
1044
+ ]
1045
+ ]
1046
+ },
1047
+ {
1048
+ "id": "846c5269df75c7a1",
1049
+ "type": "function",
1050
+ "z": "fd3c725340de4f74",
1051
+ "name": "function 2",
1052
+ "func": "msg.payload = msg.payload.formFields;\n\nreturn msg;",
1053
+ "outputs": 1,
1054
+ "timeout": 0,
1055
+ "noerr": 0,
1056
+ "initialize": "",
1057
+ "finalize": "",
1058
+ "libs": [],
1059
+ "x": 100,
1060
+ "y": 280,
1061
+ "wires": [
1062
+ [
1063
+ "4078e4fb0a080b04"
1064
+ ]
1065
+ ]
915
1066
  }
916
1067
  ]
@@ -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
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "uib_root",
3
+ "version": "6.8.2",
4
+ "description": "Root configuration and data folder for uibuilder",
5
+ "scripts": {},
6
+ "dependencies": {},
7
+ "homepage": "",
8
+ "bugs": "",
9
+ "author": "",
10
+ "license": "Apache-2.0",
11
+ "repository": "",
12
+ "uibuilder": {
13
+ "packages": {}
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "uib_root",
3
+ "version": "6.8.2",
4
+ "description": "Root configuration and data folder for uibuilder",
5
+ "scripts": {},
6
+ "dependencies": {},
7
+ "homepage": "",
8
+ "bugs": "",
9
+ "author": "",
10
+ "license": "Apache-2.0",
11
+ "repository": "",
12
+ "uibuilder": {
13
+ "packages": {}
14
+ }
15
+ }
@@ -0,0 +1,80 @@
1
+ /** JavaScript Versions
2
+ * 5 is minimum -> Last IE11
3
+ * 6 = 2015 -> Node >8.10, iOS12+
4
+ * 7 = 2016 -> FF78+,
5
+ * 8 = 2017 -> Node 10.9+
6
+ * 9 = 2018 -> Node 12.11+
7
+ * 10 = 2019
8
+ * 11 = 2020
9
+ * 12 = 2021
10
+ */
11
+ module.exports = { // eslint-disable-line no-undef
12
+ env: {
13
+ browser: true,
14
+ node: false,
15
+ 'shared-node-browser': false,
16
+ },
17
+ parserOptions: {
18
+ ecmaVersion: 2015,
19
+ sourceType: 'script',
20
+ },
21
+ root: true,
22
+ globals: {
23
+ uibuilder: true,
24
+ $: true,
25
+ },
26
+ overrides: [
27
+ {
28
+ files: ['*.esm.js', '*.module.js', '*.mod.js', '*.mjs'],
29
+ parserOptions: { sourceType: 'module' },
30
+ }
31
+ ],
32
+ plugins: [
33
+ 'html', // Check scripts in HTML. https://www.npmjs.com/package/eslint-plugin-html
34
+ 'es', // Help avoid js that is too new. https://eslint-plugin-es.mysticatea.dev/
35
+ 'jsdoc', // JSDoc. https://www.npmjs.com/package/eslint-plugin-jsdoc
36
+ 'promise', // Better promises. https://www.npmjs.com/package/eslint-plugin-promise
37
+ 'sonarjs', // Detect bugs and suspicious patterns. https://github.com/SonarSource/eslint-plugin-sonarjs
38
+ ],
39
+ extends: [
40
+ 'standard',
41
+ // 'eslint:recommended',
42
+ 'plugin:es/restrict-to-es2015',
43
+ 'plugin:jsdoc/recommended',
44
+ 'plugin:promise/recommended',
45
+ 'plugin:sonarjs/recommended',
46
+ ],
47
+ rules: {
48
+ // TODO remove once min engines moves to node.js v15+
49
+ 'es/no-logical-assignment-operators': 'error',
50
+ 'es/no-promise-any': 'error',
51
+ 'es/no-numeric-separators': 'error',
52
+
53
+ 'sonarjs/no-duplicate-string': ['warn', { 'threshold': 6 }], // Default is 3
54
+ // 'sonarjs/cognitive-complexity': ['error', 15], // Default is 15
55
+ 'sonarjs/no-nested-template-literals': 0,
56
+
57
+ // Tidy up some jsdoc oddities
58
+ 'jsdoc/multiline-blocks': 0,
59
+ 'jsdoc/newline-after-description': 0,
60
+ 'jsdoc/no-multi-asterisks': 0,
61
+ 'jsdoc/tag-lines': 0,
62
+ 'jsdoc/valid-types': 0, // Rubbish, fails on common type configs
63
+ 'jsdoc/no-undefined-types': 0, // ['error'|'warn', {'definedTypes':['Promise']}],
64
+
65
+ // Make Standard less annoying
66
+ 'brace-style': 'off', // You should only use one-true-brace style but sometimes we want to compress things a bit.
67
+ 'comma-dangle': 'off', // Lack of dangles wastes soo much time correcting lists
68
+ 'dot-notation': 'off', // Turn off to allow for tslint's brain-dead treatment of expando objects in JS
69
+ 'indent': ['error', 4, { 'SwitchCase': 1 }], // Standard wants 2, I like 4
70
+ 'space-before-function-paren': 'off', // No, don't need space between fn and arg!
71
+ 'no-multi-spaces': 'off', // Readability is more important than size (reduce size using uglify)
72
+ 'object-shorthand': ['error', 'consistent'],
73
+ 'padded-blocks': 'off', // Sometimes you just need some space! See above.
74
+ 'space-in-parens': 'off', // Sometimes you just need some space!
75
+ 'spaced-comment': ['error', 'always', {
76
+ 'markers': ['html', '#region', '#endregion']
77
+ }],
78
+ 'quote-props': 'off', // Sometimes it is necessary and then much nicer to be able to quote things that don't need it.
79
+ },
80
+ }
@@ -0,0 +1,178 @@
1
+
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,57 @@
1
+ # uibuilder Template: Blank
2
+
3
+ > NOTE: You can replace the contents of this README with text that describes your UI.
4
+
5
+ This is about the simplest template you can get for uibuilder. Is is also (as of uibuilder v5+), the default template.
6
+
7
+ It does not use any frameworks and has no other dependencies.
8
+
9
+ It demonstrates that you can use uibuilder purely with HTML/JavaScript or even just HTML and still easily build a simple, dynamic, data-driven user interface with the help of Node-RED.
10
+
11
+ All it does is start up uibuilder.
12
+
13
+ From uibuilder v6.1.0+, it uses the IIFE client library.
14
+
15
+ ## Folders
16
+
17
+ * `/` - The root folder contains this file. It can be used for other things **but** it will not be served up in the Node-RED web server.
18
+ * `/src/` - the default folder that serves files as web resources. However, this can be changed to a different folder if desired.
19
+ * `/dist/` - the default folder for serving files as web resources where a build step is used. In that case, the `/src` folder is the source used by the build tool and `/dist` is the destination for the build (the "distribution" folder).
20
+ * `/routes/` - This folder can contain `.js` files defining routing middleware for uibuilder's ExpressJS web server.
21
+ * `/api/` - This folder can contain `.js` files defining REST API's specific to this uibuilder instance.
22
+
23
+ The above folders will all pre-exist for the built-in uibuilder templates. The folders can safely be removed if not needed but one folder must exist to serve the web resources from (this cannot be the root folder).
24
+
25
+ The template only has files in the root and `src` folders. The `src` folder is the default used by uibuilder to serve up files to clients.
26
+
27
+ One reserved item in the root folder however will be a `package.json` file. This will be used in the future to help with build/compile steps. You can still use it yourself, just bear in mind that a future version of uibuilder will make use it as well. If you need to have any development packages installed to build your UI, don't forget to tell `npm` to save them as development dependencies not normal dependencies.
28
+
29
+ The `dist` folder should be used if you have a build step to convert your source code to something that browsers understand. So if you are using a build (compile) step to produce your production code, ensure that it is configured to use the `dist` folder as the output folder and that it creates at least an `index.html` file.
30
+
31
+ You can switch between the `src` and `dist` (or other) folders using the matching setting in the Editor. See uibuilder's advanced settings tab.
32
+
33
+ Also note that you can use **linked** folders and files in this folder structure. This can be handy if you want to maintain your code in a different folder somewhere or if your default build process needs to use sub-folders other than `src` and `dist`.(Though as of v6, you can specify any sub-folder to be served)
34
+
35
+ ## Files in this template
36
+
37
+ * `package.json`: REQUIRED. Defines the basic structure, name, description of the project and defines any local development dependencies if any. Also works with `npm` allowing the installation of dev packages (such as build or linting tools).
38
+ * `README.md`: This file. Change this to describe your web app and provide documentation for it.
39
+ * `.eslintrc.js`: A pre-configured configuration for the ESLINT tool. Helps when writing front-end code.
40
+ * `LICENSE`: A copy of the Apache 2.0 license. Replace with a different license if needed. Always license your code. Apache 2.0 matches the licensing of uibuilder.
41
+ * `src/index.html`: REQUIRED. Contains your basic HTML and will be the file loaded and displayed in the browser when going to the uibuilder defined URL.
42
+ * `src/index.js`: Contains all of the logic for your UI. It must be linked to in the html file. Optional.
43
+ * `src/index.css`: Contains your custom CSS for styling. It must be linked to in the html file. Optional.
44
+
45
+ Note that only the `package.json` and `index.html` files are actually _required_. uibuilder will not function as expected without them.
46
+
47
+ It is possible to use the index.html file simply as a link to other files but it must be present.
48
+
49
+ The other files are all optional. However, you will need to change the index.html file accordingly if you rename or remove them.
50
+
51
+ ## Multiple HTML pages
52
+
53
+ uibuilder will happily serve up any number of web pages from a single instance. It will also make use of sub-folders. However, each folder should have an `index.html` file so that a URL that ends with the folder name will still work without error.
54
+
55
+ Note that each html file is a separate page and requires its own JavaScript and uibuilder library reference. When moving between pages, remember that every page is stand-alone, a new environment. You can share one `index.js` file between multiple pages if you prefer but each page will run a separate instance.
56
+
57
+ If multiple pages are connected to the same uibuilder instance, they will all get the same broadcast messages from Node-RED. So if you want to handle different messages on different pages, remember to filter them in your front-end JavaScript in `uibuilder.onChange('msg', ....)` function. Turn on the advanced flag for including a `msg._uib` property in output if you need to differentiate between pages and/or clients in Node-RED.
File without changes
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "uib-blank",
3
+ "version": "6.1.0",
4
+ "private": true,
5
+ "description": "This is about the simplest template you can get for uibuilder.",
6
+ "browser": "./src/index.js",
7
+ "scripts": {
8
+ "build": "echo \"Error: no build process specified\" && exit 1"
9
+ },
10
+ "keywords": ["uibuilder", "node-red", "node-red-contrib-uibuilder"],
11
+ "author": "Julian Knight (Totally Information)",
12
+ "license": "Apache-2.0",
13
+ "homepage": "https://github.com/TotallyInformation/node-red-contrib-uibuilder",
14
+ "bugs": "https://github.com/TotallyInformation/node-red-contrib-uibuilder/issues",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/TotallyInformation/node-red-contrib-uibuilder.git"
18
+ },
19
+ "browserslist": [
20
+ "> 0.5%",
21
+ "maintained versions",
22
+ "last 2 versions",
23
+ "not dead",
24
+ "not ie > 0"
25
+ ]
26
+ }
@@ -0,0 +1,7 @@
1
+ /* Load defaults from `<userDir>/node_modules/node-red-contrib-uibuilder/front-end/uib-brand.min.css`
2
+ * This version auto-adjusts for light/dark browser settings but might not be as complete.
3
+ */
4
+ @import url("../uibuilder/uib-brand.min.css");
5
+
6
+ /* OR, load the defaults from the older `<userDir>/node_modules/node-red-contrib-uibuilder/front-end/uib-styles.css` */
7
+ /* @import url("../uibuilder/uib-styles.css"); */
@@ -0,0 +1,26 @@
1
+ <!doctype html>
2
+ <html lang="en"><head>
3
+
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <link rel="icon" href="../uibuilder/images/node-blue.ico">
7
+
8
+ <title>Blank template - Node-RED uibuilder</title>
9
+ <meta name="description" content="Node-RED uibuilder - Blank template">
10
+
11
+ <!-- Your own CSS (defaults to loading uibuilders css)-->
12
+ <link type="text/css" rel="stylesheet" href="./index.css" media="all">
13
+
14
+ <!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->
15
+ <script defer src="../uibuilder/uibuilder.iife.min.js"></script>
16
+ <!-- <script defer src="./index.js">/* OPTIONAL: Put your custom code in that */</script> -->
17
+ <!-- #endregion -->
18
+
19
+ </head><body class="uib">
20
+
21
+ <h1 class="with-subtitle">uibuilder Blank Template</h1>
22
+ <div role="doc-subtitle">Using the IIFE library.</div>
23
+
24
+ <div id="more"><!-- '#more' is used as a parent for dynamic HTML content in examples --></div>
25
+
26
+ </body></html>
@@ -0,0 +1,8 @@
1
+ /** The simplest use of uibuilder client library
2
+ * See the docs if the client doesn't start on its own.
3
+ */
4
+
5
+ // Listen for incoming messages from Node-RED and action
6
+ // uibuilder.onChange('msg', (msg) => {
7
+ // // do stuff with the incoming msg
8
+ // })
package/Dockerfile CHANGED
@@ -13,6 +13,7 @@ FROM nodered/node-red:latest
13
13
  RUN npm install node-red-contrib-graphql
14
14
  RUN npm install openapi-red
15
15
  RUN npm install node-red-contrib-postgresql
16
+ RUN npm install node-red-contrib-uibuilder
16
17
 
17
18
  COPY --from=builder /src/node-red-contrib-processcube /src/node-red-contrib-processcube
18
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.2.6-feature-1b79c0-lvmvp9ag",
3
+ "version": "0.2.6-feature-56f704-lvnqzr5u",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [
@@ -27,8 +27,14 @@
27
27
  <bpmn:userTask id="Activity_0ljiko7" name="Hello world">
28
28
  <bpmn:extensionElements>
29
29
  <camunda:formData>
30
- <camunda:formField id="hello_id" label="Hello" type="string" customForm="{&#34;placeholder&#34;:&#34;world&#34;}" />
31
- <camunda:formField id="AnotherField" label="AnotherField" type="long" defaultValue="${token.current.sample}" customForm="{&#34;hint&#34;:&#34;Sample&#34;}" />
30
+ <camunda:formField id="text_id" label="Text Label" type="string" />
31
+ <camunda:formField id="number_id" label="Number Label" type="long" defaultValue="${token.current.sample}" customForm="{&#34;hint&#34;:&#34;Sample&#34;}" />
32
+ <camunda:formField id="date_id" label="Date Label" type="date" />
33
+ <camunda:formField id="select_id" label="Select Label" type="enum">
34
+ <camunda:value id="value_01" name="Value 01" />
35
+ <camunda:value id="value_02" name="Value 02" />
36
+ </camunda:formField>
37
+ <camunda:formField id="boolean_id" label="Boolean Label" type="boolean" />
32
38
  </camunda:formData>
33
39
  </bpmn:extensionElements>
34
40
  <bpmn:incoming>Flow_1h0giih</bpmn:incoming>
package/usertask-input.js CHANGED
@@ -11,6 +11,25 @@ function showStatus(node, msgCounter) {
11
11
  }
12
12
  }
13
13
 
14
+ function mapUserTaskToMsg(userTask) {
15
+ return userTask.userTaskConfig.formFields.map(field => {
16
+ switch (field.type) {
17
+ case 'string':
18
+ return { id: field.id, type: 'text', required: false, label: field.label, value: '', title: 'Some helpful text' };
19
+ case 'long':
20
+ return { id: field.id, type: 'number', required: true, label: field.label, title: 'Some helpful text' };
21
+ case 'date':
22
+ return { id: field.id, type: 'date', required: true, label: field.label, title: 'Some helpful text' };
23
+ case 'enum':
24
+ return { id: field.id, type: 'select', required: true, label: field.label, options: field.enumValues.map(v => ({ id: v.id, name: v.name })), title: 'Choose an option' };
25
+ case 'boolean':
26
+ return { id: field.id, type: 'checkbox', required: false, label: field.label, title: 'Check for Yes' };
27
+ default:
28
+ return { id: field.id, type: field.type, required: true, label: field.label, title: 'Additional Information Needed' };
29
+ }
30
+ });
31
+ }
32
+
14
33
  module.exports = function(RED) {
15
34
  function UserTaskInput(config) {
16
35
  RED.nodes.createNode(this,config);
@@ -40,6 +59,9 @@ module.exports = function(RED) {
40
59
  client.userTasks.onUserTaskWaiting((userTaskWaitingNotification) => {
41
60
  console.log(`UserTask with id ${userTaskWaitingNotification.flowNodeInstanceId} is waiting.`);
42
61
 
62
+ // Abschließend mit - client.userTasks.finishUserTask(waitingUserTask?.flowNodeInstanceId, sampleResult)
63
+
64
+ // flowNodeInstanceId
43
65
  // processModelName
44
66
  // flowNodeId
45
67
  client.userTasks.query({
@@ -47,9 +69,17 @@ module.exports = function(RED) {
47
69
  processModelId: userTaskWaitingNotification.processModelId,
48
70
  flowNodeId: userTaskWaitingNotification.flowNodeId,
49
71
  }).then((matchingFlowNodes) => {
50
- node.send({ payload: matchingFlowNodes });
51
- });
72
+ if (matchingFlowNodes && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
73
+ userTask = matchingFlowNodes.userTasks[0];
74
+
75
+ let formFields = mapUserTaskToMsg(userTask);
52
76
 
77
+ node.send({ payload: {formFields: formFields, userTask: userTask }, _flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId });
78
+
79
+ } else {
80
+ node.send({ payload: matchingFlowNodes });
81
+ }
82
+ });
53
83
  });
54
84
  }
55
85
  RED.nodes.registerType("usertask-input", UserTaskInput);