@bonsae/nrg 0.8.0 → 0.8.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server/index.cjs +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonsae/nrg",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "NRG framework — build Node-RED nodes with Vue 3, TypeScript, and JSON Schema",
5
5
  "author": "Allan Oricil <allanoricil@duck.com>",
6
6
  "license": "MIT",
package/server/index.cjs CHANGED
@@ -244,8 +244,16 @@ var TypedInput = class {
244
244
  this.input = input;
245
245
  }
246
246
  resolvers = {
247
- // NOTE: NRG nodes are wrapped — surface the NRG instance, fall back to raw NodeRedNode
248
- node: (raw) => raw?._node ?? raw
247
+ // evaluateNodeProperty returns the node ID string for "node" type
248
+ // resolve it to the actual node instance via RED.nodes.getNode,
249
+ // then surface the NRG wrapper if available.
250
+ node: (raw) => {
251
+ if (typeof raw === "string") {
252
+ const node = this.RED.nodes.getNode(raw);
253
+ return node?._node ?? node ?? raw;
254
+ }
255
+ return raw?._node ?? raw;
256
+ }
249
257
  };
250
258
  get type() {
251
259
  return this.input.type;