@5minds/node-red-contrib-processcube 0.0.4

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.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "node-red-project",
3
+ "version": "0.0.1",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "node-red-project",
9
+ "version": "0.0.1"
10
+ },
11
+ "../../externaltask": {
12
+ "name": "node-red-contrib-externaltask",
13
+ "extraneous": true,
14
+ "dependencies": {
15
+ "@5minds/processcube_engine_client": "^4.4.5"
16
+ }
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "node-red-project",
3
+ "description": "A Node-RED Project",
4
+ "version": "0.0.1",
5
+ "private": true
6
+ }
@@ -0,0 +1,560 @@
1
+ /**
2
+ * This is the default settings file provided by Node-RED.
3
+ *
4
+ * It can contain any valid JavaScript code that will get run when Node-RED
5
+ * is started.
6
+ *
7
+ * Lines that start with // are commented out.
8
+ * Each entry should be separated from the entries above and below by a comma ','
9
+ *
10
+ * For more information about individual settings, refer to the documentation:
11
+ * https://nodered.org/docs/user-guide/runtime/configuration
12
+ *
13
+ * The settings are split into the following sections:
14
+ * - Flow File and User Directory Settings
15
+ * - Security
16
+ * - Server Settings
17
+ * - Runtime Settings
18
+ * - Editor Settings
19
+ * - Node Settings
20
+ *
21
+ **/
22
+
23
+ module.exports = {
24
+
25
+ /*******************************************************************************
26
+ * Flow File and User Directory Settings
27
+ * - flowFile
28
+ * - credentialSecret
29
+ * - flowFilePretty
30
+ * - userDir
31
+ * - nodesDir
32
+ ******************************************************************************/
33
+
34
+ /** The file containing the flows. If not set, defaults to flows_<hostname>.json **/
35
+ flowFile: 'flows.json',
36
+
37
+ /** By default, credentials are encrypted in storage using a generated key. To
38
+ * specify your own secret, set the following property.
39
+ * If you want to disable encryption of credentials, set this property to false.
40
+ * Note: once you set this property, do not change it - doing so will prevent
41
+ * node-red from being able to decrypt your existing credentials and they will be
42
+ * lost.
43
+ */
44
+ //credentialSecret: "a-secret-key",
45
+
46
+ /** By default, the flow JSON will be formatted over multiple lines making
47
+ * it easier to compare changes when using version control.
48
+ * To disable pretty-printing of the JSON set the following property to false.
49
+ */
50
+ flowFilePretty: true,
51
+
52
+ /** By default, all user data is stored in a directory called `.node-red` under
53
+ * the user's home directory. To use a different location, the following
54
+ * property can be used
55
+ */
56
+ //userDir: '/home/nol/.node-red/',
57
+
58
+ /** Node-RED scans the `nodes` directory in the userDir to find local node files.
59
+ * The following property can be used to specify an additional directory to scan.
60
+ */
61
+ //nodesDir: '/home/nol/.node-red/nodes',
62
+
63
+ /*******************************************************************************
64
+ * Security
65
+ * - adminAuth
66
+ * - https
67
+ * - httpsRefreshInterval
68
+ * - requireHttps
69
+ * - httpNodeAuth
70
+ * - httpStaticAuth
71
+ ******************************************************************************/
72
+
73
+ /** To password protect the Node-RED editor and admin API, the following
74
+ * property can be used. See https://nodered.org/docs/security.html for details.
75
+ */
76
+ //adminAuth: {
77
+ // type: "credentials",
78
+ // users: [{
79
+ // username: "admin",
80
+ // password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
81
+ // permissions: "*"
82
+ // }]
83
+ //},
84
+
85
+ /** The following property can be used to enable HTTPS
86
+ * This property can be either an object, containing both a (private) key
87
+ * and a (public) certificate, or a function that returns such an object.
88
+ * See http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
89
+ * for details of its contents.
90
+ */
91
+
92
+ /** Option 1: static object */
93
+ //https: {
94
+ // key: require("fs").readFileSync('privkey.pem'),
95
+ // cert: require("fs").readFileSync('cert.pem')
96
+ //},
97
+
98
+ /** Option 2: function that returns the HTTP configuration object */
99
+ // https: function() {
100
+ // // This function should return the options object, or a Promise
101
+ // // that resolves to the options object
102
+ // return {
103
+ // key: require("fs").readFileSync('privkey.pem'),
104
+ // cert: require("fs").readFileSync('cert.pem')
105
+ // }
106
+ // },
107
+
108
+ /** If the `https` setting is a function, the following setting can be used
109
+ * to set how often, in hours, the function will be called. That can be used
110
+ * to refresh any certificates.
111
+ */
112
+ //httpsRefreshInterval : 12,
113
+
114
+ /** The following property can be used to cause insecure HTTP connections to
115
+ * be redirected to HTTPS.
116
+ */
117
+ //requireHttps: true,
118
+
119
+ /** To password protect the node-defined HTTP endpoints (httpNodeRoot),
120
+ * including node-red-dashboard, or the static content (httpStatic), the
121
+ * following properties can be used.
122
+ * The `pass` field is a bcrypt hash of the password.
123
+ * See https://nodered.org/docs/security.html#generating-the-password-hash
124
+ */
125
+ //httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
126
+ //httpStaticAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
127
+
128
+ /*******************************************************************************
129
+ * Server Settings
130
+ * - uiPort
131
+ * - uiHost
132
+ * - apiMaxLength
133
+ * - httpServerOptions
134
+ * - httpAdminRoot
135
+ * - httpAdminMiddleware
136
+ * - httpNodeRoot
137
+ * - httpNodeCors
138
+ * - httpNodeMiddleware
139
+ * - httpStatic
140
+ * - httpStaticRoot
141
+ ******************************************************************************/
142
+
143
+ /** the tcp port that the Node-RED web server is listening on */
144
+ uiPort: process.env.PORT || 1880,
145
+
146
+ /** By default, the Node-RED UI accepts connections on all IPv4 interfaces.
147
+ * To listen on all IPv6 addresses, set uiHost to "::",
148
+ * The following property can be used to listen on a specific interface. For
149
+ * example, the following would only allow connections from the local machine.
150
+ */
151
+ //uiHost: "127.0.0.1",
152
+
153
+ /** The maximum size of HTTP request that will be accepted by the runtime api.
154
+ * Default: 5mb
155
+ */
156
+ //apiMaxLength: '5mb',
157
+
158
+ /** The following property can be used to pass custom options to the Express.js
159
+ * server used by Node-RED. For a full list of available options, refer
160
+ * to http://expressjs.com/en/api.html#app.settings.table
161
+ */
162
+ //httpServerOptions: { },
163
+
164
+ /** By default, the Node-RED UI is available at http://localhost:1880/
165
+ * The following property can be used to specify a different root path.
166
+ * If set to false, this is disabled.
167
+ */
168
+ //httpAdminRoot: '/admin',
169
+
170
+ /** The following property can be used to add a custom middleware function
171
+ * in front of all admin http routes. For example, to set custom http
172
+ * headers. It can be a single function or an array of middleware functions.
173
+ */
174
+ // httpAdminMiddleware: function(req,res,next) {
175
+ // // Set the X-Frame-Options header to limit where the editor
176
+ // // can be embedded
177
+ // //res.set('X-Frame-Options', 'sameorigin');
178
+ // next();
179
+ // },
180
+
181
+
182
+ /** Some nodes, such as HTTP In, can be used to listen for incoming http requests.
183
+ * By default, these are served relative to '/'. The following property
184
+ * can be used to specify a different root path. If set to false, this is
185
+ * disabled.
186
+ */
187
+ //httpNodeRoot: '/red-nodes',
188
+
189
+ /** The following property can be used to configure cross-origin resource sharing
190
+ * in the HTTP nodes.
191
+ * See https://github.com/troygoode/node-cors#configuration-options for
192
+ * details on its contents. The following is a basic permissive set of options:
193
+ */
194
+ //httpNodeCors: {
195
+ // origin: "*",
196
+ // methods: "GET,PUT,POST,DELETE"
197
+ //},
198
+
199
+ /** If you need to set an http proxy please set an environment variable
200
+ * called http_proxy (or HTTP_PROXY) outside of Node-RED in the operating system.
201
+ * For example - http_proxy=http://myproxy.com:8080
202
+ * (Setting it here will have no effect)
203
+ * You may also specify no_proxy (or NO_PROXY) to supply a comma separated
204
+ * list of domains to not proxy, eg - no_proxy=.acme.co,.acme.co.uk
205
+ */
206
+
207
+ /** The following property can be used to add a custom middleware function
208
+ * in front of all http in nodes. This allows custom authentication to be
209
+ * applied to all http in nodes, or any other sort of common request processing.
210
+ * It can be a single function or an array of middleware functions.
211
+ */
212
+ //httpNodeMiddleware: function(req,res,next) {
213
+ // // Handle/reject the request, or pass it on to the http in node by calling next();
214
+ // // Optionally skip our rawBodyParser by setting this to true;
215
+ // //req.skipRawBodyParser = true;
216
+ // next();
217
+ //},
218
+
219
+ /** When httpAdminRoot is used to move the UI to a different root path, the
220
+ * following property can be used to identify a directory of static content
221
+ * that should be served at http://localhost:1880/.
222
+ * When httpStaticRoot is set differently to httpAdminRoot, there is no need
223
+ * to move httpAdminRoot
224
+ */
225
+ //httpStatic: '/home/nol/node-red-static/', //single static source
226
+ /**
227
+ * OR multiple static sources can be created using an array of objects...
228
+ * Each object can also contain an options object for further configuration.
229
+ * See https://expressjs.com/en/api.html#express.static for available options.
230
+ */
231
+ //httpStatic: [
232
+ // {path: '/home/nol/pics/', root: "/img/"},
233
+ // {path: '/home/nol/reports/', root: "/doc/"},
234
+ // {path: '/home/nol/videos/', root: "/vid/", options: {maxAge: '1d'}}
235
+ //],
236
+
237
+ /**
238
+ * All static routes will be appended to httpStaticRoot
239
+ * e.g. if httpStatic = "/home/nol/docs" and httpStaticRoot = "/static/"
240
+ * then "/home/nol/docs" will be served at "/static/"
241
+ * e.g. if httpStatic = [{path: '/home/nol/pics/', root: "/img/"}]
242
+ * and httpStaticRoot = "/static/"
243
+ * then "/home/nol/pics/" will be served at "/static/img/"
244
+ */
245
+ //httpStaticRoot: '/static/',
246
+
247
+ /*******************************************************************************
248
+ * Runtime Settings
249
+ * - lang
250
+ * - runtimeState
251
+ * - diagnostics
252
+ * - logging
253
+ * - contextStorage
254
+ * - exportGlobalContextKeys
255
+ * - externalModules
256
+ ******************************************************************************/
257
+
258
+ /** Uncomment the following to run node-red in your preferred language.
259
+ * Available languages include: en-US (default), ja, de, zh-CN, zh-TW, ru, ko
260
+ * Some languages are more complete than others.
261
+ */
262
+ // lang: "de",
263
+
264
+ /** Configure diagnostics options
265
+ * - enabled: When `enabled` is `true` (or unset), diagnostics data will
266
+ * be available at http://localhost:1880/diagnostics
267
+ * - ui: When `ui` is `true` (or unset), the action `show-system-info` will
268
+ * be available to logged in users of node-red editor
269
+ */
270
+ diagnostics: {
271
+ /** enable or disable diagnostics endpoint. Must be set to `false` to disable */
272
+ enabled: true,
273
+ /** enable or disable diagnostics display in the node-red editor. Must be set to `false` to disable */
274
+ ui: true,
275
+ },
276
+ /** Configure runtimeState options
277
+ * - enabled: When `enabled` is `true` flows runtime can be Started/Stopped
278
+ * by POSTing to available at http://localhost:1880/flows/state
279
+ * - ui: When `ui` is `true`, the action `core:start-flows` and
280
+ * `core:stop-flows` will be available to logged in users of node-red editor
281
+ * Also, the deploy menu (when set to default) will show a stop or start button
282
+ */
283
+ runtimeState: {
284
+ /** enable or disable flows/state endpoint. Must be set to `false` to disable */
285
+ enabled: false,
286
+ /** show or hide runtime stop/start options in the node-red editor. Must be set to `false` to hide */
287
+ ui: false,
288
+ },
289
+ /** Configure the logging output */
290
+ logging: {
291
+ /** Only console logging is currently supported */
292
+ console: {
293
+ /** Level of logging to be recorded. Options are:
294
+ * fatal - only those errors which make the application unusable should be recorded
295
+ * error - record errors which are deemed fatal for a particular request + fatal errors
296
+ * warn - record problems which are non fatal + errors + fatal errors
297
+ * info - record information about the general running of the application + warn + error + fatal errors
298
+ * debug - record information which is more verbose than info + info + warn + error + fatal errors
299
+ * trace - record very detailed logging + debug + info + warn + error + fatal errors
300
+ * off - turn off all logging (doesn't affect metrics or audit)
301
+ */
302
+ level: "info",
303
+ /** Whether or not to include metric events in the log output */
304
+ metrics: false,
305
+ /** Whether or not to include audit events in the log output */
306
+ audit: false
307
+ }
308
+ },
309
+
310
+ /** Context Storage
311
+ * The following property can be used to enable context storage. The configuration
312
+ * provided here will enable file-based context that flushes to disk every 30 seconds.
313
+ * Refer to the documentation for further options: https://nodered.org/docs/api/context/
314
+ */
315
+ //contextStorage: {
316
+ // default: {
317
+ // module:"localfilesystem"
318
+ // },
319
+ //},
320
+
321
+ /** `global.keys()` returns a list of all properties set in global context.
322
+ * This allows them to be displayed in the Context Sidebar within the editor.
323
+ * In some circumstances it is not desirable to expose them to the editor. The
324
+ * following property can be used to hide any property set in `functionGlobalContext`
325
+ * from being list by `global.keys()`.
326
+ * By default, the property is set to false to avoid accidental exposure of
327
+ * their values. Setting this to true will cause the keys to be listed.
328
+ */
329
+ exportGlobalContextKeys: false,
330
+
331
+ /** Configure how the runtime will handle external npm modules.
332
+ * This covers:
333
+ * - whether the editor will allow new node modules to be installed
334
+ * - whether nodes, such as the Function node are allowed to have their
335
+ * own dynamically configured dependencies.
336
+ * The allow/denyList options can be used to limit what modules the runtime
337
+ * will install/load. It can use '*' as a wildcard that matches anything.
338
+ */
339
+ externalModules: {
340
+ // autoInstall: false, /** Whether the runtime will attempt to automatically install missing modules */
341
+ // autoInstallRetry: 30, /** Interval, in seconds, between reinstall attempts */
342
+ // palette: { /** Configuration for the Palette Manager */
343
+ // allowInstall: true, /** Enable the Palette Manager in the editor */
344
+ // allowUpdate: true, /** Allow modules to be updated in the Palette Manager */
345
+ // allowUpload: true, /** Allow module tgz files to be uploaded and installed */
346
+ // allowList: ['*'],
347
+ // denyList: [],
348
+ // allowUpdateList: ['*'],
349
+ // denyUpdateList: []
350
+ // },
351
+ // modules: { /** Configuration for node-specified modules */
352
+ // allowInstall: true,
353
+ // allowList: [],
354
+ // denyList: []
355
+ // }
356
+ },
357
+
358
+
359
+ /*******************************************************************************
360
+ * Editor Settings
361
+ * - disableEditor
362
+ * - editorTheme
363
+ ******************************************************************************/
364
+
365
+ /** The following property can be used to disable the editor. The admin API
366
+ * is not affected by this option. To disable both the editor and the admin
367
+ * API, use either the httpRoot or httpAdminRoot properties
368
+ */
369
+ //disableEditor: false,
370
+
371
+ /** Customising the editor
372
+ * See https://nodered.org/docs/user-guide/runtime/configuration#editor-themes
373
+ * for all available options.
374
+ */
375
+ editorTheme: {
376
+ /** The following property can be used to set a custom theme for the editor.
377
+ * See https://github.com/node-red-contrib-themes/theme-collection for
378
+ * a collection of themes to chose from.
379
+ */
380
+ //theme: "",
381
+
382
+ /** To disable the 'Welcome to Node-RED' tour that is displayed the first
383
+ * time you access the editor for each release of Node-RED, set this to false
384
+ */
385
+ //tours: false,
386
+
387
+ palette: {
388
+ /** The following property can be used to order the categories in the editor
389
+ * palette. If a node's category is not in the list, the category will get
390
+ * added to the end of the palette.
391
+ * If not set, the following default order is used:
392
+ */
393
+ //categories: ['subflows', 'common', 'function', 'network', 'sequence', 'parser', 'storage'],
394
+ },
395
+
396
+ projects: {
397
+ /** To enable the Projects feature, set this value to true */
398
+ enabled: false,
399
+ workflow: {
400
+ /** Set the default projects workflow mode.
401
+ * - manual - you must manually commit changes
402
+ * - auto - changes are automatically committed
403
+ * This can be overridden per-user from the 'Git config'
404
+ * section of 'User Settings' within the editor
405
+ */
406
+ mode: "manual"
407
+ }
408
+ },
409
+
410
+ codeEditor: {
411
+ /** Select the text editor component used by the editor.
412
+ * As of Node-RED V3, this defaults to "monaco", but can be set to "ace" if desired
413
+ */
414
+ lib: "monaco",
415
+ options: {
416
+ /** The follow options only apply if the editor is set to "monaco"
417
+ *
418
+ * theme - must match the file name of a theme in
419
+ * packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
420
+ * e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
421
+ */
422
+ // theme: "vs",
423
+ /** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc.
424
+ * for the full list, see https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html
425
+ */
426
+ //fontSize: 14,
427
+ //fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
428
+ //fontLigatures: true,
429
+ }
430
+ },
431
+
432
+ markdownEditor: {
433
+ mermaid: {
434
+ /** enable or disable mermaid diagram in markdown document
435
+ */
436
+ enabled: true
437
+ }
438
+ },
439
+
440
+ },
441
+
442
+ /*******************************************************************************
443
+ * Node Settings
444
+ * - fileWorkingDirectory
445
+ * - functionGlobalContext
446
+ * - functionExternalModules
447
+ * - functionTimeout
448
+ * - nodeMessageBufferMaxLength
449
+ * - ui (for use with Node-RED Dashboard)
450
+ * - debugUseColors
451
+ * - debugMaxLength
452
+ * - execMaxBufferSize
453
+ * - httpRequestTimeout
454
+ * - mqttReconnectTime
455
+ * - serialReconnectTime
456
+ * - socketReconnectTime
457
+ * - socketTimeout
458
+ * - tcpMsgQueueSize
459
+ * - inboundWebSocketTimeout
460
+ * - tlsConfigDisableLocalFiles
461
+ * - webSocketNodeVerifyClient
462
+ ******************************************************************************/
463
+
464
+ /** The working directory to handle relative file paths from within the File nodes
465
+ * defaults to the working directory of the Node-RED process.
466
+ */
467
+ //fileWorkingDirectory: "",
468
+
469
+ /** Allow the Function node to load additional npm modules directly */
470
+ functionExternalModules: true,
471
+
472
+ /** Default timeout, in seconds, for the Function node. 0 means no timeout is applied */
473
+ functionTimeout: 0,
474
+
475
+ /** The following property can be used to set predefined values in Global Context.
476
+ * This allows extra node modules to be made available with in Function node.
477
+ * For example, the following:
478
+ * functionGlobalContext: { os:require('os') }
479
+ * will allow the `os` module to be accessed in a Function node using:
480
+ * global.get("os")
481
+ */
482
+ functionGlobalContext: {
483
+ // os:require('os'),
484
+ },
485
+
486
+ /** The maximum number of messages nodes will buffer internally as part of their
487
+ * operation. This applies across a range of nodes that operate on message sequences.
488
+ * defaults to no limit. A value of 0 also means no limit is applied.
489
+ */
490
+ //nodeMessageBufferMaxLength: 0,
491
+
492
+ /** If you installed the optional node-red-dashboard you can set it's path
493
+ * relative to httpNodeRoot
494
+ * Other optional properties include
495
+ * readOnly:{boolean},
496
+ * middleware:{function or array}, (req,res,next) - http middleware
497
+ * ioMiddleware:{function or array}, (socket,next) - socket.io middleware
498
+ */
499
+ //ui: { path: "ui" },
500
+
501
+ /** Colourise the console output of the debug node */
502
+ //debugUseColors: true,
503
+
504
+ /** The maximum length, in characters, of any message sent to the debug sidebar tab */
505
+ debugMaxLength: 1000,
506
+
507
+ /** Maximum buffer size for the exec node. Defaults to 10Mb */
508
+ //execMaxBufferSize: 10000000,
509
+
510
+ /** Timeout in milliseconds for HTTP request connections. Defaults to 120s */
511
+ //httpRequestTimeout: 120000,
512
+
513
+ /** Retry time in milliseconds for MQTT connections */
514
+ mqttReconnectTime: 15000,
515
+
516
+ /** Retry time in milliseconds for Serial port connections */
517
+ serialReconnectTime: 15000,
518
+
519
+ /** Retry time in milliseconds for TCP socket connections */
520
+ //socketReconnectTime: 10000,
521
+
522
+ /** Timeout in milliseconds for TCP server socket connections. Defaults to no timeout */
523
+ //socketTimeout: 120000,
524
+
525
+ /** Maximum number of messages to wait in queue while attempting to connect to TCP socket
526
+ * defaults to 1000
527
+ */
528
+ //tcpMsgQueueSize: 2000,
529
+
530
+ /** Timeout in milliseconds for inbound WebSocket connections that do not
531
+ * match any configured node. Defaults to 5000
532
+ */
533
+ //inboundWebSocketTimeout: 5000,
534
+
535
+ /** To disable the option for using local files for storing keys and
536
+ * certificates in the TLS configuration node, set this to true.
537
+ */
538
+ //tlsConfigDisableLocalFiles: true,
539
+
540
+ /** The following property can be used to verify WebSocket connection attempts.
541
+ * This allows, for example, the HTTP request headers to be checked to ensure
542
+ * they include valid authentication information.
543
+ */
544
+ //webSocketNodeVerifyClient: function(info) {
545
+ // /** 'info' has three properties:
546
+ // * - origin : the value in the Origin header
547
+ // * - req : the HTTP request
548
+ // * - secure : true if req.connection.authorized or req.connection.encrypted is set
549
+ // *
550
+ // * The function should return true if the connection should be accepted, false otherwise.
551
+ // *
552
+ // * Alternatively, if this function is defined to accept a second argument, callback,
553
+ // * it can be used to verify the client asynchronously.
554
+ // * The callback takes three arguments:
555
+ // * - result : boolean, whether to accept the connection or not
556
+ // * - code : if result is false, the HTTP error status to return
557
+ // * - reason: if result is false, the HTTP reason string to return
558
+ // */
559
+ //},
560
+ }
package/Dockerfile ADDED
@@ -0,0 +1,19 @@
1
+ FROM node:20 as builder
2
+
3
+
4
+ COPY ./ /src/node-red-contrib-processcube
5
+
6
+ WORKDIR /src/node-red-contrib-processcube
7
+
8
+ RUN npm install
9
+
10
+
11
+ FROM nodered/node-red:latest
12
+
13
+ RUN npm install node-red-contrib-graphql
14
+ RUN npm install openapi-red
15
+ RUN npm install node-red-contrib-postgresql
16
+
17
+ COPY --from=builder /src/node-red-contrib-processcube /src/node-red-contrib-processcube
18
+
19
+ RUN npm install /src/node-red-contrib-processcube/
@@ -0,0 +1,25 @@
1
+ const EventEmitter = require('node:events');
2
+
3
+ const eventEmitter = new EventEmitter();
4
+
5
+ const eventSubscriptionDictionary = {};
6
+
7
+ function subscribeOnce(eventName, callback) {
8
+ eventSubscriptionDictionary[eventName] = callback;
9
+ }
10
+
11
+ async function publish(eventName, payload) {
12
+ const callback = eventSubscriptionDictionary[eventName];
13
+
14
+ if (callback) {
15
+ await callback(payload);
16
+ delete eventSubscriptionDictionary[eventName]
17
+ }
18
+ }
19
+
20
+ module.exports = {
21
+ eventEmitter: eventEmitter,
22
+ subscribeOnce: subscribeOnce,
23
+ publish: publish,
24
+ countSubscriptions: () => Object.keys(eventSubscriptionDictionary).length
25
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 5Minds IT-Solutions GmbH & Co. KG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ ## Build
2
+
3
+ docker-compose build
4
+
5
+ ## Run
6
+
7
+ docker-compose up -d
8
+
9
+ Engine: http://localhost:8000
10
+
11
+ NodeRed: http://localhost:1880