@theotherwillembotha/node-red-plugincore 0.0.54 → 0.1.0

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.
Files changed (93) hide show
  1. package/README.md +9 -9
  2. package/build/GenerateNodes.js +0 -1
  3. package/build/Nodes.html +23 -162
  4. package/build/Nodes.js +0 -2
  5. package/build/Plugins.js +2 -3
  6. package/build/core/NodeConstructor.d.ts +1 -0
  7. package/build/core/NodeConstructor.d.ts.map +1 -1
  8. package/build/core/NodeConstructor.js +20 -62
  9. package/build/core/NodeGenerator.d.ts.map +1 -1
  10. package/build/core/NodeGenerator.js +8 -11
  11. package/build/core/logger/LoggerDecorator.d.ts.map +1 -1
  12. package/build/core/logger/LoggerDecorator.js +34 -38
  13. package/build/core/logger/node/ConsoleLoggerConfigNode.d.ts +11 -7
  14. package/build/core/logger/node/ConsoleLoggerConfigNode.d.ts.map +1 -1
  15. package/build/core/logger/node/ConsoleLoggerConfigNode.js +24 -10
  16. package/build/core/logger/node/RestLoggerConfigNode.d.ts +22 -6
  17. package/build/core/logger/node/RestLoggerConfigNode.d.ts.map +1 -1
  18. package/build/core/logger/node/RestLoggerConfigNode.js +93 -23
  19. package/build/core/logger/service/LoggerService.d.ts +59 -68
  20. package/build/core/logger/service/LoggerService.d.ts.map +1 -1
  21. package/build/core/logger/service/LoggerService.js +76 -165
  22. package/build/core/logger/template/LoggerTemplate.d.ts +9 -1
  23. package/build/core/logger/template/LoggerTemplate.d.ts.map +1 -1
  24. package/build/core/metrics/node/CounterMetricConfigNode.js +0 -2
  25. package/build/core/metrics/node/GaugeMetricConfigNode.js +0 -2
  26. package/build/core/metrics/node/MetricsConfigNode.js +0 -1
  27. package/build/core/metrics/node/TimerMetricConfigNode.js +0 -2
  28. package/build/core/metrics/service/MetricsService.js +10 -24
  29. package/build/core/other/service/SettingsService.js +0 -2
  30. package/build/core/tagging/service/NodeTypeService.js +1 -2
  31. package/build/core/webhook/WebhookDecorator.d.ts.map +1 -1
  32. package/build/core/webhook/WebhookDecorator.js +47 -10
  33. package/build/core/webhook/node/WebhookServerConfigNode.js +0 -1
  34. package/build/core/webhook/service/ReverseProxyTypeService.d.ts +1 -2
  35. package/build/core/webhook/service/ReverseProxyTypeService.d.ts.map +1 -1
  36. package/build/core/webhook/service/ReverseProxyTypeService.js +1 -6
  37. package/build/core/webhook/service/WebhookServerService.d.ts +1 -1
  38. package/build/core/webhook/service/WebhookServerService.d.ts.map +1 -1
  39. package/build/core/webhook/service/WebhookServerService.js +6 -14
  40. package/build/core/webhook/template/WebhookTemplate.d.ts +1 -1
  41. package/build/core/webhook/template/WebhookTemplate.d.ts.map +1 -1
  42. package/build/index.d.ts +1 -2
  43. package/build/index.d.ts.map +1 -1
  44. package/build/index.js +1 -2
  45. package/build/resources/editorLanguageExtension.js +1 -2
  46. package/package.json +6 -5
  47. package/resources/editorLanguageExtension.js +1 -2
  48. package/src/GenerateNodes.ts +2 -2
  49. package/src/core/NodeConstructor.ts +7 -14
  50. package/src/core/NodeGenerator.ts +2 -3
  51. package/src/core/logger/LoggerDecorator.ts +56 -53
  52. package/src/core/logger/node/ConsoleLoggerConfigNode.ts +39 -14
  53. package/src/core/logger/node/RestLoggerConfigNode.ts +128 -25
  54. package/src/core/logger/service/LoggerService.ts +103 -239
  55. package/src/core/logger/template/LoggerTemplate.html +2 -2
  56. package/src/core/logger/template/LoggerTemplate.ts +11 -1
  57. package/src/core/metrics/node/TimerMetricConfigNode.html +2 -2
  58. package/src/core/other/template/BasicTemplate.html +5 -2
  59. package/src/core/webhook/WebhookDecorator.ts +54 -13
  60. package/src/core/webhook/service/ReverseProxyTypeService.ts +1 -4
  61. package/src/core/webhook/service/WebhookServerService.ts +1 -6
  62. package/src/core/webhook/template/WebhookTemplate.html +1 -1
  63. package/src/core/webhook/template/WebhookTemplate.ts +1 -1
  64. package/src/index.ts +2 -2
  65. package/build/core/logger/node/ConsoleLoggerConfigNode.html +0 -90
  66. package/build/core/logger/node/LokiLoggerConfigNode.d.ts +0 -20
  67. package/build/core/logger/node/LokiLoggerConfigNode.d.ts.map +0 -1
  68. package/build/core/logger/node/LokiLoggerConfigNode.html +0 -117
  69. package/build/core/logger/node/LokiLoggerConfigNode.js +0 -53
  70. package/build/core/logger/node/RestLoggerConfigNode.html +0 -183
  71. package/build/core/logger/service/LoggerServiceTypes.d.ts +0 -24
  72. package/build/core/logger/service/LoggerServiceTypes.d.ts.map +0 -1
  73. package/build/core/logger/service/LoggerServiceTypes.js +0 -30
  74. package/build/core/logger/template/LoggerTemplate.html +0 -331
  75. package/build/core/metrics/node/CounterMetricConfigNode.html +0 -48
  76. package/build/core/metrics/node/GaugeMetricConfigNode.html +0 -48
  77. package/build/core/metrics/node/MetricsConfigNode.html +0 -21
  78. package/build/core/metrics/node/TimerMetricConfigNode.html +0 -190
  79. package/build/core/metrics/template/CounterMetricTemplate.html +0 -40
  80. package/build/core/metrics/template/GaugeMetricTemplate.html +0 -39
  81. package/build/core/metrics/template/MetricsTemplate.html +0 -54
  82. package/build/core/metrics/template/TimerMetricTemplate.html +0 -39
  83. package/build/core/other/node/DelegatedConfigReferenceNode.html +0 -1
  84. package/build/core/other/template/BasicTemplate.html +0 -76
  85. package/build/core/other/template/SettingsTemplate.html +0 -128
  86. package/build/core/ui/template/ScriptEditorTemplate.html +0 -50
  87. package/build/core/ui/template/UIHelperTemplate.html +0 -229
  88. package/build/core/webhook/node/WebhookServerConfigNode.html +0 -61
  89. package/build/core/webhook/template/WebhookTemplate.html +0 -442
  90. package/documentation/LokiLoggerConfigNode.png +0 -0
  91. package/src/core/logger/node/LokiLoggerConfigNode.html +0 -117
  92. package/src/core/logger/node/LokiLoggerConfigNode.ts +0 -58
  93. package/src/core/logger/service/LoggerServiceTypes.ts +0 -26
