@bonsae/nrg-runtime 0.35.1 → 0.36.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/index.cjs +16 -5
- package/package.json +1 -1
- package/resources/nrg.0682c337.js +24 -0
- package/resources/nrg.718765b9.js +0 -20
package/index.cjs
CHANGED
|
@@ -292,7 +292,7 @@ function initValidator(RED) {
|
|
|
292
292
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
293
293
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
294
294
|
var import_node_module = require("node:module");
|
|
295
|
-
var CLIENT_ASSET = true ? "nrg.
|
|
295
|
+
var CLIENT_ASSET = true ? "nrg.0682c337.js" : "nrg.js";
|
|
296
296
|
function serveFile(filePath) {
|
|
297
297
|
return (_req, res, next) => {
|
|
298
298
|
if (!import_node_fs.default.existsSync(filePath)) return next();
|
|
@@ -1378,18 +1378,29 @@ function OutputContextModes(options) {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
);
|
|
1380
1380
|
}
|
|
1381
|
+
function serializeSchemaDefault(value) {
|
|
1382
|
+
return typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
1383
|
+
}
|
|
1381
1384
|
function OutputSchemas(options) {
|
|
1385
|
+
const { default: seed, ...rest } = options ?? {};
|
|
1386
|
+
const seededDefault = seed ? Object.fromEntries(
|
|
1387
|
+
Object.entries(seed).map(([port, schema]) => [
|
|
1388
|
+
port,
|
|
1389
|
+
serializeSchemaDefault(schema)
|
|
1390
|
+
])
|
|
1391
|
+
) : {};
|
|
1382
1392
|
return import_typebox2.Type.Record(import_typebox2.Type.Number(), import_typebox2.Type.String(), {
|
|
1383
1393
|
description: "Per-port output data-validation schema (JSON Schema string), keyed by output port index.",
|
|
1384
|
-
default:
|
|
1385
|
-
...
|
|
1394
|
+
default: seededDefault,
|
|
1395
|
+
...rest
|
|
1386
1396
|
});
|
|
1387
1397
|
}
|
|
1388
1398
|
function InputSchema(options) {
|
|
1399
|
+
const { default: seed, ...rest } = options ?? {};
|
|
1389
1400
|
return import_typebox2.Type.String({
|
|
1390
1401
|
description: "Input data-validation schema (JSON Schema string).",
|
|
1391
|
-
default: "",
|
|
1392
|
-
...
|
|
1402
|
+
default: seed === void 0 ? "" : serializeSchemaDefault(seed),
|
|
1403
|
+
...rest
|
|
1393
1404
|
});
|
|
1394
1405
|
}
|
|
1395
1406
|
function NrgUnsafe(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonsae/nrg-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "The runtime for Node-RED nodes built with @bonsae/nrg — node base classes, schemas, AJV validator, and the editor client. Carries no build tooling.",
|
|
5
5
|
"author": "Allan Oricil <allanoricil@duck.com>",
|
|
6
6
|
"license": "MIT",
|