@bonsae/nrg 0.12.1 → 0.13.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.
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  <p align="center">
6
6
  <a href="https://www.npmjs.com/package/@bonsae/nrg"><img src="https://img.shields.io/npm/v/@bonsae/nrg.svg" alt="npm package"></a>
7
7
  <a href="https://github.com/bonsaedev/nrg/actions/workflows/ci.yaml"><img src="https://github.com/bonsaedev/nrg/actions/workflows/ci.yaml/badge.svg?branch=main" alt="build status"></a>
8
+ <a href="https://codecov.io/gh/bonsaedev/nrg"><img src="https://codecov.io/gh/bonsaedev/nrg/graph/badge.svg" alt="codecov"/></a>
8
9
  <a href="https://socket.dev/npm/package/@bonsae/nrg"><img src="https://badge.socket.dev/npm/package/@bonsae/nrg?v=1" alt="Socket Badge"></a>
9
10
  </p>
10
11
 
@@ -73,15 +74,15 @@ NRG supports two ways to define nodes:
73
74
  <tr><td>
74
75
 
75
76
  ```typescript
76
- import { defineIONode } from "@bonsae/nrg/server";
77
- import { ConfigsSchema } from "../schemas/my-node";
77
+ import { defineIONode, SchemaType } from "@bonsae/nrg/server";
78
+ import { ConfigsSchema, InputSchema, OutputSchema } from "../schemas/my-node";
78
79
 
79
80
  export default defineIONode({
80
81
  type: "my-node",
81
82
  color: "#ffffff",
82
- inputs: 1,
83
- outputs: 1,
84
83
  configSchema: ConfigsSchema,
84
+ inputSchema: InputSchema,
85
+ outputsSchema: OutputSchema,
85
86
 
86
87
  async input(msg) {
87
88
  msg.payload = `${this.config.prefix}: ${msg.payload}`;
@@ -94,21 +95,22 @@ export default defineIONode({
94
95
 
95
96
  ```typescript
96
97
  import { IONode, type Schema, type Infer } from "@bonsae/nrg/server";
97
- import { ConfigsSchema } from "../schemas/my-node";
98
+ import { ConfigsSchema, InputSchema, OutputSchema } from "../schemas/my-node";
98
99
 
99
100
  type Config = Infer<typeof ConfigsSchema>;
101
+ type Input = Infer<typeof InputSchema>;
102
+ type Output = Infer<typeof OutputSchema>;
100
103
 