package/README.md CHANGED
@@ -16,9 +16,14 @@ This framework is the foundation for a growing set of Node-RED plugins. The foll
16
16
  | Plugin | Description |
17
17
  |--------|-------------|
18
18
  | [@theotherwillembotha/node-red-telemetry](https://github.com/theotherwillembotha/nodered_telemetry) | Ready-to-use flow nodes for structured logging and Prometheus metrics — Logger, Counter, Gauge, and Timer nodes that attach to the config nodes provided by this package. |
19
+ | [@theotherwillembotha/node-red-loki](https://github.com/theotherwillembotha/nodered_loki) | Grafana Loki integration for Node-RED. Provides a Loki service config node, a Loki logger config node that plugs into the logging infrastructure provided by this package, and a LogQL query node for reading log streams from Loki. |
19
20
  | [@theotherwillembotha/node-red-nginxproxymanager](https://github.com/theotherwillembotha/nodered_nginxproxymanager) | Node-RED nodes for managing Nginx Proxy Manager hosts directly from your flows. Includes a config node that registers as a reverse proxy provider, an Update Host node for creating and updating proxy entries, and a Get Hosts node for retrieving the current host list. |
20
21
  | [@theotherwillembotha/node-red-circuitbreaker](https://github.com/theotherwillembotha/nodered_circuitbreaker) | Circuit Breaker nodes for building resilient flows. Detects faults in external integrations using configurable fault and trip functions, routes messages based on breaker state, and supports event-driven recovery flows. |
21
- | [@theotherwillembotha/node-red-temporal](https://github.com/theotherwillembotha/nodered_temporal) | Date/time transformation nodes powered by the TC39 Temporal API. Parse, convert, adjust, and format date/time values across timezones using named presets or Moment.js-style custom format strings. |
22
+ | [@theotherwillembotha/node-red-temporal](https://github.com/theotherwillembotha/nodered_temporal) | Date/time nodes powered by the TC39 Temporal API. Transform, adjust, and format date/time values across timezones, or compute the duration between two points in time — with multiple output modes, offset support, and a Moment.js-style custom format system. |
23
+ | [@theotherwillembotha/node-red-zookeeper](https://github.com/theotherwillembotha/nodered_zookeeper) | Apache ZooKeeper integration nodes. Subscribe to ZooKeeper node change events, read node values on demand, and write data to ZooKeeper nodes from your flows. |
24
+ | [@theotherwillembotha/node-red-whatsapp](https://github.com/theotherwillembotha/nodered_whatsapp) | WhatsApp messaging nodes for Node-RED. Send and receive WhatsApp messages from your flows using the Baileys library — no cloud API or paid subscription required. |
25
+ | [@theotherwillembotha/node-red-cluster](https://github.com/theotherwillembotha/nodered_cluster) | Clustering plugin for Node-RED. Connect multiple Node-RED instances into a coordinated cluster using NATS JetStream for reliable message transport and NATS KV for shared state, with ZooKeeper-based instance discovery and endpoint registration. |
26
+ | [@theotherwillembotha/node-red-kafka](https://github.com/theotherwillembotha/nodered_kafka) | Apache Kafka producer and consumer nodes for Node-RED. Publish messages to Kafka topics and subscribe to incoming records directly from your flows. |
22
27
 
23
28
  Additional plugins will be listed here as they are published.
24
29
 
@@ -42,7 +47,7 @@ Config nodes are shared resources configured once and referenced across your flo
42
47
 
43
48
  #### Logging
44
49
 
45
- Three logger backends are supported. All expose the same interface and are interchangeable — any node built with the `@Logger` decorator can use any of them.
50
+ Two logger backends are built in. Additional backends are available as separate plugins (see the [plugin ecosystem](#plugin-ecosystem) table above). All expose the same interface and are interchangeable — any node built with the `@Logger` decorator can use any of them.
46
51
 
47
52
  **Console Logger** — writes structured log output to stdout via Winston. Ideal for development and containerised deployments that forward stdout to a log aggregator.
48
53
 
@@ -52,11 +57,7 @@ Three logger backends are supported. All expose the same interface and are inter
52
57
 
53
58
  ![REST Logger Config](documentation/RestLoggerConfigNode.png)
54
59
 
55
- **Loki Logger** pushes log entries to a Grafana Loki instance via the Loki HTTP API. Supports multi-tenant deployments via the Tenant ID field.
56
-
57
- ![Loki Logger Config](documentation/LokiLoggerConfigNode.png)
58
-
59
- All three loggers share a **Level** selector (debug, info, warn, error) and a **Template** field — a Handlebars template that controls the shape of each log entry. The default `message:{{msg}}` passes the raw message through; you can customise it to include only the fields you care about.
60
+ All loggers share a **Level** selector (debug, info, warn, error) and a **Template** field a Handlebars template that controls the shape of each log entry. The default `message:{{msg}}` passes the raw message through; you can customise it to include only the fields you care about.
60
61
 
61
62
  #### Metrics
62
63
 
@@ -383,7 +384,7 @@ Create a `GenerateNodes.ts` at the root of your `src/` directory. This is the co
383
384
  import { NodeGenerator } from "@theotherwillembotha/node-red-plugincore";
384
385
  import {
385
386
  LoggerService, LoggerTemplate,
386
- ConsoleLoggerConfigNode, RestLoggerConfigNode, LokiLoggerConfigNode
387
+ ConsoleLoggerConfigNode, RestLoggerConfigNode
387
388
  } from "@theotherwillembotha/node-red-plugincore";
388
389
  import { MyNode } from "./nodes/MyNode";
389
390
 
@@ -392,7 +393,6 @@ new NodeGenerator("./src/")
392
393
  .registerTemplate(LoggerTemplate)
393
394
  .registerNode(ConsoleLoggerConfigNode)
394
395
  .registerNode(RestLoggerConfigNode)
395
- .registerNode(LokiLoggerConfigNode)
396
396
  .registerNode(MyNode)
397
397
  .generate("./build/Nodes", "./build/Plugins");
398
398
 
@@ -29,7 +29,6 @@ new index_js_1.NodeGenerator("./src/core/")
29
29
  .registerNode(DelegatedConfigReferenceNode_js_1.DelegatedConfigReferenceNode)
30
30
  .registerNode(index_js_1.ConsoleLoggerConfigNode)
31
31
  .registerNode(index_js_1.RestLoggerConfigNode)
32
- .registerNode(index_js_1.LokiLoggerConfigNode)
33
32
  .registerNode(index_js_5.MetricsConfigNode)
34
33
  .registerNode(index_js_5.CounterMetricConfigNode)
35
34
  .registerNode(index_js_5.GaugeMetricConfigNode)
package/build/Nodes.html CHANGED
@@ -366,147 +366,6 @@ Mustache/Handlebars templates build the message string POSTed to the endpoint.
366
366
  - [Mustache — Wikipedia](https://en.wikipedia.org/wiki/Mustache_(template_system))
367
367
  - [Mustache — Playground](https://jgonggrijp.gitlab.io/wontache/playground.html)
368
368
  </script>
369
- <script type="text/javascript">
370
- RED.nodes.registerType('LokiLoggerConfigNode', {
371
- category: 'config',
372
- label: function() {
373
- return this.name
374
- },
375
- paletteLabel: 'Loki Logger Config Node',
376
- defaults: {
377
- name: {
378
- value: 'Logger Example',
379
- required: true
380
- },
381
- template: {
382
- value: 'message:{{msg}}',
383
- required: true
384
- },
385
- level: {
386
- value: 'info',
387
- required: true
388
- },
389
- loki_host: {},
390
- loki_tenantid: {},
391
- loki_userid: {},
392
- loki_authtoken: {},
393
- },
394
- oneditprepare: function() {
395
- // **** LokiLoggerConfigNode **** //
396
- {
397
- let node = this;
398
- let levelSelection = $("#node-config-input-level");
399
- levelSelection.typedInput({
400
- type: "level",
401
- types: [{
402
- value: "level",
403
- options: [{
404
- value: "DEBUG",
405
- label: "debug"
406
- }, {
407
- value: "INFO",
408
- label: "info"
409
- }, {
410
- value: "WARNING",
411
- label: "warning"
412
- }, {
413
- value: "ERROR",
414
- label: "error"
415
- }, ]
416
- }]
417
- });
418
- this.editor = RED.editor.createEditor({
419
- id: 'node-config-input-templateEditor',
420
- mode: 'ace/mode/handlebars',
421
- value: this.template
422
- });
423
- }
424
- },
425
- oneditsave: function() {
426
- // **** LokiLoggerConfigNode **** //
427
- {
428
- let node = this;
429
- this.template = this.editor.getValue();
430
- this.editor.destroy();
431
- delete this.editor;
432
- }
433
- },
434
- oneditcancel: function() {},
435
- oneditdelete: function() {},
436
- });
437
-
438
- </script>
439
-
440
-
441
- <script type="text/html" data-template-name='LokiLoggerConfigNode'>
442
- <div id='section_LokiLoggerConfigNode'>
443
- <div id="LoggerConfig">
444
- <div class="form-row">
445
- <label class="towb_editorlabel" for="node-config-input-name"><i class="fa fa-font"></i> Name</label>
446
- <input type="text" id="node-config-input-name" />
447
- </div>
448
-
449
- <div class="form-row">
450
- <label class="towb_editorlabel" for="node-config-input-level"><i class="fa fa-signal"></i> Level</label>
451
- <input type="text" id="node-config-input-level" />
452
- </div>
453
-
454
- <div class="form-row">
455
- <label class="towb_editorlabel" for="node-config-input-loki_host"><i class="fa fa-server"></i> Host</label>
456
- <input class="required" type="text" id="node-config-input-loki_host" />
457
- </div>
458
- <div class="form-row">
459
- <label class="towb_editorlabel" for="node-config-input-loki_tenantid"><i class="fa fa-building-o"></i> Tenant ID</label>
460
- <input class="" type="text" id="node-config-input-loki_tenantid" />
461
- </div>
462
- <div class="form-row">
463
- <label class="towb_editorlabel" for="node-config-input-loki_userid"><i class="fa fa-user"></i> Username</label>
464
- <input class="" type="text" id="node-config-input-loki_userid" />
465
- </div>
466
- <div class="form-row">
467
- <label class="towb_editorlabel" for="node-config-input-loki_authtoken"><i class="fa fa-key"></i> Auth Token</label>
468
- <input class="" type="password" id="node-config-input-loki_authtoken" />
469
- </div>
470
-
471
- <div class="form-row">
472
- <label class="towb_editorlabel" for="node-config-input-templateEditor"><i class="fa fa-code"></i> Template</label>
473
- <div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-config-input-templateEditor"></div>
474
- </div>
475
- </div>
476
-
477
- </div>
478
- </script>
479
-
480
- <script type="text/markdown" data-help-name='LokiLoggerConfigNode'>
481
- Pushes log messages to a Grafana Loki instance using the Loki HTTP API.
482
-
483
- ### Properties
484
- : *name* (string) : A descriptive name for this logger configuration.
485
- : *level* (level) : The minimum log level. Messages below this threshold are suppressed. Options: DEBUG, INFO, WARNING, ERROR.
486
- : *host* (string) : The base URL of the Loki instance, including port (e.g. `http://localhost:3100`).
487
- : *tenant ID* (string) : The tenant identifier for multi-tenant Loki deployments (`X-Scope-OrgID` header). Leave blank for single-tenant deployments.
488
- : *username* (string) : Username for Loki authentication.
489
- : *auth token* (string) : Authentication token or password for Loki.
490
- : *template* (mustache) : A Mustache/Handlebars template that formats the log message body.
491
-
492
- ### Mustache Templating
493
- Mustache/Handlebars templates build the message string pushed to Loki.
494
-
495
- #### Provided Properties
496
- : *msg* (object) : The Node-RED message object passed through the node.
497
- : *currentTime* (string) : The current time in ISO 8601 format.
498
-
499
- #### Helpers
500
- : *json* (helper) : Serialises an object to a JSON string using `JSON.stringify`.
501
-
502
- #### Examples
503
- - `{{{json msg}}}` — serialises the full message object as JSON.
504
-
505
- #### References
506
- - [Grafana Loki — HTTP API](https://grafana.com/docs/loki/latest/reference/loki-http-api/)
507
- - [Mustache — Wikipedia](https://en.wikipedia.org/wiki/Mustache_(template_system))
508
- - [Mustache — Playground](https://jgonggrijp.gitlab.io/wontache/playground.html)
509
- </script>
510
369
  <!-- webhook -->
511
370
  <script type="text/javascript">
512
371
  // CSS
@@ -581,50 +440,59 @@ Mustache/Handlebars templates build the message string pushed to Loki.
581
440
  required: false
582
441
  },
583
442
  reverseProxies_connections: {
584
- type: 'ReverseProxyType[]',
585
443
  value: '',
586
- required: true,
444
+ required: false,
587
445
  maxInstances: 10
588
446
  },
589
447
  _reverseProxies_connections_0: {
590
448
  value: '',
591
- required: false
449
+ required: false,
450
+ type: 'DelegatedConfigReferenceNode'
592
451
  },
593
452
  _reverseProxies_connections_1: {
594
453
  value: '',
595
- required: false
454
+ required: false,
455
+ type: 'DelegatedConfigReferenceNode'
596
456
  },
597
457
  _reverseProxies_connections_2: {
598
458
  value: '',
599
- required: false
459
+ required: false,
460
+ type: 'DelegatedConfigReferenceNode'
600
461
  },
601
462
  _reverseProxies_connections_3: {
602
463
  value: '',
603
- required: false
464
+ required: false,
465
+ type: 'DelegatedConfigReferenceNode'
604
466
  },
605
467
  _reverseProxies_connections_4: {
606
468
  value: '',
607
- required: false
469
+ required: false,
470
+ type: 'DelegatedConfigReferenceNode'
608
471
  },
609
472
  _reverseProxies_connections_5: {
610
473
  value: '',
611
- required: false
474
+ required: false,
475
+ type: 'DelegatedConfigReferenceNode'
612
476
  },
613
477
  _reverseProxies_connections_6: {
614
478
  value: '',
615
- required: false
479
+ required: false,
480
+ type: 'DelegatedConfigReferenceNode'
616
481
  },
617
482
  _reverseProxies_connections_7: {
618
483
  value: '',
619
- required: false
484
+ required: false,
485
+ type: 'DelegatedConfigReferenceNode'
620
486
  },
621
487
  _reverseProxies_connections_8: {
622
488
  value: '',
623
- required: false
489
+ required: false,
490
+ type: 'DelegatedConfigReferenceNode'
624
491
  },
625
492
  _reverseProxies_connections_9: {
626
493
  value: '',
627
- required: false
494
+ required: false,
495
+ type: 'DelegatedConfigReferenceNode'
628
496
  },
629
497
  },
630
498
  oneditprepare: function() {
@@ -884,13 +752,6 @@ Mustache/Handlebars templates build the message string pushed to Loki.
884
752
  });
885
753
  console.log(node.reverseProxies_connections);
886
754
  }
887
- // **** MetricsConfigNode_shaddowDefaults **** //
888
- {
889
- let node = this;
890
- for (let i = 0; i < 10; i++) {
891
- node["_reverseProxies_connections_" + i] = (node.reverseProxies_connections[i] || {}).proxy || "";
892
- }
893
- }
894
755
  },
895
756
  oneditcancel: function() {},
896
757
  oneditdelete: function() {},
@@ -1457,13 +1318,13 @@ Configuration node for the Gauge Metrics
1457
1318
 
1458
1319
  <div class="form-row">
1459
1320
  <label class="towb_editorlabel" for="node-config-input-metricType"><i class="fa fa-bar-chart"></i> Type</label>
1460
- <input class="towb_editorfield" type="text" id="node-config-input-metricType" />
1321
+ <input type="text" id="node-config-input-metricType" />
1461
1322
  </div>
1462
1323
 
1463
1324
  <div class="metrictype metrictype_histogram">
1464
1325
  <div class="form-row">
1465
1326
  <label class="towb_editorlabel" for="node-config-input-buckettype"><i class="fa fa-sliders"></i> Bucket Type</label>
1466
- <input class="towb_editorfield" type="text" id="node-config-input-buckettype" />
1327
+ <input type="text" id="node-config-input-buckettype" />
1467
1328
  </div>
1468
1329
 
1469
1330
  <div class="metricsconfig_buckets metricsconfig_buckets_default">
package/build/Nodes.js CHANGED
@@ -12,7 +12,6 @@ const NodeManager = require("@theotherwillembotha/node-red-plugincore").NodeMana
12
12
  const DelegatedConfigReferenceNode = require("@theotherwillembotha/node-red-plugincore").DelegatedConfigReferenceNode;
13
13
  const ConsoleLoggerConfigNode = require("@theotherwillembotha/node-red-plugincore").ConsoleLoggerConfigNode;
14
14
  const RestLoggerConfigNode = require("@theotherwillembotha/node-red-plugincore").RestLoggerConfigNode;
15
- const LokiLoggerConfigNode = require("@theotherwillembotha/node-red-plugincore").LokiLoggerConfigNode;
16
15
  const MetricsConfigNode = require("@theotherwillembotha/node-red-plugincore").MetricsConfigNode;
17
16
  const CounterMetricConfigNode = require("@theotherwillembotha/node-red-plugincore").CounterMetricConfigNode;
18
17
  const GaugeMetricConfigNode = require("@theotherwillembotha/node-red-plugincore").GaugeMetricConfigNode;
@@ -23,7 +22,6 @@ let manager = new NodeManager(RED);
23
22
  manager.registerNodeType("DelegatedConfigReferenceNode", DelegatedConfigReferenceNode);
24
23
  manager.registerNodeType("ConsoleLoggerConfigNode", ConsoleLoggerConfigNode);
25
24
  manager.registerNodeType("RestLoggerConfigNode", RestLoggerConfigNode);
26
- manager.registerNodeType("LokiLoggerConfigNode", LokiLoggerConfigNode);
27
25
  manager.registerNodeType("MetricsConfigNode", MetricsConfigNode);
28
26
  manager.registerNodeType("CounterMetricConfigNode", CounterMetricConfigNode);
29
27
  manager.registerNodeType("GaugeMetricConfigNode", GaugeMetricConfigNode);
package/build/Plugins.js CHANGED
@@ -30,7 +30,6 @@ module.exports = function (RED) {
30
30
  let plugin = RED.plugins.get(pluginID);
31
31
 
32
32
  if(addedPlugin && plugin.instantiate && !plugin.instance){
33
- console.log("Deploying instance of: " + plugin.id);
34
33
  plugin.instance = new plugin.class();
35
34
 
36
35
  // instantiate the plugin.
@@ -46,7 +45,7 @@ module.exports = function (RED) {
46
45
  RED.events.on('runtime-event', async (event) => {
47
46
  // startup deployment.
48
47
  if ("runtime-deploy" === event?.id && startupDeployment) {
49
- console.log("STARTUP DEPLOYMENT");
48
+ //console.log("STARTUP DEPLOYMENT");
50
49
  startupDeployment = false;
51
50
  const flows = await runtime.flows.getFlows({});
52
51
  await plugin.instance.onDeploy(flows);
@@ -54,7 +53,7 @@ module.exports = function (RED) {
54
53
 
55
54
  // stopping flows on redeployment.
56
55
  if ("runtime-state" === event?.id && event?.payload?.state === "stop" && event?.payload?.deploy) {
57
- console.log("REDEPLOY!");
56
+ //console.log("REDEPLOY!");
58
57
  const flows = await runtime.flows.getFlows({});
59
58
  await plugin.instance.onDeploy(flows);
60
59
  }
@@ -136,6 +136,7 @@ export type DefaultTemplateType = {
136
136
  minInstances?: number;
137
137
  maxInstances?: number;
138
138
  validate?: Function;
139
+ list?: boolean;
139
140
  };
140
141
  export declare class NodeBuilder {
141
142
  private _name;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeConstructor.d.ts","sourceRoot":"","sources":["../../src/core/NodeConstructor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAW,uBAAuB,EAAC,MAAM,UAAU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AA2B;IAI5B,SAAS,IAAG,MAAM;IAiDlB,SAAS,IAAG,MAAM;IAQlB,kBAAkB,IAAG,MAAM;CASrC;AAiBD,QAAA,IAAI,SAAS,SAAiB,UAAU,WA4BvC,CAAA;AAED,OAAO,EACH,SAAS,EACZ,CAAA"}
@@ -12,11 +12,8 @@ const js_beautify_1 = __importDefault(require("js-beautify"));
12
12
  const markdown_it_1 = __importDefault(require("markdown-it"));
13
13
  const handlebars_1 = __importDefault(require("handlebars"));
14
14
  class BaseNode {
15
- _node;
16
15
  node() { return this._node; }
17
- _config;
18
16
  config() { return this._config; }
19
- _flow;
20
17
  flow() { return this._flow; }
21
18
  // THIS value is imported from NodeRed Node itself.
22
19
  id() { return this.config().id; }
@@ -51,15 +48,10 @@ class ConfigNode extends BaseNode {
51
48
  }
52
49
  exports.ConfigNode = ConfigNode;
53
50
  class NodeDescriptor {
54
- _group;
55
- _id;
56
- _name;
57
- _sourceFile;
58
- _dependencies = [];
59
- _templates = [];
60
- _package;
61
- _tags = [];
62
51
  constructor(group, id, name, sourceFile, pkg) {
52
+ this._dependencies = [];
53
+ this._templates = [];
54
+ this._tags = [];
63
55
  this._group = group;
64
56
  this._id = id;
65
57
  this._name = name;
@@ -94,10 +86,6 @@ class NodeDescriptor {
94
86
  }
95
87
  exports.NodeDescriptor = NodeDescriptor;
96
88
  class TemplateDescriptor {
97
- _name;
98
- _dependencies;
99
- _clazz;
100
- _templateFile;
101
89
  constructor(name, clazz, templateFile, dependencies) {
102
90
  this._name = name;
103
91
  this._clazz = clazz;
@@ -119,12 +107,6 @@ class TemplateDescriptor {
119
107
  }
120
108
  exports.TemplateDescriptor = TemplateDescriptor;
121
109
  class ServiceDescriptor {
122
- _id;
123
- _name;
124
- _type;
125
- _sourceFile;
126
- _clazz;
127
- _dependencies;
128
110
  constructor(id, name, type, sourceFile, clazz, dependencies) {
129
111
  this._id = id;
130
112
  this._name = name;
@@ -156,10 +138,6 @@ exports.Template = Template;
156
138
  const POST_CONSTRUCT_KEY = Symbol('postConstructInitializers');
157
139
  // Builder class for post-construct decorators
158
140
  class PostConstructDecoratorBuilder {
159
- decoratorName;
160
- initLogic;
161
- validator;
162
- defaultConfig;
163
141
  constructor(decoratorName) {
164
142
  this.decoratorName = decoratorName;
165
143
  }
@@ -291,11 +269,9 @@ let runPostConstructInitializers = function (instance) {
291
269
  };
292
270
  // ************************************************
293
271
  class NodeManager {
294
- static PLUGINID = "node-red-contrib-theotherwillembotha/services-plugin";
295
- static _RED;
296
- nodeTypeService;
297
- typeBacklog = [];
272
+ static { this.PLUGINID = "node-red-contrib-theotherwillembotha/services-plugin"; }
298
273
  constructor(RED) {
274
+ this.typeBacklog = [];
299
275
  NodeManager._RED = RED;
300
276
  let nodeTypeServiceListener = async (pluginID) => {
301
277
  if (pluginID === "@theotherwillembotha/nodetypeservice") {
@@ -314,12 +290,7 @@ class NodeManager {
314
290
  };
315
291
  // check if the reverserproxyttypesewrvice is installed yet.
316
292
  this.nodeTypeService = RED.plugins.get("@theotherwillembotha/nodetypeservice").instance;
317
- if (this.nodeTypeService) {
318
- console.log("NodeTypeService installed!");
319
- }
320
- else {
321
- // Register a listener to trigger when the RegerseProxyTypService gets installed.
322
- console.log("nodetypeservice not installed yet. waiting for it to be installed");
293
+ if (!this.nodeTypeService) {
323
294
  RED.events.on('plugin.instantiated', nodeTypeServiceListener);
324
295
  }
325
296
  }
@@ -342,7 +313,7 @@ class NodeManager {
342
313
  console.error(`Type "${typeName}" has no associated type. Make sure that it was exported and included in the index.js file!`);
343
314
  }
344
315
  let nodeConstructor = function (config) {
345
- console.log("constructing node", typeName);
316
+ //console.log("constructing node", typeName);
346
317
  try {
347
318
  // instantiate the node.
348
319
  NodeManager.RED.nodes.createNode(this, config);
@@ -366,7 +337,6 @@ class NodeManager {
366
337
  }
367
338
  };
368
339
  try {
369
- console.log("registering node " + typeName);
370
340
  NodeManager.RED.nodes.registerType(typeName, nodeConstructor, { settings: {} });
371
341
  let nodeDescription = type.getNodeDescriptor();
372
342
  // registger the node tags.
@@ -378,7 +348,6 @@ class NodeManager {
378
348
  else {
379
349
  this.typeBacklog.push(type);
380
350
  }
381
- console.log("registered node " + typeName);
382
351
  }
383
352
  catch (error) {
384
353
  console.error("registering node: " + typeName + " failed", error);
@@ -388,7 +357,6 @@ class NodeManager {
388
357
  }
389
358
  exports.NodeManager = NodeManager;
390
359
  class BaseService {
391
- _name;
392
360
  constructor(name) {
393
361
  this._name = name;
394
362
  }
@@ -441,36 +409,26 @@ let beautifyOptions = {
441
409
  },
442
410
  };
443
411
  class NodeBuilder {
444
- // see https://nodered.org/docs/creating-nodes/node-html#node-definition
445
- _name;
446
- _category;
447
- _defaults = {};
448
- _credentials; // TODO
449
- _color;
450
- _label;
451
- _icon;
452
- _paletteLabel;
453
- _labelStyle;
454
- _inputs;
455
- _outputs = [];
456
- _onIncludeOnce = [];
457
- _onIncludeEditPrepare = [];
458
- _onIncludeEditSave = [];
459
- _onIncludeEditCancel = [];
460
- _onIncludeEditDelete = [];
461
- _onIncludeEditForm = [];
462
- _onIncludeDocumentation = [];
463
412
  constructor(name, category) {
413
+ this._defaults = {};
414
+ this._outputs = [];
415
+ this._onIncludeOnce = [];
416
+ this._onIncludeEditPrepare = [];
417
+ this._onIncludeEditSave = [];
418
+ this._onIncludeEditCancel = [];
419
+ this._onIncludeEditDelete = [];
420
+ this._onIncludeEditForm = [];
421
+ this._onIncludeDocumentation = [];
464
422
  this._name = name;
465
423
  this._category = category;
466
424
  }
467
425
  addDefault(name, template) {
468
- // if the template type ends with squeare brackets, its an array type.
469
- if (template.type && template.type.endsWith("[]")) {
426
+ // if list:true, this is an array of config references generate shadow defaults for each slot.
427
+ if (template.list === true) {
470
428
  template.maxInstances = template.maxInstances ? template.maxInstances : 10;
471
- this._defaults[name] = { type: template.type, value: "", required: true, maxInstances: template.maxInstances };
429
+ this._defaults[name] = { value: "", required: (template.required) ? template.required : false, maxInstances: template.maxInstances };
472
430
  for (let i = 0; i < template.maxInstances; i++) {
473
- this._defaults["_" + name + "_" + i] = { value: "", required: false };
431
+ this._defaults["_" + name + "_" + i] = { value: "", required: false, type: template.type };
474
432
  }
475
433
  }
476
434
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"NodeGenerator.d.ts","sourceRoot":"","sources":["../../src/core/NodeGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,QAAQ,EAAE,cAAc,EAAe,iBAAiB,EAA4B,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAIrJ,MAAM,WAAW,cAAc;IAC3B,QAAQ,QAAQ,CAAC;IACjB,qBAAqB,IAAI,kBAAkB,CAAC;CAC/C;AAED,MAAM,WAAW,UAAU;IACvB,iBAAiB,IAAG,cAAc,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC1B,oBAAoB,IAAG,iBAAiB,CAAC;CAC5C;AAED,cAAM,aAAa;IAEf,OAAO,CAAC,MAAM,CAAC,WAAW,CAAM;IAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAKpB;IAEF,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,MAAM,CAA4E;IAC1F,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,UAAU,CAA2B;gBAE1B,UAAU,EAAC,MAAM;IAIpC,OAAO,CAAC,aAAa;IAmBd,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa;IAiBzD,YAAY,CAAC,IAAI,EAAC,UAAU,GAAE,aAAa;IAiB3C,eAAe,CAAC,OAAO,EAAE,aAAa,GAAE,aAAa;IAerD,QAAQ,CAAC,eAAe,EAAC,MAAM,EAAE,iBAAiB,EAAC,MAAM;IA0IhE,OAAO,CAAC,MAAM,CAAC,cAAc;CAQhC;AAID,OAAO,EACH,aAAa,EAChB,CAAA;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAC,MAAM,CAAC;CACf;AAmCD,qBAAa,aAAa;WAER,aAAa,CAAC,SAAS,EAAC,MAAM,EAAE,UAAU,EAA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MAAM,GAAE,MAAM;CA2B1E;AAED,MAAM,MAAM,OAAO,GAAG;IAClB,CAAC,GAAG,EAAC,MAAM,GAAE,GAAG,CAAC;CACpB,CAAA"}
@@ -38,18 +38,17 @@ const fs = __importStar(require("fs"));
38
38
  const NodeConstructor_1 = require("./NodeConstructor");
39
39
  const templatePropertyKeys = ["onIncludeOnce", "onIncludeDefaults", "onIncludeEditPrepare", "onIncludeEditPrepare", "onIncludeEditSave", "onIncludeEditForm"];
40
40
  class NodeGenerator {
41
- static headerWidth = 50;
42
- static warning = `
41
+ static { this.headerWidth = 50; }
42
+ static { this.warning = `
43
43
  This file was automatically generated using the NODERED Core utility.
44
44
  Any modifications to his file will be overwritten the next time the code is regenerated.
45
45
 
46
46
  You have been warned.
47
- `;
48
- _rootFolder;
49
- _nodes = {};
50
- _services = [];
51
- _templates = [];
47
+ `; }
52
48
  constructor(rootFolder) {
49
+ this._nodes = {};
50
+ this._services = [];
51
+ this._templates = [];
53
52
  this._rootFolder = rootFolder;
54
53
  }
55
54
  addDependency(dependency) {
@@ -192,7 +191,6 @@ module.exports = function (RED) {
192
191
  let plugin = RED.plugins.get(pluginID);
193
192
 
194
193
  if(addedPlugin && plugin.instantiate && !plugin.instance){
195
- console.log("Deploying instance of: " + plugin.id);
196
194
  plugin.instance = new plugin.class();
197
195
 
198
196
  // instantiate the plugin.
@@ -208,7 +206,7 @@ module.exports = function (RED) {
208
206
  RED.events.on('runtime-event', async (event) => {
209
207
  // startup deployment.
210
208
  if ("runtime-deploy" === event?.id && startupDeployment) {
211
- console.log("STARTUP DEPLOYMENT");
209
+ //console.log("STARTUP DEPLOYMENT");
212
210
  startupDeployment = false;
213
211
  const flows = await runtime.flows.getFlows({});
214
212
  await plugin.instance.onDeploy(flows);
@@ -216,7 +214,7 @@ module.exports = function (RED) {
216
214
 
217
215
  // stopping flows on redeployment.
218
216
  if ("runtime-state" === event?.id && event?.payload?.state === "stop" && event?.payload?.deploy) {
219
- console.log("REDEPLOY!");
217
+ //console.log("REDEPLOY!");
220
218
  const flows = await runtime.flows.getFlows({});
221
219
  await plugin.instance.onDeploy(flows);
222
220
  }
@@ -265,7 +263,6 @@ class TypeUtility {
265
263
  }
266
264
  }
267
265
  class Hierarchy {
268
- types;
269
266
  constructor(types) {
270
267
  this.types = types;
271
268
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LoggerDecorator.d.ts","sourceRoot":"","sources":["../../../src/core/logger/LoggerDecorator.ts"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,CAAC,KAAK,CAAC,EAAC,MAAM,GAAE,QAAQ,CAmG7C"}
1
+ {"version":3,"file":"LoggerDecorator.d.ts","sourceRoot":"","sources":["../../../src/core/logger/LoggerDecorator.ts"],"names":[],"mappings":"AAIA,wBAAgB,MAAM,CAAC,KAAK,CAAC,EAAC,MAAM,GAAE,QAAQ,CAuG7C"}