@theotherwillembotha/node-red-plugincore 0.1.0 → 0.2.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 (134) hide show
  1. package/README.md +616 -220
  2. package/build/GenerateNodes.js +3 -6
  3. package/build/Nodes.html +3 -1504
  4. package/build/Nodes.js +5 -15
  5. package/build/Plugins.html +227 -0
  6. package/build/Plugins.js +18 -8
  7. package/build/core/NodeConstructor.d.ts +9 -16
  8. package/build/core/NodeConstructor.d.ts.map +1 -1
  9. package/build/core/NodeConstructor.js +109 -146
  10. package/build/core/NodeGenerator.d.ts.map +1 -1
  11. package/build/core/NodeGenerator.js +79 -28
  12. package/build/core/NodeManagerRuntime.d.ts +44 -0
  13. package/build/core/NodeManagerRuntime.d.ts.map +1 -0
  14. package/build/core/NodeManagerRuntime.js +140 -0
  15. package/build/core/Utils.d.ts.map +1 -1
  16. package/build/core/logger/service/LoggerService.d.ts +6 -5
  17. package/build/core/logger/service/LoggerService.d.ts.map +1 -1
  18. package/build/core/logger/service/LoggerService.js +51 -20
  19. package/build/core/logger/template/LoggerTemplate.d.ts.map +1 -1
  20. package/build/core/metrics/MetricsDecorator.d.ts +1 -2
  21. package/build/core/metrics/MetricsDecorator.d.ts.map +1 -1
  22. package/build/core/metrics/MetricsDecorator.js +89 -116
  23. package/build/core/metrics/node/CounterMetricConfigNode.d.ts.map +1 -1
  24. package/build/core/metrics/node/CounterMetricConfigNode.js +4 -5
  25. package/build/core/metrics/node/GaugeMetricConfigNode.d.ts.map +1 -1
  26. package/build/core/metrics/node/GaugeMetricConfigNode.js +5 -6
  27. package/build/core/metrics/node/MetricsConfigNode.d.ts +19 -9
  28. package/build/core/metrics/node/MetricsConfigNode.d.ts.map +1 -1
  29. package/build/core/metrics/node/MetricsConfigNode.js +14 -45
  30. package/build/core/metrics/node/TimerMetricConfigNode.d.ts.map +1 -1
  31. package/build/core/metrics/node/TimerMetricConfigNode.js +11 -17
  32. package/build/core/metrics/service/MetricsService.d.ts +110 -114
  33. package/build/core/metrics/service/MetricsService.d.ts.map +1 -1
  34. package/build/core/metrics/service/MetricsService.js +122 -339
  35. package/build/core/metrics/template/CounterMetricTemplate.d.ts.map +1 -1
  36. package/build/core/metrics/template/GaugeMetricTemplate.d.ts.map +1 -1
  37. package/build/core/metrics/template/MetricsTemplate.d.ts.map +1 -1
  38. package/build/core/metrics/template/MetricsTemplate.js +1 -2
  39. package/build/core/metrics/template/TimerMetricTemplate.d.ts.map +1 -1
  40. package/build/core/other/node/DelegatedConfigReferenceNode.d.ts +1 -1
  41. package/build/core/other/node/DelegatedConfigReferenceNode.d.ts.map +1 -1
  42. package/build/core/other/node/DelegatedConfigReferenceNode.js +1 -1
  43. package/build/core/other/service/InputService.d.ts.map +1 -1
  44. package/build/core/other/service/SettingsService.d.ts +1 -2
  45. package/build/core/other/service/SettingsService.d.ts.map +1 -1
  46. package/build/core/other/service/SettingsService.js +19 -5
  47. package/build/core/other/template/BasicTemplate.d.ts.map +1 -1
  48. package/build/core/other/template/SettingsTemplate.d.ts.map +1 -1
  49. package/build/core/state/node/InternalStateConfigNode.d.ts +16 -0
  50. package/build/core/state/node/InternalStateConfigNode.d.ts.map +1 -0
  51. package/build/core/state/node/InternalStateConfigNode.js +89 -0
  52. package/build/core/state/node/StateConfigNode.d.ts +24 -0
  53. package/build/core/state/node/StateConfigNode.d.ts.map +1 -0
  54. package/build/core/state/node/StateConfigNode.js +22 -0
  55. package/build/core/state/service/StateService.d.ts +34 -0
  56. package/build/core/state/service/StateService.d.ts.map +1 -0
  57. package/build/core/state/service/StateService.js +201 -0
  58. package/build/core/state/template/StateTemplate.d.ts +8 -0
  59. package/build/core/state/template/StateTemplate.d.ts.map +1 -0
  60. package/build/core/state/template/StateTemplate.js +11 -0
  61. package/build/core/tagging/ServiceDescriptionDecorator.d.ts +10 -0
  62. package/build/core/tagging/ServiceDescriptionDecorator.d.ts.map +1 -0
  63. package/build/core/tagging/ServiceDescriptionDecorator.js +10 -0
  64. package/build/core/tagging/service/NodeTypeService.d.ts +1 -2
  65. package/build/core/tagging/service/NodeTypeService.d.ts.map +1 -1
  66. package/build/core/tagging/service/NodeTypeService.js +19 -5
  67. package/build/core/ui/template/ScriptEditorTemplate.d.ts.map +1 -1
  68. package/build/core/ui/template/UIHelperTemplate.d.ts.map +1 -1
  69. package/build/core/webhook/node/WebhookServerConfigNode.d.ts.map +1 -1
  70. package/build/core/webhook/service/ReverseProxyTypeService.d.ts.map +1 -1
  71. package/build/core/webhook/service/WebhookServerService.d.ts +3 -4
  72. package/build/core/webhook/service/WebhookServerService.d.ts.map +1 -1
  73. package/build/core/webhook/service/WebhookServerService.js +48 -18
  74. package/build/core/webhook/template/WebhookTemplate.d.ts.map +1 -1
  75. package/build/index.d.ts +5 -2
  76. package/build/index.d.ts.map +1 -1
  77. package/build/index.js +6 -2
  78. package/build/runtime/NodeManagerRuntime.js +140 -0
  79. package/documentation/CounterMetricConfigNode.png +0 -0
  80. package/documentation/GaugeMetricConfigNode.png +0 -0
  81. package/documentation/LoggerTemplate.png +0 -0
  82. package/documentation/MetricsTemplate.png +0 -0
  83. package/documentation/StateTemplate.png +0 -0
  84. package/documentation/TimerMetricConfigNode_histogram.png +0 -0
  85. package/documentation/TimerMetricConfigNode_summary.png +0 -0
  86. package/documentation/WebhookServerConfigNode.png +0 -0
  87. package/documentation/WebhookTemplate.png +0 -0
  88. package/package.json +4 -10
  89. package/src/GenerateNodes.ts +7 -11
  90. package/src/core/NodeConstructor.ts +130 -186
  91. package/src/core/NodeGenerator.ts +88 -33
  92. package/src/core/NodeManagerRuntime.ts +179 -0
  93. package/src/core/logger/service/LoggerService.ts +39 -26
  94. package/src/core/logger/template/LoggerTemplate.html +11 -6
  95. package/src/core/metrics/MetricsDecorator.ts +140 -168
  96. package/src/core/metrics/node/CounterMetricConfigNode.ts +20 -20
  97. package/src/core/metrics/node/GaugeMetricConfigNode.ts +24 -25
  98. package/src/core/metrics/node/MetricsConfigNode.ts +29 -48
  99. package/src/core/metrics/node/TimerMetricConfigNode.ts +50 -59
  100. package/src/core/metrics/service/MetricsService.ts +214 -489
  101. package/src/core/metrics/template/CounterMetricTemplate.html +0 -1
  102. package/src/core/metrics/template/GaugeMetricTemplate.html +1 -1
  103. package/src/core/metrics/template/MetricsTemplate.html +132 -13
  104. package/src/core/metrics/template/MetricsTemplate.ts +3 -4
  105. package/src/core/other/node/DelegatedConfigReferenceNode.ts +1 -1
  106. package/src/core/other/service/SettingsService.ts +6 -10
  107. package/src/core/other/template/BasicTemplate.html +1 -1
  108. package/src/core/state/node/InternalStateConfigNode.html +77 -0
  109. package/src/core/state/node/InternalStateConfigNode.ts +102 -0
  110. package/src/core/state/node/StateConfigNode.ts +29 -0
  111. package/src/core/state/service/StateService.ts +180 -0
  112. package/src/core/state/template/StateTemplate.html +244 -0
  113. package/src/core/state/template/StateTemplate.ts +17 -0
  114. package/src/core/tagging/ServiceDescriptionDecorator.ts +23 -0
  115. package/src/core/tagging/service/NodeTypeService.ts +6 -11
  116. package/src/core/ui/template/UIHelperTemplate.html +41 -26
  117. package/src/core/webhook/service/WebhookServerService.ts +39 -23
  118. package/src/core/webhook/template/WebhookTemplate.html +28 -35
  119. package/src/index.ts +7 -2
  120. package/build/core/logger/node/ConsoleLoggerConfigNode.d.ts +0 -20
  121. package/build/core/logger/node/ConsoleLoggerConfigNode.d.ts.map +0 -1
  122. package/build/core/logger/node/ConsoleLoggerConfigNode.js +0 -62
  123. package/build/core/logger/node/RestLoggerConfigNode.d.ts +0 -40
  124. package/build/core/logger/node/RestLoggerConfigNode.d.ts.map +0 -1
  125. package/build/core/logger/node/RestLoggerConfigNode.js +0 -128
  126. package/documentation/ConsoleLoggerConfigNode.png +0 -0
  127. package/documentation/MetricsConfigNode.png +0 -0
  128. package/documentation/RestLoggerConfigNode.png +0 -0
  129. package/documentation/TimerMetricConfigNode.png +0 -0
  130. package/documentation/WebhookNode.png +0 -0
  131. package/src/core/logger/node/ConsoleLoggerConfigNode.html +0 -90
  132. package/src/core/logger/node/ConsoleLoggerConfigNode.ts +0 -71
  133. package/src/core/logger/node/RestLoggerConfigNode.html +0 -183
  134. package/src/core/logger/node/RestLoggerConfigNode.ts +0 -170