101
- export default class MyNode extends IONode<Config> {
104
+ export default class MyNode extends IONode<Config, any, Input, Output> {
102
105
  static readonly type = "my-node";
103
106
  static readonly category = "function";
104
107
  static readonly color: `#${string}` = "#ffffff";
105
- static readonly inputs = 1;
106
- static readonly outputs = 1;
107
108
  static readonly configSchema: Schema = ConfigsSchema;
109
+ static readonly inputSchema: Schema = InputSchema;
110
+ static readonly outputsSchema: Schema = OutputSchema;
108
111
 
109
- async input(msg: any) {
110
- msg.payload = `${this.config.prefix}: ${msg.payload}`;
111
- this.send(msg);
112
+ async input(msg: Input) {
113
+ this.send({ payload: `${this.config.prefix}: ${msg.payload}` });
112
114
  }
113
115
  }
114
116
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonsae/nrg",
3
- "version": "0.12.1",
3
+ "version": "0.13.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",
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "engines": {
16
- "node": ">=22",
16
+ "node": ">=20.19",
17
17
  "pnpm": ">=10.11.0"
18
18
  },
19
19
  "exports": {
package/server/index.cjs CHANGED
@@ -531,12 +531,18 @@ var Node = class {
531
531
  var IONode = class extends Node {
532
532
  static align;
533
533
  static color;
534
- static inputs = 0;
535
- static outputs = 0;
536
534
  static inputSchema;
537
535
  static outputsSchema;
538
536
  static validateInput = false;
539
537
  static validateOutput = false;
538
+ static get inputs() {
539
+ return this.inputSchema ? 1 : 0;
540
+ }
541
+ static get outputs() {
542
+ const s = this.outputsSchema;
543
+ if (!s) return 0;
544
+ return Array.isArray(s) ? s.length : 1;
545
+ }
540
546
  _send;
541
547
  context;
542
548
  // NOTE: used by the registered function. Had to be a different one to avoid calling the parent's input again
@@ -557,6 +563,8 @@ var IONode = class extends Node {
557
563
  fn.global = setupContext(context.global);
558
564
  this.context = fn;
559
565
  }
566
+ input(msg) {
567
+ }
560
568
  // NOTE: used by the registered function. Had to be a different one to avoid calling the parent's input again
561
569
  /** @internal */
562
570
  async _input(msg, send) {
@@ -749,8 +757,6 @@ function defineIONode(def) {
749
757
  static type = def.type;
750
758
  static category = def.category ?? "function";
751
759
  static color = def.color ?? "#a6bbcf";
752
- static inputs = def.inputs ?? 1;
753
- static outputs = def.outputs ?? 1;
754
760
  static align = def.align;
755
761
  static configSchema = def.configSchema;
756
762
  static credentialsSchema = def.credentialsSchema;
@@ -990,16 +996,6 @@ async function registerType(RED, NodeClass) {
990
996
  `Invalid color for ${NodeClass.type}: ${NC.color} color must be in hex format`
991
997
  );
992
998
  }
993
- if (NC.inputs !== void 0 && (!Number.isInteger(NC.inputs) || NC.inputs !== 0 && NC.inputs !== 1)) {
994
- throw new NrgError(
995
- `Invalid number of inputs for ${NodeClass.type}: inputs must be 0 or 1`
996
- );
997
- }
998
- if (NC.outputs !== void 0 && (!Number.isInteger(NC.outputs) || NC.outputs < 0)) {
999
- throw new NrgError(
1000
- `Invalid number of outputs for ${NodeClass.type}: outputs must be a positive integer`
1001
- );
1002
- }
1003
999
  RED.nodes.registerType(
1004
1000
  NC.type,
1005
1001
  function(config) {
@@ -1,4 +1,4 @@
1
- (function(){var s=document.createElement("style");s.textContent=".nrg-toggles-grid[data-v-8394a8d1]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px 16px}[data-v-8394a8d1] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-8394a8d1] .form-row input[type=text],[data-v-8394a8d1] .form-row input[type=number],[data-v-8394a8d1] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-label[data-v-9ffd05ad]{display:inline-block;width:100%;cursor:default}.nrg-label i[data-v-9ffd05ad]{margin-right:5px}.nrg-required[data-v-9ffd05ad]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-4077a6c2]{position:relative}.expand-button[data-v-4077a6c2]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.nrg-toggle-wrapper[data-v-36b098e4]{display:inline-flex;align-items:center}.nrg-toggle[data-v-36b098e4]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none}.nrg-toggle__input[data-v-36b098e4]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-36b098e4]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-36b098e4]:after{content:\"\";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle--checked .nrg-toggle__slider[data-v-36b098e4]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-36b098e4]:after{transform:translate(16px)}.nrg-toggle__label[data-v-36b098e4]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-36b098e4]{margin-right:2px}\n";document.head.appendChild(s);})();
1
+ (function(){var s=document.createElement("style");s.textContent=".nrg-toggles-grid[data-v-6a594f7a]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px 16px}[data-v-6a594f7a] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-6a594f7a] .form-row input[type=text],[data-v-6a594f7a] .form-row input[type=number],[data-v-6a594f7a] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-label[data-v-8b9bd83b]{display:inline-block;width:100%;cursor:default}.nrg-label i[data-v-8b9bd83b]{margin-right:5px}.nrg-required[data-v-8b9bd83b]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-2205b8dc]{position:relative}.expand-button[data-v-2205b8dc]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.nrg-toggle-wrapper[data-v-724dcae4]{display:inline-flex;align-items:center}.nrg-toggle[data-v-724dcae4]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none}.nrg-toggle__input[data-v-724dcae4]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-724dcae4]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-724dcae4]:after{content:\"\";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle--checked .nrg-toggle__slider[data-v-724dcae4]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-724dcae4]:after{transform:translate(16px)}.nrg-toggle__label[data-v-724dcae4]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-724dcae4]{margin-right:2px}\n";document.head.appendChild(s);})();
2
2
  import { defineComponent as Pe, resolveComponent as he, openBlock as W, createElementBlock as ee, Fragment as nr, createVNode as $e, createCommentVNode as ne, createElementVNode as ce, normalizeClass as sr, renderSlot as ze, createTextVNode as Ln, toDisplayString as je, createBlock as be, withDirectives as Rs, vShow as Is, renderList as yr, createApp as js } from "/nrg/assets/vue.esm-browser.prod.js";
3
3
  function ks(e, t, { signal: r, edges: s } = {}) {
4
4
  let l, o = null;
@@ -5597,7 +5597,7 @@ function $o(e, t, r, s, l, o) {
5597
5597
  /* STABLE_FRAGMENT */
5598
5598
  );
5599
5599
  }
5600
- const bo = /* @__PURE__ */ Oe(lo, [["render", $o], ["__scopeId", "data-v-8394a8d1"]]), wo = Pe({
5600
+ const bo = /* @__PURE__ */ Oe(lo, [["render", $o], ["__scopeId", "data-v-6a594f7a"]]), wo = Pe({
5601
5601
  name: "NodeRedInputLabel",
5602
5602
  props: {
5603
5603
  label: {
@@ -5644,7 +5644,7 @@ function Po(e, t, r, s, l, o) {
5644
5644
  e.required ? (W(), ee("span", So, "*")) : ne("v-if", !0)
5645
5645
  ]);
5646
5646
  }
5647
- const Ae = /* @__PURE__ */ Oe(wo, [["render", Po], ["__scopeId", "data-v-9ffd05ad"]]), Vn = "*************", No = Pe({
5647
+ const Ae = /* @__PURE__ */ Oe(wo, [["render", Po], ["__scopeId", "data-v-8b9bd83b"]]), Vn = "*************", No = Pe({
5648
5648
  components: { NodeRedInputLabel: Ae },
5649
5649
  props: {
5650
5650
  value: {
@@ -6337,7 +6337,7 @@ function Qo(e, t, r, s, l, o) {
6337
6337
  /* NEED_PATCH */
6338
6338
  );
6339
6339
  }
6340
- const bs = /* @__PURE__ */ Oe(Jo, [["render", Qo], ["__scopeId", "data-v-4077a6c2"]]), Xo = Pe({
6340
+ const bs = /* @__PURE__ */ Oe(Jo, [["render", Qo], ["__scopeId", "data-v-2205b8dc"]]), Xo = Pe({
6341
6341
  name: "NodeRedToggle",
6342
6342
  props: {
6343
6343
  modelValue: {
@@ -6410,7 +6410,7 @@ function ri(e, t, r, s, l, o) {
6410
6410
  )
6411
6411
  ]);
6412
6412
  }
6413
- const ws = /* @__PURE__ */ Oe(Xo, [["render", ri], ["__scopeId", "data-v-36b098e4"]]), ni = /* @__PURE__ */ new Set([
6413
+ const ws = /* @__PURE__ */ Oe(Xo, [["render", ri], ["__scopeId", "data-v-724dcae4"]]), ni = /* @__PURE__ */ new Set([
6414
6414
  "id",
6415
6415
  "type",
6416
6416
  "x",
@@ -6772,13 +6772,7 @@ function pi(e, t, r, s, l, o) {
6772
6772
  ))
6773
6773
  ]);
6774
6774
  }
6775
- const zn = /* @__PURE__ */ Oe(oi, [["render", pi]]), Ss = {}, ur = {};
6776
- function vi(e) {
6777
- Object.assign(Ss, e);
6778
- }
6779
- function _i(e) {
6780
- Object.assign(ur, e);
6781
- }
6775
+ const zn = /* @__PURE__ */ Oe(oi, [["render", pi]]);
6782
6776
  function hi(e, t, r, s) {
6783
6777
  const l = js(bo, {
6784
6778
  node: e,
@@ -6793,6 +6787,13 @@ function mi(e, t, r, s, l) {
6793
6787
  function rr(e) {
6794
6788
  e._app && (e._app.unmount(), e._app = null);
6795
6789
  }
6790
+ const Ss = {}, ur = {};
6791
+ function vi(e) {
6792
+ Object.assign(Ss, e);
6793
+ }
6794
+ function _i(e) {
6795
+ Object.assign(ur, e);
6796
+ }
6796
6797
  function Fn(e) {
6797
6798
  const t = {
6798
6799
  credentials: {}
@@ -6914,8 +6915,6 @@ async function yi(e) {
6914
6915
  const u = Object.keys(P)[0];
6915
6916
  u && (P[u] = {
6916
6917
  ...P[u],
6917
- // 2-arg signature (value, opt) tells Node-RED 3.x to accept
6918
- // string/array returns as error messages for the tooltip.
6919
6918
  validate: function(n, f) {
6920
6919
  return uo(this, v);
6921
6920
  }
@@ -6972,7 +6971,7 @@ async function yi(e) {
6972
6971
  if (f && f !== `${t}.outputLabels`) return f;
6973
6972
  },
6974
6973
  align: m.align || "left",
6975
- button: m.button,
6974
+ button: m.button ? { ...m.button, onclick: m.button.onClick } : void 0,
6976
6975
  oneditprepare: a,
6977
6976
  oneditsave: i,
6978
6977
  oneditcancel: y,
package/test/index.js CHANGED
@@ -235,10 +235,19 @@ async function createNode(NodeClass, options = {}) {
235
235
  const {
236
236
  config: userConfig = {},
237
237
  credentials = {},
238
- configNodes = {},
239
238
  settings = {},
240
239
  overrides: overrideOpts = {}
241
240
  } = options;
241
+ const resolvedConfig = {};
242
+ const configNodes = {};
243
+ for (const [key, value] of Object.entries(userConfig)) {
244
+ if (value && typeof value === "object" && "id" in value && "config" in value) {
245
+ configNodes[value.id] = value;
246
+ resolvedConfig[key] = value.id;
247
+ } else {
248
+ resolvedConfig[key] = value;
249
+ }
250
+ }
242
251
  const redNodes = buildNodeRedNodes(configNodes);
243
252
  const RED = createMockRED({ nodes: redNodes, settings });
244
253
  initValidator(RED);
@@ -251,7 +260,7 @@ async function createNode(NodeClass, options = {}) {
251
260
  }
252
261
  const config = buildConfig(NodeClass, {
253
262
  ...configDefaults,
254
- ...userConfig
263
+ ...resolvedConfig
255
264
  });
256
265
  const nodeRedNode = createMockNodeRedNode({
257
266
  id: config.id,
package/types/client.d.ts CHANGED
@@ -1,36 +1,98 @@
1
+ // Generated by dts-bundle-generator v9.5.1
1
2
 
2
- import type { Component } from "vue";
3
+ import { App, Component } from 'vue';
3
4
 
5
+ export interface NodeStateCredentials {
6
+ [key: string]: any;
7
+ }
8
+ export interface NodeState {
9
+ credentials: NodeStateCredentials;
10
+ [key: string]: any;
11
+ }
4
12
  export interface NodeButtonDefinition {
5
- toggle: string;
6
- onclick: () => void;
7
- enabled?: () => boolean;
8
- visible?: () => boolean;
13
+ toggle: string;
14
+ onClick: () => void;
15
+ enabled?: () => boolean;
16
+ visible?: () => boolean;
17
+ }
18
+ export interface NodeRedNodeButtonDefinition {
19
+ toggle: string;
20
+ onclick: () => void;
21
+ enabled?: () => boolean;
22
+ visible?: () => boolean;
9
23
  }
10
-
11
24
  export interface NodeFormDefinition {
12
- component?: Component;
25
+ component?: Component;
26
+ }
27
+ export interface NodeRedNode {
28
+ id: string;
29
+ type: string;
30
+ name: string;
31
+ category: string;
32
+ x: string;
33
+ y: string;
34
+ g: string;
35
+ z: string;
36
+ credentials: Record<string, any>;
37
+ _def: {
38
+ defaults: Record<string, {
39
+ value: string;
40
+ type?: string;
41
+ label?: string;
42
+ required?: boolean;
43
+ }>;
44
+ credentials: Record<string, {
45
+ value: string;
46
+ type?: "password" | "text";
47
+ label?: string;
48
+ required?: boolean;
49
+ }>;
50
+ category: string;
51
+ color?: string;
52
+ icon?: string;
53
+ label?: ((this: NodeRedNode) => string) | string;
54
+ inputs?: number;
55
+ outputs?: number;
56
+ paletteLabel?: ((this: NodeRedNode) => string) | string;
57
+ labelStyle?: ((this: NodeRedNode) => string) | string;
58
+ inputLabels?: ((this: NodeRedNode, index: number) => string) | string;
59
+ outputLabels?: ((this: NodeRedNode, index: number) => string) | string;
60
+ align?: "left" | "right";
61
+ button?: NodeRedNodeButtonDefinition;
62
+ };
63
+ _newState?: NodeRedNode;
64
+ _app?: App | null;
65
+ _: (str: string) => string;
66
+ [key: string]: any;
13
67
  }
14
-
15
68
  export interface NodeDefinition {
16
- type: string;
17
- category?: string;
18
- color?: string;
19
- icon?: ((this: any) => string) | string;
20
- label?: ((this: any) => string) | string;
21
- inputs?: number;
22
- outputs?: number;
23
- paletteLabel?: ((this: any) => string) | string;
24
- labelStyle?: ((this: any) => string) | string;
25
- inputLabels?: ((this: any) => string) | string;
26
- outputLabels?: ((this: any) => string) | string;
27
- align?: "left" | "right";
28
- button?: NodeButtonDefinition;
29
- onEditResize?: (this: any, size: { width: number; height: number }) => void;
30
- onPaletteAdd?: (this: any) => void;
31
- onPaletteRemove?: (this: any) => void;
32
- form?: NodeFormDefinition;
69
+ type: string;
70
+ category?: string;
71
+ color?: string;
72
+ icon?: ((this: NodeRedNode) => string) | string;
73
+ label?: ((this: NodeRedNode) => string) | string;
74
+ inputs?: number;
75
+ outputs?: number;
76
+ paletteLabel?: ((this: NodeRedNode) => string) | string;
77
+ labelStyle?: ((this: NodeRedNode) => string) | string;
78
+ inputLabels?: ((this: NodeRedNode, index: number) => string) | string;
79
+ outputLabels?: ((this: NodeRedNode, index: number) => string) | string;
80
+ align?: "left" | "right";
81
+ button?: NodeButtonDefinition;
82
+ onEditResize?: (this: NodeRedNode, size: {
83
+ width: number;
84
+ height: number;
85
+ }) => void;
86
+ onPaletteAdd?: (this: NodeRedNode) => void;
87
+ onPaletteRemove?: (this: NodeRedNode) => void;
88
+ form?: NodeFormDefinition;
33
89
  }
90
+ export interface NodeFeatures {
91
+ hasInputSchema: boolean;
92
+ hasOutputSchema: boolean;
93
+ }
94
+
95
+ export {};
34
96
 
35
97
  export declare function defineNode<T extends NodeDefinition>(options: T): T;
36
98
  export declare function registerType(definition: NodeDefinition): Promise<void>;
package/types/server.d.ts CHANGED
@@ -1262,6 +1262,15 @@ export interface TVoid extends TSchema {
1262
1262
  type: "void";
1263
1263
  }
1264
1264
  export interface SchemaOptions {
1265
+ exportable?: boolean;
1266
+ "x-nrg-node-type"?: string;
1267
+ "x-nrg-form"?: {
1268
+ icon?: string;
1269
+ typedInputTypes?: string[];
1270
+ editorLanguage?: string;
1271
+ toggle?: boolean;
1272
+ };
1273
+
1265
1274
  $schema?: string;
1266
1275
  /** Id for this schema */
1267
1276
  $id?: string;
@@ -2048,6 +2057,16 @@ declare class TypedInput<T = unknown> {
2048
2057
  get value(): unknown;
2049
2058
  resolve(msg?: Record<string, any>): Promise<T>;
2050
2059
  }
2060
+ export interface NrgSchemaExtensions {
2061
+ exportable?: boolean;
2062
+ "x-nrg-node-type"?: string;
2063
+ "x-nrg-form"?: {
2064
+ icon?: string;
2065
+ typedInputTypes?: string[];
2066
+ editorLanguage?: string;
2067
+ toggle?: boolean;
2068
+ };
2069
+ }
2051
2070
  export interface TNodeRef<T = any> extends TSchema {
2052
2071
  [Kind]: "NodeRef";
2053
2072
  static: T;
@@ -2063,20 +2082,9 @@ export interface TTypedInput<T = unknown> extends TSchema {
2063
2082
  [Kind]: "TypedInput";
2064
2083
  static: TypedInput<T>;
2065
2084
  }
2066
- export interface NrgFormOptions {
2067
- icon?: string;
2068
- typedInputTypes?: string[];
2069
- editorLanguage?: string;
2070
- toggle?: boolean;
2071
- }
2072
- export interface NrgSchemaOptions extends SchemaOptions {
2073
- exportable?: boolean;
2074
- "x-nrg-node-type"?: string;
2075
- "x-nrg-form"?: NrgFormOptions;
2076
- }
2077
- export interface Schema<T extends TProperties = TProperties> extends TObject<T> {
2078
- $id: string;
2085
+ export interface NrgSchemaOptions extends SchemaOptions, NrgSchemaExtensions {
2079
2086
  }
2087
+ export type Schema<T extends TProperties = TProperties> = TObject<T>;
2080
2088
  declare const NodeConfigSchema: TObject<{
2081
2089
  id: TString;
2082
2090
  type: TString;
@@ -2106,8 +2114,8 @@ export declare const SchemaType: JavaScriptTypeBuilder & {
2106
2114
  NodeRef: typeof NodeRef;
2107
2115
  TypedInput: typeof TypedInput$1;
2108
2116
  };
2109
- export declare function defineSchema<T extends TProperties>(properties: T, options: ObjectOptions & {
2110
- $id: string;
2117
+ export declare function defineSchema<T extends TProperties>(properties: T, options?: ObjectOptions & {
2118
+ $id?: string;
2111
2119
  }): Schema<T>;
2112
2120
  export type NodeContextScope = "node" | "flow" | "global";
2113
2121
  export interface NodeContextStore {
@@ -2143,20 +2151,20 @@ export type ConfigNodeContext = {
2143
2151
  node: NodeContextStore;
2144
2152
  global: NodeContextStore;
2145
2153
  };
2146
- export declare abstract class IONode<TConfig = any, TCredentials = any, TInput = any, TOutput = any, TSettings = any> extends Node$1<TConfig, TCredentials, TSettings> {
2154
+ export declare class IONode<TConfig = any, TCredentials = any, TInput = any, TOutput = any, TSettings = any> extends Node$1<TConfig, TCredentials, TSettings> {
2147
2155
  static readonly align?: "left" | "right";
2148
2156
  static readonly color: HexColor;
2149
- static readonly inputs?: number;
2150
- static readonly outputs?: number;
2151
2157
  static readonly inputSchema?: Schema;
2152
2158
  static readonly outputsSchema?: Schema | Schema[];
2153
2159
  static readonly validateInput: boolean;
2154
2160
  static readonly validateOutput: boolean;
2161
+ static get inputs(): 0 | 1;
2162
+ static get outputs(): number;
2155
2163
  private _send;
2156
2164
  readonly config: IONodeConfig<TConfig>;
2157
2165
  protected readonly context: IONodeContext;
2158
2166
  constructor(RED: RED, node: any, config: IONodeConfig<TConfig>, credentials: IONodeCredentials<TCredentials>);
2159
- abstract input(msg: TInput): void | Promise<void>;
2167
+ input(msg: TInput): void | Promise<void>;
2160
2168
  send(msg: TOutput): void;
2161
2169
  private _nodeSource;
2162
2170
  status(status: IONodeStatus): void;
@@ -2203,8 +2211,6 @@ export interface IONodeDefinition<TConfigSchema extends TSchema | undefined = un
2203
2211
  type: string;
2204
2212
  category?: string;
2205
2213
  color?: HexColor;
2206
- inputs?: 0 | 1;
2207
- outputs?: number;
2208
2214
  align?: "left" | "right";
2209
2215
  configSchema?: TConfigSchema;
2210
2216
  credentialsSchema?: TCredsSchema;
package/types/test.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  export interface CreateNodeOptions {
3
3
  config?: Record<string, any>;
4
4
  credentials?: Record<string, any>;
5
- configNodes?: Record<string, any>;
6
5
  settings?: Record<string, any>;
7
6
  overrides?: Record<string, any>;
8
7
  }