此模块提供 Node-RED 的核心运行时组件。它不包括 Node-RED 编辑器。与此模块的所有交互都通过所提供的 API 完成。
流程
- addFlow( opts )
- deleteFlow( opts )
- getFlow( opts )
- getFlows( opts )
- getNodeCredentials( opts )
- setFlows( opts )
- updateFlow( opts )
节点
- addModule( opts )
- getIcon( opts )
- getIconList( opts )
- getModuleCatalog( opts )
- getModuleCatalogs( opts )
- getModuleInfo( opts )
- getModuleResource( opts )
- getNodeConfig( opts )
- getNodeConfigs( opts )
- getNodeInfo( opts )
- getNodeList( opts )
- removeModule( opts )
- setModuleState( opts )
- setNodeSetState( opts )
插件
- getPlugin( opts )
- getPluginCatalogs( opts )
- getPluginConfigs( opts )
- getPluginList( )
- getPluginsByType( opts )
项目
- abortMerge( opts )
- addRemote( opts )
- commit( opts )
- createProject( opts )
- deleteBranch( opts )
- deleteProject( opts )
- getActiveProject( opts )
- getBranches( opts )
- getBranchStatus( opts )
- getCommit( opts )
- getCommits( opts )
- getFile( opts )
- getFileDiff( opts )
- getFiles( opts )
- getProject( opts )
- getRemotes( opts )
- getStatus( opts )
- initialiseProject( opts )
- listProjects( opts )
- pull( opts )
- push( opts )
- removeRemote( opts )
- resolveMerge( opts )
- revertFile( opts )
- setActiveProject( opts )
- setBranch( opts )
- stageFile( opts )
- unstageFile( opts )
- updateProject( opts )
- updateRemote( opts )
设置
- generateUserKey( opts )
- getRuntimeSettings( opts )
- getUserKey( opts )
- getUserKeys( opts )
- getUserSettings( opts )
- removeUserKey( opts )
- updateUserSettings( opts )
init(settings, server, adminApi)
初始化运行时模块。
参数
名称 | 类型 | 描述 |
---|---|---|
设置 |
对象
|
运行时设置对象 |
服务器 |
HTTPServer
|
服务器使用的 HTTP 服务器实例 |
adminApi |
AdminAPI
|
@node-red/editor-api 的一个实例。TODO:这需要更好地抽象。 |
isStarted(opts) → {Promise.<Boolean>}
返回运行时是否已启动
参数
名称 | 类型 | 描述 | ||||||
---|---|---|---|---|---|---|---|---|
opts |
对象
|
|
返回
- 类型
-
Promise.<Boolean>
- 运行时是否已启动
start() → {Promise}
启动运行时。
返回
- 类型
-
Promise
- 当运行时启动时解析。这不意味着流将运行,因为它们是异步启动的。
stop() → {Promise}
停止运行时。
一旦调用,Node-RED 不应在 Node.JS 进程重新启动之前重新启动。
返回
- 类型
-
Promise
- 当运行时停止时解析。
version(opts) → {Promise.<String>}
返回运行时的版本号
参数
名称 | 类型 | 描述 | ||||||
---|---|---|---|---|---|---|---|---|
opts |
对象
|
|
返回
- 类型
-
Promise.<String>
- 运行时版本号