Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-types / BaseNode

Abstract Class: BaseNode ​

Defined in: packages/chaingraph-types/src/node/base-node.ts:12

Extends ​

  • BaseNodeCompositional

Extended by ​

Constructors ​

Constructor ​

new BaseNode(id, _metadata?): BaseNode

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:79

Parameters ​

id ​

string

_metadata? ​

NodeMetadata

Returns ​

BaseNode

Inherited from ​

BaseNodeCompositional.constructor

Properties ​

_id ​

protected readonly _id: string

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:56

Inherited from ​

BaseNodeCompositional._id


_metadata ​

protected _metadata: NodeMetadata

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:57

Inherited from ​

BaseNodeCompositional._metadata


_status ​

protected _status: NodeStatus = NodeStatus.Idle

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:58

Inherited from ​

BaseNodeCompositional._status

Accessors ​

id ​

Get Signature ​

get id(): string

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:205

Unique identifier of the node

Returns ​

string

Inherited from ​

BaseNodeCompositional.id


metadata ​

Get Signature ​

get metadata(): NodeMetadata

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:209

Metadata describing the node

Returns ​

NodeMetadata

Inherited from ​

BaseNodeCompositional.metadata


ports ​

Get Signature ​

get ports(): Map<string, IPort<IPortConfig>>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:326

Get all ports of the node

Returns ​

Map<string, IPort<IPortConfig>>

Inherited from ​

BaseNodeCompositional.ports


status ​

Get Signature ​

get status(): NodeStatus

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:213

Current execution status of the node

Returns ​

NodeStatus

Inherited from ​

BaseNodeCompositional.status


storage ​

Get Signature ​

get storage(): UnifiedPortStorage

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:220

Access to unified storage (for advanced usage and debugging)

Returns ​

UnifiedPortStorage

Inherited from ​

BaseNodeCompositional.storage

Methods ​

addObjectProperties() ​

addObjectProperties(objectPort, properties, useParentUI?): Promise<IPort<IPortConfig>[]>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:863

Parameters ​

objectPort ​

IPort

properties ​

IPortConfig[]

useParentUI? ​

boolean

Returns ​

Promise<IPort<IPortConfig>[]>

Deprecated ​

Use AddFieldsOperation instead

Inherited from ​

BaseNodeCompositional.addObjectProperties


addObjectProperty() ​

addObjectProperty(objectPort, key, portConfig, useParentUI?): Promise<IPort<IPortConfig>>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:841

Add a new property to an object port

Parameters ​

objectPort ​

IPort

The parent object port

key ​

string

The property key

portConfig ​

IPortConfig

The port configuration for the new property

useParentUI? ​

boolean

indicates whether we want to use the parents UI

Returns ​

Promise<IPort<IPortConfig>>

Inherited from ​

BaseNodeCompositional.addObjectProperty


appendArrayItem() ​

appendArrayItem(arrayPort, value): Promise<number>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:939

Add an item to an array port

Parameters ​

arrayPort ​

IPort

The array port

value ​

any

The value to append

Returns ​

Promise<number>

The index of the new item

Inherited from ​

BaseNodeCompositional.appendArrayItem


bindPortBindings() ​

bindPortBindings(): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:713

Rebind all port properties to storage

Returns ​

void

Inherited from ​

BaseNodeCompositional.bindPortBindings


bindPortToNodeProperty() ​

bindPortToNodeProperty(targetObject, port): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:703

Bind a port to a node property

Parameters ​

targetObject ​

any

port ​

IPort

Returns ​

void

Deprecated ​

Use bindProperty instead

Inherited from ​

BaseNodeCompositional.bindPortToNodeProperty


clone() ​

clone(): INodeComposite

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1062

Create a deep clone of the node

Returns ​

INodeComposite

A new node instance with the same state

Inherited from ​

BaseNodeCompositional.clone


cloneWithNewId() ​

cloneWithNewId(): this

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1073

Create a deep clone of the node with new unique identifiers This method recursively clones all ports with new IDs while preserving the port hierarchy, values, and metadata

Returns ​

this

A result object containing the cloned node and ID mappings

Inherited from ​

BaseNodeCompositional.cloneWithNewId


commitBatchUpdate() ​

commitBatchUpdate(eventContext?): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:670

Commit all collected port updates and emit events

Parameters ​

eventContext? ​

EventContext

Optional context to be added to all emitted events

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.commitBatchUpdate


copyObjectSchemaTo() ​