@@ -0,0 +1,16 @@
1
+ import { Node } from "node-red";
2
+ import { ConfigNodeConfig } from "../../NodeConstructor";
3
+ import { StateHandle } from "../service/StateService";
4
+ import { StateConfigNode } from "./StateConfigNode";
5
+ interface InternalStateConfigNodeConfig extends ConfigNodeConfig {
6
+ survivesRedeploy: boolean;
7
+ survivesRestart: boolean;
8
+ }
9
+ export declare class InternalStateConfigNode extends StateConfigNode {
10
+ private _survivesRedeploy;
11
+ private _survivesRestart;
12
+ constructor(node: Node, config: InternalStateConfigNodeConfig);
13
+ createHandle(): StateHandle;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=InternalStateConfigNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalStateConfigNode.d.ts","sourceRoot":"","sources":["../../../../src/core/state/node/InternalStateConfigNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAgB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,UAAU,6BAA8B,SAAQ,gBAAgB;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;CAC5B;AA4DD,qBASa,uBAAwB,SAAQ,eAAe;IACxD,OAAO,CAAC,iBAAiB,CAAU;IACnC,OAAO,CAAC,gBAAgB,CAAU;IAElC,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAS5D;IAEM,YAAY,IAAI,WAAW,CAMjC;CACJ"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InternalStateConfigNode = void 0;
13
+ const NodeDescriptionDecorator_1 = require("../../tagging/NodeDescriptionDecorator");
14
+ const NodeGenerator_1 = require("../../NodeGenerator");
15
+ const StateService_1 = require("../service/StateService");
16
+ const StateConfigNode_1 = require("./StateConfigNode");
17
+ class InternalStateHandle {
18
+ constructor(nodeId, survivesRedeploy, survivesRestart) {
19
+ this._callback = null;
20
+ this._nodeId = nodeId;
21
+ this._survivesRedeploy = survivesRedeploy;
22
+ this._survivesRestart = survivesRestart;
23
+ this._init();
24
+ }
25
+ _init() {
26
+ // On process restart, memory is empty. If this node survives restarts, load from file.
27
+ if (this._survivesRestart && StateService_1.StateService.getMemory(this._nodeId) === null) {
28
+ const fileValue = StateService_1.StateService.readFile(this._nodeId);
29
+ if (fileValue !== null) {
30
+ StateService_1.StateService.setMemory(this._nodeId, fileValue);
31
+ }
32
+ }
33
+ // Default state seeding is the consumer node's responsibility - call set() after get() returns null.
34
+ }
35
+ _read() {
36
+ return StateService_1.StateService.getMemory(this._nodeId);
37
+ }
38
+ _write(value) {
39
+ StateService_1.StateService.setMemory(this._nodeId, value);
40
+ if (this._survivesRestart) {
41
+ StateService_1.StateService.writeFile(this._nodeId, value);
42
+ }
43
+ }
44
+ get() {
45
+ return Promise.resolve(this._read());
46
+ }
47
+ set(stateName) {
48
+ this._write(stateName);
49
+ StateService_1.StateService.notifySubscribers(this._nodeId, stateName);
50
+ return Promise.resolve();
51
+ }
52
+ subscribe(callback) {
53
+ this._callback = callback;
54
+ StateService_1.StateService.addSubscriber(this._nodeId, callback);
55
+ }
56
+ unsubscribe() {
57
+ if (this._callback) {
58
+ StateService_1.StateService.removeSubscriber(this._nodeId, this._callback);
59
+ this._callback = null;
60
+ }
61
+ }
62
+ }
63
+ let InternalStateConfigNode = class InternalStateConfigNode extends StateConfigNode_1.StateConfigNode {
64
+ constructor(node, config) {
65
+ super(node, config);
66
+ this._survivesRedeploy = config.survivesRedeploy ?? false;
67
+ this._survivesRestart = config.survivesRestart ?? false;
68
+ StateService_1.StateService.registerConfig(config.id, {
69
+ survivesRedeploy: this._survivesRedeploy,
70
+ survivesRestart: this._survivesRestart,
71
+ });
72
+ }
73
+ createHandle() {
74
+ return new InternalStateHandle(this.id(), this._survivesRedeploy, this._survivesRestart);
75
+ }
76
+ };
77
+ exports.InternalStateConfigNode = InternalStateConfigNode;
78
+ exports.InternalStateConfigNode = InternalStateConfigNode = __decorate([
79
+ (0, NodeDescriptionDecorator_1.NodeDescription)({
80
+ id: "InternalStateConfigNode",
81
+ name: "Internal State Config Node",
82
+ group: "config",
83
+ sourceFile: NodeGenerator_1.SourceUtility.getSourcePath("/build/", "/src/") + "InternalStateConfigNode.html",
84
+ package: "@theotherwillembotha/node-red-plugincore",
85
+ dependencies: [StateService_1.StateService],
86
+ tags: ["StateProvider"]
87
+ }),
88
+ __metadata("design:paramtypes", [Object, Object])
89
+ ], InternalStateConfigNode);
@@ -0,0 +1,24 @@
1
+ import { Node } from "node-red";
2
+ import { ConfigNode, ConfigNodeConfig } from "../../NodeConstructor";
3
+ import { StateHandle } from "../service/StateService";
4
+ /**
5
+ * Abstract base for all state provider config nodes.
6
+ *
7
+ * Concrete implementations (e.g. InternalStateConfigNode, ZookeeperStateConfigNode) extend this
8
+ * class, decorate with @NodeDescription + tags: ["StateProvider"], and implement createHandle()
9
+ * to return their backend-specific StateHandle.
10
+ *
11
+ * This class is intentionally NOT decorated with @NodeDescription - it is never registered as a
12
+ * Node-RED node type directly. Only concrete subclasses are registered.
13
+ */
14
+ export declare abstract class StateConfigNode extends ConfigNode<ConfigNodeConfig> {
15
+ constructor(node: Node, config: ConfigNodeConfig);
16
+ /**
17
+ * Creates a new StateHandle for a consumer node.
18
+ * Called once per consumer that references this config node.
19
+ * Each handle maintains its own subscriber slot, so multiple consumers
20
+ * can independently subscribe and unsubscribe without interfering.
21
+ */
22
+ abstract createHandle(): StateHandle;
23
+ }
24
+ //# sourceMappingURL=StateConfigNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateConfigNode.d.ts","sourceRoot":"","sources":["../../../../src/core/state/node/StateConfigNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAgB,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;;GASG;AACH,8BAAsB,eAAgB,SAAQ,UAAU,CAAC,gBAAgB,CAAC;IAEtE,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAG/C;IAED;;;;;OAKG;IACH,SAAgB,YAAY,IAAI,WAAW,CAAC;CAC/C"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StateConfigNode = void 0;
4
+ const NodeConstructor_1 = require("../../NodeConstructor");
5
+ const StateService_1 = require("../service/StateService");
6
+ /**
7
+ * Abstract base for all state provider config nodes.
8
+ *
9
+ * Concrete implementations (e.g. InternalStateConfigNode, ZookeeperStateConfigNode) extend this
10
+ * class, decorate with @NodeDescription + tags: ["StateProvider"], and implement createHandle()
11
+ * to return their backend-specific StateHandle.
12
+ *
13
+ * This class is intentionally NOT decorated with @NodeDescription - it is never registered as a
14
+ * Node-RED node type directly. Only concrete subclasses are registered.
15
+ */
16
+ class StateConfigNode extends NodeConstructor_1.ConfigNode {
17
+ constructor(node, config) {
18
+ super(node, config);
19
+ StateService_1.StateService.registerFactory(config.id, () => this.createHandle());
20
+ }
21
+ }
22
+ exports.StateConfigNode = StateConfigNode;
@@ -0,0 +1,34 @@
1
+ import { BaseService, FlowDeployment } from "../../NodeConstructor";
2
+ import { NodeAPI, NodeAPISettingsWithData } from "node-red";
3
+ export interface StateHandle {
4
+ get(): Promise<string | null>;
5
+ set(stateName: string): Promise<void>;
6
+ subscribe(callback: (stateName: string) => void): void;
7
+ unsubscribe(): void;
8
+ }
9
+ export declare class DoNothingStateHandle implements StateHandle {
10
+ get(): Promise<string | null>;
11
+ set(_stateName: string): Promise<void>;
12
+ subscribe(_callback: (stateName: string) => void): void;
13
+ unsubscribe(): void;
14
+ }
15
+ export declare class StateService extends BaseService {
16
+ constructor();
17
+ init(red: NodeAPI<NodeAPISettingsWithData>): void;
18
+ deinit(_red: NodeAPI<NodeAPISettingsWithData>): void;
19
+ onDeploy(deployment: FlowDeployment): Promise<void>;
20
+ static registerFactory(nodeId: string, factory: () => StateHandle): void;
21
+ static registerConfig(nodeId: string, config: {
22
+ survivesRedeploy: boolean;
23
+ survivesRestart: boolean;
24
+ }): void;
25
+ static createHandle(stateReference: string): StateHandle;
26
+ static getMemory(nodeId: string): string | null;
27
+ static setMemory(nodeId: string, value: string): void;
28
+ static readFile(nodeId: string): string | null;
29
+ static writeFile(nodeId: string, value: string): void;
30
+ static addSubscriber(nodeId: string, callback: (s: string) => void): void;
31
+ static removeSubscriber(nodeId: string, callback: (s: string) => void): void;
32
+ static notifySubscribers(nodeId: string, value: string): void;
33
+ }
34
+ //# sourceMappingURL=StateService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateService.d.ts","sourceRoot":"","sources":["../../../../src/core/state/service/StateService.ts"],"names":[],"mappings":"A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AAc,EAAE,MAAM,GAAG,WAAW,CAI9D;IAID,OAAc,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErD;IAED,OAAc,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAE3D;IAID,OAAc,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUpD;IAED,OAAc,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM3D;IAID,OAAc,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAI/E;IAED,OAAc,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAElF;IAED,OAAc,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAInE;CACJ"}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __metadata = (this && this.__metadata) || function (k, v) {
42
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.StateService = exports.DoNothingStateHandle = void 0;
46
+ const NodeConstructor_1 = require("../../NodeConstructor");
47
+ const ServiceDescriptionDecorator_1 = require("../../tagging/ServiceDescriptionDecorator");
48
+ const fs = __importStar(require("fs"));
49
+ const path = __importStar(require("path"));
50
+ class DoNothingStateHandle {
51
+ get() { return Promise.resolve(null); }
52
+ set(_stateName) { return Promise.resolve(); }
53
+ subscribe(_callback) { }
54
+ unsubscribe() { }
55
+ }
56
+ exports.DoNothingStateHandle = DoNothingStateHandle;
57
+ // (StateReference removed - stateEnabled is no longer optional; consumers pass the ID directly)
58
+ // ******************************************************* //
59
+ // Global Store Keys //
60
+ // ******************************************************* //
61
+ const _GLOBAL_STATE_MEMORY_KEY = '__plugincore_internalstate_memory__';
62
+ const _GLOBAL_STATE_SUBS_KEY = '__plugincore_internalstate_subscribers__';
63
+ const _GLOBAL_STATE_FACTORIES_KEY = '__plugincore_state_factories__';
64
+ const _GLOBAL_STATE_CONFIG_KEY = '__plugincore_state_config__';
65
+ const _GLOBAL_STATE_USERDIR_KEY = '__plugincore_state_userDir__';
66
+ function getMemoryStore() {
67
+ if (!global[_GLOBAL_STATE_MEMORY_KEY])
68
+ global[_GLOBAL_STATE_MEMORY_KEY] = new Map();
69
+ return global[_GLOBAL_STATE_MEMORY_KEY];
70
+ }
71
+ function getSubscriberStore() {
72
+ if (!global[_GLOBAL_STATE_SUBS_KEY])
73
+ global[_GLOBAL_STATE_SUBS_KEY] = new Map();
74
+ return global[_GLOBAL_STATE_SUBS_KEY];
75
+ }
76
+ function getFactoryStore() {
77
+ if (!global[_GLOBAL_STATE_FACTORIES_KEY])
78
+ global[_GLOBAL_STATE_FACTORIES_KEY] = new Map();
79
+ return global[_GLOBAL_STATE_FACTORIES_KEY];
80
+ }
81
+ function getConfigStore() {
82
+ if (!global[_GLOBAL_STATE_CONFIG_KEY])
83
+ global[_GLOBAL_STATE_CONFIG_KEY] = new Map();
84
+ return global[_GLOBAL_STATE_CONFIG_KEY];
85
+ }
86
+ function getUserDir() {
87
+ return global[_GLOBAL_STATE_USERDIR_KEY];
88
+ }
89
+ function stateFilePath(nodeId) {
90
+ const userDir = getUserDir();
91
+ if (!userDir)
92
+ return null;
93
+ return path.join(userDir, 'internalstate', nodeId + '.json');
94
+ }
95
+ // ******************************************************* //
96
+ // StateService //
97
+ // ******************************************************* //
98
+ let StateService = class StateService extends NodeConstructor_1.BaseService {
99
+ constructor() {
100
+ super("StateService");
101
+ }
102
+ init(red) {
103
+ global[_GLOBAL_STATE_USERDIR_KEY] = red.settings.userDir;
104
+ }
105
+ deinit(_red) { }
106
+ async onDeploy(deployment) {
107
+ const flowIds = new Set(deployment.flows.map(e => e.id));
108
+ const factories = getFactoryStore();
109
+ const configs = getConfigStore();
110
+ const memory = getMemoryStore();
111
+ // Remove factories for config nodes no longer in the flow.
112
+ factories.forEach((_, nodeId) => {
113
+ if (!flowIds.has(nodeId))
114
+ factories.delete(nodeId);
115
+ });
116
+ // Clear memory for state config nodes that are gone or do not survive redeploy.
117
+ configs.forEach((cfg, nodeId) => {
118
+ if (!flowIds.has(nodeId)) {
119
+ memory.delete(nodeId);
120
+ configs.delete(nodeId);
121
+ }
122
+ else if (!cfg.survivesRedeploy && !cfg.survivesRestart) {
123
+ memory.delete(nodeId);
124
+ }
125
+ });
126
+ return Promise.resolve();
127
+ }
128
+ // ---- Factory registration (called by StateConfigNode subclasses) ----
129
+ static registerFactory(nodeId, factory) {
130
+ getFactoryStore().set(nodeId, factory);
131
+ }
132
+ static registerConfig(nodeId, config) {
133
+ getConfigStore().set(nodeId, config);
134
+ }
135
+ // ---- Handle creation (called by consumer nodes) ----
136
+ static createHandle(stateReference) {
137
+ if (!stateReference)
138
+ return new DoNothingStateHandle();
139
+ const factory = getFactoryStore().get(stateReference);
140
+ return factory ? factory() : new DoNothingStateHandle();
141
+ }
142
+ // ---- Memory store (used by InternalStateHandle) ----
143
+ static getMemory(nodeId) {
144
+ return getMemoryStore().get(nodeId) ?? null;
145
+ }
146
+ static setMemory(nodeId, value) {
147
+ getMemoryStore().set(nodeId, value);
148
+ }
149
+ // ---- File store (used by InternalStateHandle) ----
150
+ static readFile(nodeId) {
151
+ const filePath = stateFilePath(nodeId);
152
+ if (!filePath)
153
+ return null;
154
+ try {
155
+ if (!fs.existsSync(filePath))
156
+ return null;
157
+ const content = fs.readFileSync(filePath, 'utf8');
158
+ return JSON.parse(content).value ?? null;
159
+ }
160
+ catch {
161
+ return null;
162
+ }
163
+ }
164
+ static writeFile(nodeId, value) {
165
+ const filePath = stateFilePath(nodeId);
166
+ if (!filePath)
167
+ return;
168
+ const dir = path.dirname(filePath);
169
+ if (!fs.existsSync(dir))
170
+ fs.mkdirSync(dir, { recursive: true });
171
+ fs.writeFileSync(filePath, JSON.stringify({ value }), 'utf8');
172
+ }
173
+ // ---- Subscriber management (used by InternalStateHandle) ----
174
+ static addSubscriber(nodeId, callback) {
175
+ const store = getSubscriberStore();
176
+ if (!store.has(nodeId))
177
+ store.set(nodeId, new Set());
178
+ store.get(nodeId).add(callback);
179
+ }
180
+ static removeSubscriber(nodeId, callback) {
181
+ getSubscriberStore().get(nodeId)?.delete(callback);
182
+ }
183
+ static notifySubscribers(nodeId, value) {
184
+ getSubscriberStore().get(nodeId)?.forEach(cb => {
185
+ try {
186
+ cb(value);
187
+ }
188
+ catch { }
189
+ });
190
+ }
191
+ };
192
+ exports.StateService = StateService;
193
+ exports.StateService = StateService = __decorate([
194
+ (0, ServiceDescriptionDecorator_1.ServiceDescription)({
195
+ id: "@theotherwillembotha/stateservice",
196
+ name: "StateService",
197
+ type: "integration-plugin",
198
+ sourceFile: "@theotherwillembotha/node-red-plugincore",
199
+ }),
200
+ __metadata("design:paramtypes", [])
201
+ ], StateService);
@@ -0,0 +1,8 @@
1
+ import { BaseNodeConfig, Template, TemplateDescriptor } from "../../NodeConstructor";
2
+ export interface StateTemplateConfig extends BaseNodeConfig {
3
+ stateReference: string;
4
+ }
5
+ export declare class StateTemplate extends Template {
6
+ static getTemplateDescriptor(): TemplateDescriptor;
7
+ }
8
+ //# sourceMappingURL=StateTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateTemplate.d.ts","sourceRoot":"","sources":["../../../../src/core/state/template/StateTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,aAAc,SAAQ,QAAQ;IAEvC,OAAc,qBAAqB,IAAI,kBAAkB,CAMxD;CACJ"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StateTemplate = void 0;
4
+ const NodeGenerator_1 = require("../../NodeGenerator");
5
+ const NodeConstructor_1 = require("../../NodeConstructor");
6
+ class StateTemplate extends NodeConstructor_1.Template {
7
+ static getTemplateDescriptor() {
8
+ return new NodeConstructor_1.TemplateDescriptor("state", StateTemplate, NodeGenerator_1.SourceUtility.getSourcePath("/build/", "/src/") + "StateTemplate.html", []);
9
+ }
10
+ }
11
+ exports.StateTemplate = StateTemplate;
@@ -0,0 +1,10 @@
1
+ import { DependencyType } from "../NodeConstructor";
2
+ export type ServiceDescriptionConfig = {
3
+ id: string;
4
+ sourceFile: string;
5
+ type?: string;
6
+ name?: string;
7
+ dependencies?: DependencyType[];
8
+ };
9
+ export declare function ServiceDescription(config: ServiceDescriptionConfig): (target: any) => void;
10
+ //# sourceMappingURL=ServiceDescriptionDecorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServiceDescriptionDecorator.d.ts","sourceRoot":"","sources":["../../../src/core/tagging/ServiceDescriptionDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;CACnC,CAAA;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,YACvC,GAAG,UAW9B"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceDescription = ServiceDescription;
4
+ const NodeConstructor_1 = require("../NodeConstructor");
5
+ function ServiceDescription(config) {
6
+ return function (target) {
7
+ const descriptor = new NodeConstructor_1.ServiceDescriptor(config.id, config.name ?? target.name, config.type ?? "services-plugin", config.sourceFile, target, config.dependencies);
8
+ target.getServiceDescriptor = () => descriptor;
9
+ };
10
+ }
@@ -1,5 +1,5 @@
1
1
  import { INodeClass } from "../../NodeGenerator";
2
- import { BaseService, FlowDeployment, ServiceDescriptor } from "../../NodeConstructor";
2
+ import { BaseService, FlowDeployment } from "../../NodeConstructor";
3
3
  import { NodeAPI, NodeAPISettingsWithData } from "node-red";
4
4
  export declare class NodeTypeService extends BaseService {
5
5
  private red;
@@ -10,6 +10,5 @@ export declare class NodeTypeService extends BaseService {
10
10
  onDeploy(flowDeployment: FlowDeployment): void | Promise<void>;
11
11
  registerNodeType(tag: string, resource: INodeClass): Promise<void>;
12
12
  getNodeTypesForTag(tag: string): INodeClass[];
13
- static getServiceDescriptor(): ServiceDescriptor;
14
13
  }
15
14
  //# sourceMappingURL=NodeTypeService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTypeService.d.ts","sourceRoot":"","sources":["../../../../src/core/tagging/service/NodeTypeService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAc,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG5D,qBAAa,eAAgB,SAAQ,WAAW;IAC5C,OAAO,CAAC,GAAG,CAAoC;IAC/C,OAAO,CAAC,SAAS,CAAkC;;IAM5C,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBjE,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,gBAAgB,CAAC,GAAG,EAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IASjE,kBAAkB,CAAC,GAAG,EAAC,MAAM,GAAE,UAAU,EAAE;WAIlC,oBAAoB,IAAG,iBAAiB;CAU3D"}
1
+ {"version":3,"file":"NodeTypeService.d.ts","sourceRoot":"","sources":["../../../../src/core/tagging/service/NodeTypeService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAc,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG5D,qBAIa,eAAgB,SAAQ,WAAW;IAC5C,OAAO,CAAC,GAAG,CAAoC;IAC/C,OAAO,CAAC,SAAS,CAAkC;IAEnD,cAEC;IAEM,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBvE;IAEM,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAEM,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;IAEM,gBAAgB,CAAC,GAAG,EAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE;IAEM,kBAAkB,CAAC,GAAG,EAAC,MAAM,GAAE,UAAU,EAAE,CAEjD;CAEJ"}
@@ -1,8 +1,18 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.NodeTypeService = void 0;
4
13
  const NodeConstructor_1 = require("../../NodeConstructor");
5
- class NodeTypeService extends NodeConstructor_1.BaseService {
14
+ const ServiceDescriptionDecorator_1 = require("../ServiceDescriptionDecorator");
15
+ let NodeTypeService = class NodeTypeService extends NodeConstructor_1.BaseService {
6
16
  constructor() {
7
17
  super("nodetypes");
8
18
  this.nodeTypes = {};
@@ -40,8 +50,12 @@ class NodeTypeService extends NodeConstructor_1.BaseService {
40
50
  getNodeTypesForTag(tag) {
41
51
  return this.nodeTypes[tag] ? this.nodeTypes[tag] : [];
42
52
  }
43
- static getServiceDescriptor() {
44
- return new NodeConstructor_1.ServiceDescriptor("@theotherwillembotha/nodetypeservice", "NodeTypeService", "services-plugin", "@theotherwillembotha/node-red-plugincore", NodeTypeService, []);
45
- }
46
- }
53
+ };
47
54
  exports.NodeTypeService = NodeTypeService;
55
+ exports.NodeTypeService = NodeTypeService = __decorate([
56
+ (0, ServiceDescriptionDecorator_1.ServiceDescription)({
57
+ id: "@theotherwillembotha/nodetypeservice",
58
+ sourceFile: "@theotherwillembotha/node-red-plugincore"
59
+ }),
60
+ __metadata("design:paramtypes", [])
61
+ ], NodeTypeService);
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptEditorTemplate.d.ts","sourceRoot":"","sources":["../../../../src/core/ui/template/ScriptEditorTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGpE,qBAAa,oBAAqB,SAAQ,QAAQ;WAEhC,qBAAqB,IAAI,kBAAkB;CAQ5D"}
1
+ {"version":3,"file":"ScriptEditorTemplate.d.ts","sourceRoot":"","sources":["../../../../src/core/ui/template/ScriptEditorTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGpE,qBAAa,oBAAqB,SAAQ,QAAQ;IAE9C,OAAc,qBAAqB,IAAI,kBAAkB,CAOxD;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"UIHelperTemplate.d.ts","sourceRoot":"","sources":["../../../../src/core/ui/template/UIHelperTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGpE,qBAAa,gBAAiB,SAAQ,QAAQ;WAE5B,qBAAqB,IAAI,kBAAkB;CAQ5D"}
1
+ {"version":3,"file":"UIHelperTemplate.d.ts","sourceRoot":"","sources":["../../../../src/core/ui/template/UIHelperTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGpE,qBAAa,gBAAiB,SAAQ,QAAQ;IAE1C,OAAc,qBAAqB,IAAI,kBAAkB,CAOxD;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookServerConfigNode.d.ts","sourceRoot":"","sources":["../../../../src/core/webhook/node/WebhookServerConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAwB,MAAM,iCAAiC,CAAC;AAGtF,UAAU,6BAA8B,SAAQ,gBAAgB;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAC,MAAM,CAAC;IACpB,YAAY,EAAC,MAAM,CAAC;CACvB;AAED,qBASa,uBAAwB,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IAClF,OAAO,CAAC,OAAO,CAAgB;gBAEnB,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B;IAQtD,MAAM,IAAG,aAAa;CAGhC"}
1
+ {"version":3,"file":"WebhookServerConfigNode.d.ts","sourceRoot":"","sources":["../../../../src/core/webhook/node/WebhookServerConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAwB,MAAM,iCAAiC,CAAC;AAGtF,UAAU,6BAA8B,SAAQ,gBAAgB;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAC,MAAM,CAAC;IACpB,YAAY,EAAC,MAAM,CAAC;CACvB;AAED,qBASa,uBAAwB,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IAClF,OAAO,CAAC,OAAO,CAAgB;IAE/B,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAM5D;IAEM,MAAM,IAAG,aAAa,CAE5B;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReverseProxyTypeService.d.ts","sourceRoot":"","sources":["../../../../src/core/webhook/service/ReverseProxyTypeService.ts"],"names":[],"mappings":"AAGA,8BAAsB,gBAAgB;IAElC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,KAAK,CAAS;gBAEV,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM;IAK3B,EAAE,IAAG,MAAM;IAGX,IAAI,IAAG,MAAM;CAGvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,QAAQ,IAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,EAAE,EAAC,MAAM,CAAC;IACV,WAAW,EAAC,MAAM,EAAE,CAAC;IACrB,MAAM,EAAC,UAAU,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,EAAC,MAAM,CAAC;IACnB,UAAU,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,OAAO,CAAC;IACpB,mBAAmB,EAAC,OAAO,CAAC;IAC5B,gBAAgB,EAAC,OAAO,CAAC;CAC5B,CAAA;AAED,oBAAY,UAAU;IAClB,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
1
+ {"version":3,"file":"ReverseProxyTypeService.d.ts","sourceRoot":"","sources":["../../../../src/core/webhook/service/ReverseProxyTypeService.ts"],"names":[],"mappings":"AAGA,8BAAsB,gBAAgB;IAElC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,KAAK,CAAS;IAEtB,YAAY,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,EAGjC;IAEM,EAAE,IAAG,MAAM,CAEjB;IACM,IAAI,IAAG,MAAM,CAEnB;CACJ;AAED,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,QAAQ,IAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,EAAE,EAAC,MAAM,CAAC;IACV,WAAW,EAAC,MAAM,EAAE,CAAC;IACrB,MAAM,EAAC,UAAU,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,EAAC,MAAM,CAAC;IACnB,UAAU,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,OAAO,CAAC;IACpB,mBAAmB,EAAC,OAAO,CAAC;IAC5B,gBAAgB,EAAC,OAAO,CAAC;CAC5B,CAAA;AAED,oBAAY,UAAU;IAClB,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
@@ -1,6 +1,6 @@
1
- import { BaseService, FlowDeployment, ServiceDescriptor } from "../../NodeConstructor";
1
+ import { BaseService, FlowDeployment } from "../../NodeConstructor";
2
2
  import { NodeAPI, NodeAPISettingsWithData } from "node-red";
3
- import { Request, Response } from "express";
3
+ import type { Request, Response } from "express";
4
4
  import { ApiKeyMechanismType, RestAuthType } from "../../logger/service/LoggerService";
5
5
  export declare enum EndpointMethodType {
6
6
  GET = "GET",
@@ -32,6 +32,7 @@ export declare class WebhookServer {
32
32
  constructor(config: WebhookServerConfig);
33
33
  attach(endpoint: EndpointConfig, callback: (request: Request, response: Response) => any): void;
34
34
  detach(configuration: EndpointConfig): void;
35
+ close(): void;
35
36
  config(): WebhookServerConfig;
36
37
  }
37
38
  export type WebhookServerConfig = {
@@ -41,12 +42,10 @@ export type WebhookServerConfig = {
41
42
  externalPort: number;
42
43
  };
43
44
  export declare class WebhookServerService extends BaseService {
44
- private static webhookServers;
45
45
  constructor();
46
46
  init(red: NodeAPI<NodeAPISettingsWithData>): void | Promise<void>;
47
47
  deinit(red: NodeAPI<NodeAPISettingsWithData>): void | Promise<void>;
48
48
  onDeploy(flowDeployment: FlowDeployment): void | Promise<void>;
49
49
  static get(config: WebhookServerConfig): WebhookServer;
50
- static getServiceDescriptor(): ServiceDescriptor;
51
50
  }
52
51
  //# sourceMappingURL=WebhookServerService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookServerService.d.ts","sourceRoot":"","sources":["../../../../src/core/webhook/service/WebhookServerService.ts"],"names":[],"mappings":"AACA,OAAO,EAA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