@theotherwillembotha/node-red-loki 0.1.0 → 0.3.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.
- package/README.md +1 -10
- package/build/GenerateNodes.d.ts +2 -0
- package/build/GenerateNodes.d.ts.map +1 -0
- package/build/GenerateNodes.js +2 -1
- package/build/Nodes.html +347 -515
- package/build/Nodes.js +61481 -12
- package/build/Plugins.html +37 -0
- package/build/Plugins.js +61405 -54
- package/build/index.d.ts +5 -0
- package/build/index.d.ts.map +1 -0
- package/build/loki/node/LokiLoggerConfigNode.d.ts +25 -0
- package/build/loki/node/LokiLoggerConfigNode.d.ts.map +1 -0
- package/build/loki/node/LokiQueryNode.d.ts +21 -0
- package/build/loki/node/LokiQueryNode.d.ts.map +1 -0
- package/build/loki/node/LokiServiceConfigNode.d.ts +17 -0
- package/build/loki/node/LokiServiceConfigNode.d.ts.map +1 -0
- package/build/loki/service/LokiService.d.ts +10 -0
- package/build/loki/service/LokiService.d.ts.map +1 -0
- package/build/loki/service/LokiService.js +19 -5
- package/build/runtime/NodeManagerRuntime.js +140 -0
- package/icons/loki.png +0 -0
- package/package.json +8 -4
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Node } from "node-red";
|
|
2
|
+
import { AbstractLogger, Log, BaseLoggerConfig, LoggerTemplateConfig, LoggerConfigNode, LoggerConfigNodeConfig, Level } from "@theotherwillembotha/node-red-plugincore";
|
|
3
|
+
interface LokiLoggerConfigNodeConfig extends LoggerConfigNodeConfig {
|
|
4
|
+
level: Level;
|
|
5
|
+
template: string;
|
|
6
|
+
lokiservice: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class LokiLoggerConfigNode extends LoggerConfigNode<LokiLoggerConfigNodeConfig, LokiLogger> {
|
|
9
|
+
private _logger;
|
|
10
|
+
constructor(node: Node, config: LokiLoggerConfigNodeConfig);
|
|
11
|
+
protected logger(): LokiLogger;
|
|
12
|
+
}
|
|
13
|
+
export interface LokiLoggerConfig extends BaseLoggerConfig {
|
|
14
|
+
host: string;
|
|
15
|
+
basicAuth?: string;
|
|
16
|
+
tenantid?: string;
|
|
17
|
+
}
|
|
18
|
+
declare class LokiLogger extends AbstractLogger<LokiLoggerConfig> {
|
|
19
|
+
private winston;
|
|
20
|
+
private winstonLevel;
|
|
21
|
+
constructor(config: LokiLoggerConfig);
|
|
22
|
+
protected createLogger(config: LoggerTemplateConfig): Log;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=LokiLoggerConfigNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LokiLoggerConfigNode.d.ts","sourceRoot":"","sources":["../../../src/loki/node/LokiLoggerConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,gBAAgB,EAAiB,oBAAoB,EAAmB,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,EAAe,MAAM,0CAA0C,CAAA;AAMpN,UAAU,0BAA2B,SAAQ,sBAAsB;IAC/D,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qBASa,oBAAqB,SAAQ,gBAAgB,CAAC,0BAA0B,EAAE,UAAU,CAAC;IAE9F,OAAO,CAAC,OAAO,CAAc;IAE7B,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,0BAA0B,EAgBzD;IAED,SAAS,CAAC,MAAM,IAAI,UAAU,CAE7B;CACJ;AAGD,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,cAAM,UAAW,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAErD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAS;IAE7B,YAAY,MAAM,EAAE,gBAAgB,EA0BnC;IAED,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,GAAG,CAExD;CACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Node } from "node-red";
|
|
2
|
+
import { BaseNode, BaseNodeConfig } from "@theotherwillembotha/node-red-plugincore";
|
|
3
|
+
import { LoggerTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
|
|
4
|
+
interface LokiQueryNodeConfig extends BaseNodeConfig, LoggerTemplateConfig {
|
|
5
|
+
lokiservice: string;
|
|
6
|
+
query: string;
|
|
7
|
+
start: string;
|
|
8
|
+
start_type: string;
|
|
9
|
+
end: string;
|
|
10
|
+
end_type: string;
|
|
11
|
+
outputpath: string;
|
|
12
|
+
batchMode: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class LokiQueryNode extends BaseNode<LokiQueryNodeConfig> {
|
|
15
|
+
private log;
|
|
16
|
+
private _serviceNode;
|
|
17
|
+
constructor(node: Node, config: LokiQueryNodeConfig);
|
|
18
|
+
protected onInput(message: any, _errorHandler: Function): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=LokiQueryNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LokiQueryNode.d.ts","sourceRoot":"","sources":["../../../src/loki/node/LokiQueryNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAwD,MAAM,0CAA0C,CAAC;AAC1I,OAAO,EAA+B,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AA6B7G,UAAU,mBAAoB,SAAQ,cAAc,EAAE,oBAAoB;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,qBAYa,aAAc,SAAQ,QAAQ,CAAC,mBAAmB,CAAC;IAG5D,OAAO,CAAC,GAAG,CAAO;IAElB,OAAO,CAAC,YAAY,CAAyB;IAE7C,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAGlD;IAED,UACgB,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,iBAwD5D;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Node } from "node-red";
|
|
2
|
+
import { ConfigNode, ConfigNodeConfig } from "@theotherwillembotha/node-red-plugincore";
|
|
3
|
+
interface LokiServiceConfigNodeConfig extends ConfigNodeConfig {
|
|
4
|
+
url: string;
|
|
5
|
+
userid?: string;
|
|
6
|
+
authtoken?: string;
|
|
7
|
+
tenantid?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class LokiServiceConfigNode extends ConfigNode<LokiServiceConfigNodeConfig> {
|
|
10
|
+
constructor(node: Node, config: LokiServiceConfigNodeConfig);
|
|
11
|
+
url(): string;
|
|
12
|
+
basicAuth(): string | undefined;
|
|
13
|
+
tenantId(): string | undefined;
|
|
14
|
+
headers(): Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=LokiServiceConfigNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LokiServiceConfigNode.d.ts","sourceRoot":"","sources":["../../../src/loki/node/LokiServiceConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAkC,MAAM,0CAA0C,CAAC;AAExH,UAAU,2BAA4B,SAAQ,gBAAgB;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAQa,qBAAsB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IAE9E,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,2BAA2B,EAE1D;IAEM,GAAG,IAAI,MAAM,CAEnB;IAEM,SAAS,IAAI,MAAM,GAAG,SAAS,CAGrC;IAEM,QAAQ,IAAI,MAAM,GAAG,SAAS,CAEpC;IAEM,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWvC;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeAPI, NodeAPISettingsWithData } from "node-red";
|
|
2
|
+
import { BaseService, FlowDeployment } from "@theotherwillembotha/node-red-plugincore";
|
|
3
|
+
export declare class LokiService extends BaseService {
|
|
4
|
+
private red;
|
|
5
|
+
constructor();
|
|
6
|
+
init(red: NodeAPI<NodeAPISettingsWithData>): void;
|
|
7
|
+
deinit(_red: NodeAPI<NodeAPISettingsWithData>): void;
|
|
8
|
+
onDeploy(_flowDeployment: FlowDeployment): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=LokiService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LokiService.d.ts","sourceRoot":"","sources":["../../../src/loki/service/LokiService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAGvF,qBAIa,WAAY,SAAQ,WAAW;IAExC,OAAO,CAAC,GAAG,CAAoC;IAE/C,cAEC;IAEM,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAwBvD;IAEM,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAG;IAEjD,QAAQ,CAAC,eAAe,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAG;CAE3E"}
|
|
@@ -1,4 +1,13 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
@@ -6,7 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
15
|
exports.LokiService = void 0;
|
|
7
16
|
const axios_1 = __importDefault(require("axios"));
|
|
8
17
|
const node_red_plugincore_1 = require("@theotherwillembotha/node-red-plugincore");
|
|
9
|
-
|
|
18
|
+
const node_red_plugincore_2 = require("@theotherwillembotha/node-red-plugincore");
|
|
19
|
+
let LokiService = class LokiService extends node_red_plugincore_1.BaseService {
|
|
10
20
|
constructor() {
|
|
11
21
|
super("LokiService");
|
|
12
22
|
}
|
|
@@ -36,8 +46,12 @@ class LokiService extends node_red_plugincore_1.BaseService {
|
|
|
36
46
|
}
|
|
37
47
|
deinit(_red) { }
|
|
38
48
|
async onDeploy(_flowDeployment) { }
|
|
39
|
-
|
|
40
|
-
return new node_red_plugincore_1.ServiceDescriptor("@theotherwillembotha/lokiservice", "LokiService", "services-plugin", "@theotherwillembotha/node-red-loki", LokiService, []);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
49
|
+
};
|
|
43
50
|
exports.LokiService = LokiService;
|
|
51
|
+
exports.LokiService = LokiService = __decorate([
|
|
52
|
+
(0, node_red_plugincore_2.ServiceDescription)({
|
|
53
|
+
id: "@theotherwillembotha/lokiservice",
|
|
54
|
+
sourceFile: "@theotherwillembotha/node-red-loki",
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:paramtypes", [])
|
|
57
|
+
], LokiService);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* NodeManagerRuntime.ts
|
|
4
|
+
*
|
|
5
|
+
* STANDALONE - zero imports from the rest of plugincore.
|
|
6
|
+
*
|
|
7
|
+
* This file is compiled and copied into every plugin's build output so that
|
|
8
|
+
* plugins are self-contained and do not require plugincore to be separately
|
|
9
|
+
* installed in the user's Node-RED environment.
|
|
10
|
+
*
|
|
11
|
+
* When multiple plugins are deployed, each ships its own copy of this file.
|
|
12
|
+
* The first plugin to load registers its NodeManager and nodes; subsequent
|
|
13
|
+
* copies operate independently on their own node types with no conflict.
|
|
14
|
+
*
|
|
15
|
+
* POST_CONSTRUCT_KEY is intentionally a plain string (not a Symbol) so that
|
|
16
|
+
* the decorators (from plugincore's NodeConstructor, loaded via the plugin's
|
|
17
|
+
* dependency on plugincore) and this runtime file (a separate module instance)
|
|
18
|
+
* resolve to the same property key on node instances.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.NodeManager = exports.POST_CONSTRUCT_KEY = exports.NODEMANAGER_API_VERSION = void 0;
|
|
22
|
+
exports.runPostConstructInitializers = runPostConstructInitializers;
|
|
23
|
+
// ─── API version ────────────────────────────────────────────────────────────
|
|
24
|
+
// Semver of the NodeManager API contract - independent of plugincore's package
|
|
25
|
+
// version. Bump when the contract changes; plugins can read this to warn users
|
|
26
|
+
// that they were built against a different NodeManager version.
|
|
27
|
+
exports.NODEMANAGER_API_VERSION = "1.0.0";
|
|
28
|
+
// ─── Shared key for post-construct initializer lists ────────────────────────
|
|
29
|
+
// Must be a plain string so it resolves identically across module instances.
|
|
30
|
+
exports.POST_CONSTRUCT_KEY = '__plugincore_postConstructInitializers__';
|
|
31
|
+
// ─── Post-construct initializer runner ───────────────────────────────────────
|
|
32
|
+
function runPostConstructInitializers(instance) {
|
|
33
|
+
const initializers = instance[exports.POST_CONSTRUCT_KEY];
|
|
34
|
+
if (!initializers || initializers.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const className = instance.constructor.name;
|
|
37
|
+
initializers.forEach((init, index) => {
|
|
38
|
+
try {
|
|
39
|
+
init(instance);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error(`Post-construct initialization failed:\n` +
|
|
43
|
+
` Class: ${className}\n` +
|
|
44
|
+
` Initializer: ${index + 1}/${initializers.length}\n` +
|
|
45
|
+
` Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
delete instance[exports.POST_CONSTRUCT_KEY];
|
|
50
|
+
}
|
|
51
|
+
// ─── NodeManager ─────────────────────────────────────────────────────────────
|
|
52
|
+
// RED is stored on `global` rather than as a static class field so that all
|
|
53
|
+
// module instances of NodeManagerRuntime (the local copy bundled into Nodes.js
|
|
54
|
+
// and the copy bundled via plugincore's NodeConstructor) share the same value.
|
|
55
|
+
// Without this, esbuild's two separate inline copies would have independent
|
|
56
|
+
// static fields and the one used by decorators would never see RED being set.
|
|
57
|
+
const _GLOBAL_RED_KEY = '__plugincore_NodeManager_RED__';
|
|
58
|
+
// ─── Global node-type registration guard ─────────────────────────────────────
|
|
59
|
+
// When multiple self-contained plugins are installed they each bundle plugincore
|
|
60
|
+
// inline and each try to call RED.nodes.registerType for the same shared
|
|
61
|
+
// infrastructure node types (ConsoleLoggerConfigNode, RestLoggerConfigNode, etc.).
|
|
62
|
+
// Node-RED rejects duplicate registrations with a warning and the second
|
|
63
|
+
// plugin's Nodes.js fails to load. This global set tracks which types have
|
|
64
|
+
// already been registered so subsequent plugins silently skip them.
|
|
65
|
+
const _GLOBAL_REGISTERED_NODES_KEY = '__plugincore_registered_nodes__';
|
|
66
|
+
function getRegisteredNodes() {
|
|
67
|
+
if (!global[_GLOBAL_REGISTERED_NODES_KEY]) {
|
|
68
|
+
global[_GLOBAL_REGISTERED_NODES_KEY] = new Set();
|
|
69
|
+
}
|
|
70
|
+
return global[_GLOBAL_REGISTERED_NODES_KEY];
|
|
71
|
+
}
|
|
72
|
+
class NodeManager {
|
|
73
|
+
constructor(RED) {
|
|
74
|
+
this.typeBacklog = [];
|
|
75
|
+
global[_GLOBAL_RED_KEY] = RED;
|
|
76
|
+
const nodeTypeServiceId = "@theotherwillembotha/nodetypeservice";
|
|
77
|
+
const nodeTypeServiceListener = (pluginID) => {
|
|
78
|
+
if (pluginID === nodeTypeServiceId) {
|
|
79
|
+
RED.events.off('plugin.instantiated', nodeTypeServiceListener);
|
|
80
|
+
this.nodeTypeService = RED.plugins.get(nodeTypeServiceId).instance;
|
|
81
|
+
for (const nodeType of this.typeBacklog) {
|
|
82
|
+
for (const tag of nodeType.getNodeDescriptor().tags()) {
|
|
83
|
+
this.nodeTypeService.registerNodeType(tag, nodeType);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
this.typeBacklog = [];
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
this.nodeTypeService = RED.plugins.get(nodeTypeServiceId)?.instance;
|
|
90
|
+
if (!this.nodeTypeService) {
|
|
91
|
+
RED.events.on('plugin.instantiated', nodeTypeServiceListener);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static get RED() {
|
|
95
|
+
return global[_GLOBAL_RED_KEY];
|
|
96
|
+
}
|
|
97
|
+
registerNodeType(typeName, type) {
|
|
98
|
+
if (!type) {
|
|
99
|
+
console.error(`[NodeManager v${exports.NODEMANAGER_API_VERSION}] Type "${typeName}" is undefined. ` +
|
|
100
|
+
`Ensure it is exported and included in GenerateNodes.`);
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
const registeredNodes = getRegisteredNodes();
|
|
104
|
+
if (registeredNodes.has(typeName)) {
|
|
105
|
+
// Already registered by another plugin - skip to avoid Node-RED duplicate-registration error.
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
registeredNodes.add(typeName);
|
|
109
|
+
const nodeConstructor = function (config) {
|
|
110
|
+
try {
|
|
111
|
+
NodeManager.RED.nodes.createNode(this, config);
|
|
112
|
+
const node = new type(this, config);
|
|
113
|
+
runPostConstructInitializers(node);
|
|
114
|
+
if (node.onInit) {
|
|
115
|
+
node.onInit();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error(`[NodeManager v${exports.NODEMANAGER_API_VERSION}] Failed to construct node "${typeName}":`, error);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
try {
|
|
123
|
+
NodeManager.RED.nodes.registerType(typeName, nodeConstructor, { settings: {} });
|
|
124
|
+
const nodeDescription = type.getNodeDescriptor();
|
|
125
|
+
if (this.nodeTypeService) {
|
|
126
|
+
for (const tag of nodeDescription.tags()) {
|
|
127
|
+
this.nodeTypeService.registerNodeType(tag, type);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.typeBacklog.push(type);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
console.error(`[NodeManager v${exports.NODEMANAGER_API_VERSION}] Failed to register node type "${typeName}":`, error);
|
|
136
|
+
}
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.NodeManager = NodeManager;
|
package/icons/loki.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theotherwillembotha/node-red-loki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Grafana Loki integration for Node-RED ( service config, logger, and LogQL query node). Built on @theotherwillembotha/node-red-plugincore.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"exports": "./build/index.js",
|
|
7
|
+
"types": "./build/index.d.ts",
|
|
7
8
|
"author": "Willem Botha (@theotherwillembotha)",
|
|
8
9
|
"license": "ISC",
|
|
9
10
|
"keywords": [
|
|
@@ -15,13 +16,15 @@
|
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
|
-
"build": "npm run clean && tsc && npm run generate-nodes && npm run copy-files",
|
|
19
|
+
"build": "npm run clean && tsc && npm run generate-nodes && npm run bundle && npm run copy-files",
|
|
20
|
+
"bundle": "node esbuild.js",
|
|
19
21
|
"clean": "rm -rf ./build",
|
|
20
22
|
"generate-nodes": "node build/GenerateNodes.js",
|
|
21
23
|
"copy-files": "cp -r ./icons ./build/"
|
|
22
24
|
},
|
|
23
25
|
"files": [
|
|
24
26
|
"build/",
|
|
27
|
+
"icons/",
|
|
25
28
|
"documentation/",
|
|
26
29
|
"LICENSE",
|
|
27
30
|
"README.md"
|
|
@@ -39,7 +42,7 @@
|
|
|
39
42
|
"nodered": ">=4.0.0"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@theotherwillembotha/node-red-plugincore": "^0.
|
|
45
|
+
"@theotherwillembotha/node-red-plugincore": "^0.3.0",
|
|
43
46
|
"axios": "^1.7.0",
|
|
44
47
|
"winston": "^3.17.0",
|
|
45
48
|
"winston-loki": "^6.1.3"
|
|
@@ -47,7 +50,8 @@
|
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@theotherwillembotha/node-red-plugincore": "../nodered_plugincore",
|
|
49
52
|
"@types/node": "^22.15.29",
|
|
50
|
-
"@types/node-red": "~1.3.5"
|
|
53
|
+
"@types/node-red": "~1.3.5",
|
|
54
|
+
"esbuild": "^0.25.0"
|
|
51
55
|
},
|
|
52
56
|
"publishConfig": {
|
|
53
57
|
"access": "public"
|