copyObjectSchemaTo(sourceNode, sourceObjectPort, targetObjectPort, useParentUI?): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:483

Copy the schema (properties) from a source ObjectPort to a target ObjectPort

Parameters ​

sourceNode ​

INodeComposite

The node containing the source port

sourceObjectPort ​

The source ObjectPort to copy from

ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort

targetObjectPort ​

The target ObjectPort to copy to

ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort

useParentUI? ​

boolean

Whether to use parent UI settings for the new properties

Returns ​

Promise<void>

Promise that resolves when copying is complete

Inherited from ​

BaseNodeCompositional.copyObjectSchemaTo


createEvent() ​

createEvent<T>(type, data): EventReturnType<T>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1164

Type Parameters ​

T ​

T extends NodeEventType

Parameters ​

type ​

T

data ​

NodeEventDataType<T>

Returns ​

EventReturnType<T>

Inherited from ​

BaseNodeCompositional.createEvent


deserialize() ​

deserialize(data): INodeComposite

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1057

Deserialize from JSON data

Parameters ​

data ​

unknown

The serialized data

Returns ​

INodeComposite

The deserialized instance

Inherited from ​

BaseNodeCompositional.deserialize


dispose() ​

dispose(): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:310

Release resources and prepare the node for garbage collection

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.dispose


emit() ​

emit<T>(event): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:618

Emit an event to all subscribers

Type Parameters ​

T ​

T extends NodeEvent

Parameters ​

event ​

T

The event to emit

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.emit


execute() ​

abstract execute(context): Promise<NodeExecutionResult>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:169

Abstract method that must be implemented by concrete nodes We'll wrap this with logic for default port handling

Parameters ​

context ​

ExecutionContext

Returns ​

Promise<NodeExecutionResult>

Inherited from ​

BaseNodeCompositional.execute


executeOperation() ​

executeOperation<P, R>(operation): Promise<OperationResult<R>>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:647

Execute an operation on this node

This is the new primary API for node manipulation. Operations provide:

  • Type-safe parameters and results
  • Automatic event emission
  • Traceability (operation IDs, context)
  • Validation before execution

Type Parameters ​

P ​

P

R ​

R

Parameters ​

operation ​

IOperation<P, R>

Operation to execute

Returns ​

Promise<OperationResult<R>>

Operation result with success/error and events

Example ​

typescript
const op = new SetValueOperation(
  { portPath: 'prompt', value: 'Hello' },
  { userId: 'user123', source: 'ui' }
)
const result = await node.executeOperation(op)
if (result.success) {
  console.log('Value set:', result.data.newValue)
}

Inherited from ​

BaseNodeCompositional.executeOperation


executeWithSystemPorts() ​

executeWithSystemPorts(context): Promise<NodeExecutionResult>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:178

Runtime execute that wraps the abstract execute to handle system ports. This is an internal method used by the execution engine.

Parameters ​

context ​

ExecutionContext

The execution context

Returns ​

Promise<NodeExecutionResult>

The execution result

Inherited from ​

BaseNodeCompositional.executeWithSystemPorts


findPort() ​

findPort(predicate): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:529

Find a port by a predicate function

Parameters ​

predicate ​

(port) => boolean

Predicate function to match the port

Returns ​

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from ​

BaseNodeCompositional.findPort


findPortByKey() ​

findPortByKey(key): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:614

Find a port by its key

Parameters ​

key ​

string

The key of the port to find

Returns ​

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from ​

BaseNodeCompositional.findPortByKey


findPortByPath() ​

findPortByPath(path): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:384

Find a port by following a path of property names from the node root

Parameters ​

path ​

string[]

Path segments (property names or array indices)

Returns ​

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from ​

BaseNodeCompositional.findPortByPath


findPorts() ​

findPorts(predicate): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:539

Find all ports by a predicate function

Parameters ​

predicate ​

(port) => boolean

Predicate function to match the port

Returns ​

IPort<IPortConfig>[]

Array of ports that match the predicate

Inherited from ​

BaseNodeCompositional.findPorts


getChildPorts() ​

getChildPorts(parentPort): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:390

Get all direct child ports of a parent port

Parameters ​

parentPort ​

IPort

The parent port

Returns ​

IPort<IPortConfig>[]

Array of child ports

Inherited from ​

BaseNodeCompositional.getChildPorts


getDefaultPorts() ​

getDefaultPorts(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1080

Get all default ports based on the node's flow configuration

Returns ​

IPort<IPortConfig>[]

Inherited from ​

BaseNodeCompositional.getDefaultPorts


getErrorMessagePort() ​

getErrorMessagePort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1104

Get error message port

Returns ​

IPort<IPortConfig> | undefined

Inherited from ​

BaseNodeCompositional.getErrorMessagePort


getErrorPort() ​

getErrorPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1100

Get error port

Returns ​

IPort<IPortConfig> | undefined

Inherited from ​

BaseNodeCompositional.getErrorPort


getFlowInPort() ​

getFlowInPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1092

Get flow in port

Returns ​

IPort<IPortConfig> | undefined

Inherited from ​

BaseNodeCompositional.getFlowInPort


getFlowOutPort() ​

getFlowOutPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1096

Get flow out port

Returns ​

IPort<IPortConfig> | undefined

Inherited from ​

BaseNodeCompositional.getFlowOutPort


getInputs() ​

getInputs(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:340

Get all input ports

Returns ​

IPort<IPortConfig>[]

Array of input ports

Inherited from ​

BaseNodeCompositional.getInputs


getNestedPorts() ​

getNestedPorts(parentPort): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:395

Get all nested ports of a parent port, including its children and their children recursively

Parameters ​

parentPort ​

IPort

The parent port

Returns ​

IPort<IPortConfig>[]

Array of all nested ports

Inherited from ​

BaseNodeCompositional.getNestedPorts


getOutputs() ​

getOutputs(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:347

Get all output ports

Returns ​

IPort<IPortConfig>[]

Array of output ports

Inherited from ​

BaseNodeCompositional.getOutputs


getParentshipChain() ​

getParentshipChain(port): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:408

Get the full parentship chain of a port, from the port up to the root

Parameters ​

port ​

IPort

The port to get the chain for

Returns ​

IPort<IPortConfig>[]

Array of ports in the chain, starting from the given port up to the root

Inherited from ​

BaseNodeCompositional.getParentshipChain


getPort() ​

getPort(portId): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:331

Get a port by its ID

Parameters ​

portId ​

string

The port ID

Returns ​

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from ​

BaseNodeCompositional.getPort


getPortByPath() ​

getPortByPath(pathString): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:544

Get a port by its path string (e.g., "port.subport.array[0].field")

Parameters ​

pathString ​

string

The path string to the port

Returns ​

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from ​

BaseNodeCompositional.getPortByPath


getPortPath() ​

getPortPath(portId): string | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:549

Get the full path string for a given port

Parameters ​

portId ​

string

The ID of the port

Returns ​

string | undefined

The path string (e.g., "port.subport.field") or undefined if port not found

Inherited from ​

BaseNodeCompositional.getPortPath


getPortPathForPort() ​

getPortPathForPort(port): string

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:554

Get the full path string for a given port instance

Parameters ​

port ​

IPort

The port instance

Returns ​

string

The path string (e.g., "port.subport.field")

Inherited from ​

BaseNodeCompositional.getPortPathForPort


getRootPort() ​

getRootPort(port): IPort

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:424

Get the root port of a given port by traversing up the parentship chain

Parameters ​

port ​

IPort

The port to find the root for

Returns ​

IPort

The root port

Inherited from ​

BaseNodeCompositional.getRootPort


getSystemPortConfigs() ​

getSystemPortConfigs(): IPortConfig[]

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1084

Get system port configurations

Returns ​

IPortConfig[]

Inherited from ​

BaseNodeCompositional.getSystemPortConfigs


getUI() ​

getUI(): NodeUIMetadata | undefined

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1011

Get the node's UI metadata

Returns ​

NodeUIMetadata | undefined

Node UI metadata or undefined if not set

Inherited from ​

BaseNodeCompositional.getUI


getVersion() ​

getVersion(): number

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1038

Get the current version number

Returns ​

number

The current version

Inherited from ​

BaseNodeCompositional.getVersion


hasPort() ​

hasPort(portId): boolean

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:336

Check if a port with the given ID exists

Parameters ​

portId ​

string

The port ID

Returns ​

boolean

True if the port exists, false otherwise

Inherited from ​

BaseNodeCompositional.hasPort


incrementVersion() ​

incrementVersion(): number

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1034

Increment the node's version number

Returns ​

number

The new version number

Inherited from ​

BaseNodeCompositional.incrementVersion


initialize() ​

initialize(portsConfig?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1119

Initialize the node with port configurations

Parameters ​

portsConfig? ​

Map<string, IPortConfig>

Optional map of port configurations

Returns ​

void

Inherited from ​

BaseNodeCompositional.initialize


initializePortsFromConfigs() ​

initializePortsFromConfigs(portsConfigs, syncValuesToStorage): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:727

Initialize ports from configs

Parameters ​

portsConfigs ​

Map<string, IPortConfig>

syncValuesToStorage ​

boolean = true

Returns ​

void

Inherited from ​

BaseNodeCompositional.initializePortsFromConfigs


isDefaultPort() ​

isDefaultPort(portId): boolean

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1088

Check if a port is a system default port

Parameters ​

portId ​

string

Returns ​

boolean

Inherited from ​

BaseNodeCompositional.isDefaultPort


on() ​

on<T>(eventType, handler): () => void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:561

Subscribe to node events of a specific type

Type Parameters ​

T ​

T extends NodeEvent

Parameters ​

eventType ​

T["type"]

The type of event to subscribe to

handler ​

(event) => void | Promise<void>

The event handler function

Returns ​

A function to unsubscribe

(): void

Returns ​

void

Inherited from ​

BaseNodeCompositional.on


onAll() ​

onAll(handler): () => void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:568

Subscribe to all node events

Parameters ​

handler ​

(event) => void | Promise<void>

The event handler function

Returns ​

A function to unsubscribe

(): void

Returns ​

void

Inherited from ​

BaseNodeCompositional.onAll


onEvent() ​

onEvent(_event): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:578

Event handler for the node This is the key method that derived classes can override to handle events

Parameters ​

_event ​

NodeEvent

The event to handle

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.onEvent


processPortConfig() ​

processPortConfig(config, context): IPortConfig

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:998

Parameters ​

config ​

IPortConfig

context ​
nodeId ​

string

parentPortConfig ​

IPortConfig | null

propertyKey ​

string

propertyValue ​

any

Returns ​

IPortConfig

Deprecated ​

Internal method - should not be called externally

Inherited from ​

BaseNodeCompositional.processPortConfig


removeArrayItem() ​

removeArrayItem(arrayPort, index): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:962

Parameters ​

arrayPort ​

IPort

index ​

number

Returns ​

Promise<void>

Deprecated ​

Use RemoveItemOperation instead

Example ​

ts
await node.executeOperation(new RemoveItemOperation({ arrayPath, index }))

Inherited from ​

BaseNodeCompositional.removeArrayItem


removeArrayItems() ​

removeArrayItems(arrayPort, indices): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:982

Parameters ​

arrayPort ​

IPort

indices ​

number[]

Returns ​

Promise<void>

Deprecated ​

Use multiple RemoveItemOperation calls or batch operation

Inherited from ​

BaseNodeCompositional.removeArrayItems


removeObjectProperties() ​

removeObjectProperties(objectPort, keys): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:882

Parameters ​

objectPort ​

IPort

keys ​

string[]

Returns ​

Promise<void>

Deprecated ​

Use RemoveFieldsOperation instead

Inherited from ​

BaseNodeCompositional.removeObjectProperties


removeObjectProperty() ​

removeObjectProperty(objectPort, key): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:897

Parameters ​

objectPort ​

IPort

key ​

string

Returns ​

Promise<void>

Deprecated ​

Use RemoveFieldOperation instead

Example ​

ts
await node.executeOperation(new RemoveFieldOperation({ parentPath, key }))

Inherited from ​

BaseNodeCompositional.removeObjectProperty


removePort() ​

removePort(portId): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:368

Remove a port by its ID

Parameters ​

portId ​

string

The ID of the port to remove

Returns ​

void

Inherited from ​

BaseNodeCompositional.removePort


removePorts() ​

removePorts(portIds): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:376

Remove multiple ports by their IDs

Parameters ​

portIds ​

string[]

Array of port IDs to remove

Returns ​

void

Inherited from ​

BaseNodeCompositional.removePorts


replaceStorage() ​

replaceStorage(newStorage): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:230

Internal

Replace the unified storage with a new instance Used during cloning to set up the cloned node's storage

Parameters ​

newStorage ​

UnifiedPortStorage

Returns ​

void

Inherited from ​

BaseNodeCompositional.replaceStorage


reset() ​

reset(): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:294

Reset the node to its initial state

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.reset


serialize() ​

serialize(): unknown

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1053

Serialize the node to a JSON-compatible format

Returns ​

unknown

The serialized node

Inherited from ​

BaseNodeCompositional.serialize


setDimensions() ​

setDimensions(dimensions, emitEvent?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1023

Update the node's dimensions

Parameters ​

dimensions ​

Dimensions

New dimensions

emitEvent? ​

boolean

Whether to emit a dimensions change event

Returns ​

void

Inherited from ​

BaseNodeCompositional.setDimensions


setMetadata() ​

setMetadata(metadata): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:263

Set the node metadata

Parameters ​

metadata ​

NodeMetadata

New metadata

Returns ​

void

Inherited from ​

BaseNodeCompositional.setMetadata


setNodeParent() ​

setNodeParent(position, parentNodeId?, emitEvent?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1027

Update the node's parent and position

Parameters ​

position ​

Position

New position coordinates

parentNodeId? ​

string

ID of the parent node or undefined to remove parent

emitEvent? ​

boolean

Whether to emit a parent change event

Returns ​

void

Inherited from ​

BaseNodeCompositional.setNodeParent


setPort() ​

setPort(port): IPort

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:354

Add or update a port

Parameters ​

port ​

IPort

The port to set

Returns ​

IPort

The added/updated port

Inherited from ​

BaseNodeCompositional.setPort


setPorts() ​

setPorts(ports): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:360

Set all ports at once

Parameters ​

ports ​

Map<string, IPort<IPortConfig>>

Map of ports to set

Returns ​

void

Inherited from ​

BaseNodeCompositional.setPorts


setPosition() ​

setPosition(position, emitEvent?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1019

Update the node's position

Parameters ​

position ​

Position

New position coordinates

emitEvent? ​

boolean

Whether to emit a position change event

Returns ​

void

Inherited from ​

BaseNodeCompositional.setPosition


setStatus() ​

setStatus(status, emitEvent?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:275

Set the node status

Parameters ​

status ​

NodeStatus

New status

emitEvent? ​

boolean

Whether to emit a status change event

Returns ​

void

Inherited from ​

BaseNodeCompositional.setStatus


setUI() ​

setUI(ui, emitEvent?): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1015

Update the node's UI metadata

Parameters ​

ui ​

NodeUIMetadata

New UI metadata

emitEvent? ​

boolean

Whether to emit a UI change event

Returns ​

void

Inherited from ​

BaseNodeCompositional.setUI


setVersion() ​

setVersion(version): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1046

Set the node version

Parameters ​

version ​

number

The new version

Returns ​

void

Inherited from ​

BaseNodeCompositional.setVersion


shouldExecute() ​

shouldExecute(context): boolean

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1108

Determine if node should execute based on flow ports

Parameters ​

context ​

ExecutionContext

Returns ​

boolean

Inherited from ​

BaseNodeCompositional.shouldExecute


startBatchUpdate() ​

startBatchUpdate(): void

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:662

Start collecting port updates without emitting events immediately Used for batch operations where multiple ports are updated

Returns ​

void

Inherited from ​

BaseNodeCompositional.startBatchUpdate


updateArrayItemConfig() ​

updateArrayItemConfig(arrayPort): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:917

Parameters ​

arrayPort ​

IPort

Returns ​

Promise<void>

Deprecated ​

Array item config updates should be handled via UpdateConfigOperation

Inherited from ​

BaseNodeCompositional.updateArrayItemConfig


updatePort() ​

updatePort(port, eventContext?): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:435

Update a port and emit a port update event This is a critical method that triggers port-related events

Parameters ​

port ​

IPort

The port to update

eventContext? ​

EventContext

Optional event context for additional metadata

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.updatePort


updatePorts() ​

updatePorts(ports, eventContext?): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:445

Update multiple ports at once This is useful for batch updates

Parameters ​

ports ​

IPort<IPortConfig>[]

Array of ports to update

eventContext? ​

EventContext

Optional event context for additional metadata

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.updatePorts


updatePortsAfterExecution() ​

updatePortsAfterExecution(success, errorMessage?): Promise<void>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:1112

Update flow ports after execution

Parameters ​

success ​

boolean

errorMessage? ​

string

Returns ​

Promise<void>

Inherited from ​

BaseNodeCompositional.updatePortsAfterExecution


validate() ​

validate(): Promise<NodeValidationResult>

Defined in: packages/chaingraph-types/src/node/base-node-compositional.ts:289

Validate the node configuration

Returns ​

Promise<NodeValidationResult>

A promise resolving to the validation result

Inherited from ​

BaseNodeCompositional.validate

Licensed under BUSL-1.1