Documentation updates for node-red and runtime modules

This commit is contained in:
Nick O'Leary
2018-11-30 23:01:09 +00:00
parent bc02c9573c
commit 0b5e4f2dd7
19 changed files with 256 additions and 190 deletions

View File

@@ -15,7 +15,8 @@
**/
/**
* @namespace RED.comms
* This is the comms subsystem of the runtime.
* @mixin @node-red/runtime_comms
*/
/**
@@ -89,7 +90,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {CommsConnection} opts.client - the client connection
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
addConnection: function(opts) {
connections.push(opts.client);
@@ -102,7 +103,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {CommsConnection} opts.client - the client connection
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
removeConnection: function(opts) {
for (var i=0;i<connections.length;i++) {
@@ -123,7 +124,7 @@ var api = module.exports = {
* @param {CommsConnection} opts.client - the client connection
* @param {String} opts.topic - the topic to subscribe to
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
subscribe: function(opts) {
var re = new RegExp("^"+opts.topic.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
@@ -142,7 +143,7 @@ var api = module.exports = {
* @param {CommsConnection} opts.client - the client connection
* @param {String} opts.topic - the topic to unsubscribe from
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
unsubscribe: function(opts) {}
};

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.context
* @mixin @node-red/runtime_context
*/
var runtime;
@@ -69,7 +69,7 @@ var api = module.exports = {
* @param {String} opts.key - the context key
* @return {Promise} - the node information
* @memberof RED.context
* @memberof @node-red/runtime_context
*/
getValue: function(opts) {
return new Promise(function(resolve,reject) {
@@ -163,7 +163,7 @@ var api = module.exports = {
* @param {String} opts.key - the context key
* @return {Promise} - the node information
* @memberof RED.context
* @memberof @node-red/runtime_context
*/
delete: function(opts) {
return new Promise(function(resolve,reject) {

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.flows
* @mixin @node-red/runtime_flows
*/
/**
@@ -44,7 +44,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Flows>} - the active flow configuration
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
getFlows: function(opts) {
return new Promise(function(resolve,reject) {
@@ -57,7 +57,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Flows>} - the active flow configuration
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
setFlows: function(opts) {
return new Promise(function(resolve,reject) {
@@ -99,7 +99,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {Object} opts.flow - the flow to add
* @return {Promise<String>} - the id of the added flow
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
addFlow: function(opts) {
return new Promise(function(resolve,reject) {
@@ -123,7 +123,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {Object} opts.id - the id of the flow to retrieve
* @return {Promise<Flow>} - the active flow configuration
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
getFlow: function(opts) {
return new Promise(function (resolve,reject) {
@@ -148,7 +148,7 @@ var api = module.exports = {
* @param {Object} opts.id - the id of the flow to update
* @param {Object} opts.flow - the flow configuration
* @return {Promise<String>} - the id of the updated flow
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
updateFlow: function(opts) {
return new Promise(function (resolve,reject) {
@@ -185,7 +185,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {Object} opts.id - the id of the flow to delete
* @return {Promise} - resolves if successful
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
deleteFlow: function(opts) {
return new Promise(function (resolve,reject) {
@@ -222,7 +222,7 @@ var api = module.exports = {
* @param {String} opts.type - the node type to return the credential information for
* @param {String} opts.id - the node id
* @return {Promise<Object>} - the safe credentials
* @memberof RED.flows
* @memberof @node-red/runtime_flows
*/
getNodeCredentials: function(opts) {
return new Promise(function(resolve,reject) {

View File

@@ -17,13 +17,7 @@
var runtime;
/**
* This module provides the core runtime component of Node-RED.
* It does *not* include the Node-RED editor. All interaction with
* this module is done using the api provided.
*
* @namespace RED
*/
var api = module.exports = {
init: function(_runtime) {
runtime = _runtime;
@@ -44,31 +38,10 @@ var api = module.exports = {
projects: require("./projects"),
context: require("./context"),
/**
* Returns whether the runtime is started
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Boolean>} - whether the runtime is started
* @memberof RED
*/
isStarted: function(opts) {
return Promise.resolve(runtime.isStarted());
},
/**
* Returns version number of the runtime
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<String>} - the runtime version number
* @memberof RED
*/
version: function(opts) {
return Promise.resolve(runtime.version());
}
}
/**
* A user accessing the API
* @typedef User
* @type {object}
*/

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.library
* @mixin @node-red/runtime_library
*/
var runtime;
@@ -32,7 +32,7 @@ var api = module.exports = {
* @param {String} opts.type - the type of entry
* @param {String} opts.path - the path of the entry
* @return {Promise<String|Object>} - resolves when complete
* @memberof RED.library
* @memberof @node-red/runtime_library
*/
getEntry: function(opts) {
return new Promise(function(resolve,reject) {
@@ -71,7 +71,7 @@ var api = module.exports = {
* @param {Object} opts.meta - any meta data associated with the entry
* @param {String} opts.body - the body of the entry
* @return {Promise} - resolves when complete
* @memberof RED.library
* @memberof @node-red/runtime_library
*/
saveEntry: function(opts) {
return new Promise(function(resolve,reject) {
@@ -98,7 +98,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.type - the type of entry
* @return {Promise<Object>} - the entry listing
* @memberof RED.library
* @memberof @node-red/runtime_library
*/
getEntries: function(opts) {
return new Promise(function(resolve,reject) {

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.nodes
* @mixin @node-red/runtime_nodes
*/
var fs = require("fs");
@@ -49,7 +49,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the node set to return
* @return {Promise<NodeInfo>} - the node information
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getNodeInfo: function(opts) {
return new Promise(function(resolve,reject) {
@@ -74,7 +74,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<NodeList>} - the list of node modules
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getNodeList: function(opts) {
return new Promise(function(resolve,reject) {
@@ -90,7 +90,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the node set to return
* @param {String} opts.lang - the locale language to return
* @return {Promise<String>} - the node html content
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getNodeConfig: function(opts) {
return new Promise(function(resolve,reject) {
@@ -115,7 +115,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.lang - the locale language to return
* @return {Promise<String>} - the node html content
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getNodeConfigs: function(opts) {
return new Promise(function(resolve,reject) {
@@ -130,7 +130,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.module - the id of the module to return
* @return {Promise<ModuleInfo>} - the node module info
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getModuleInfo: function(opts) {
return new Promise(function(resolve,reject) {
@@ -155,7 +155,7 @@ var api = module.exports = {
* @param {String} opts.module - the id of the module to install
* @param {String} opts.version - (optional) the version of the module to install
* @return {Promise<ModuleInfo>} - the node module info
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
addModule: function(opts) {
return new Promise(function(resolve,reject) {
@@ -210,7 +210,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.module - the id of the module to remove
* @return {Promise} - resolves when complete
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
removeModule: function(opts) {
return new Promise(function(resolve,reject) {
@@ -253,7 +253,7 @@ var api = module.exports = {
* @param {String} opts.module - the id of the module to enable or disable
* @param {String} opts.enabled - whether the module should be enabled or disabled
* @return {Promise<ModuleInfo>} - the module info object
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
setModuleState: function(opts) {
var mod = opts.module;
@@ -301,7 +301,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the node-set to enable or disable
* @param {String} opts.enabled - whether the module should be enabled or disabled
* @return {Promise<ModuleInfo>} - the module info object
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
setNodeSetState: function(opts) {
return new Promise(function(resolve,reject) {
@@ -348,7 +348,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {User} opts.lang - the i18n language to return. If not set, uses runtime default (en-US)
* @return {Promise<Object>} - the message catalogs
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getModuleCatalogs: function(opts) {
return new Promise(function(resolve,reject) {
@@ -377,7 +377,7 @@ var api = module.exports = {
* @param {User} opts.module - the module
* @param {User} opts.lang - the i18n language to return. If not set, uses runtime default (en-US)
* @return {Promise<Object>} - the message catalog
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getModuleCatalog: function(opts) {
return new Promise(function(resolve,reject) {
@@ -398,7 +398,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<IconList>} - the list of all icons
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getIconList: function(opts) {
return new Promise(function(resolve,reject) {
@@ -414,7 +414,7 @@ var api = module.exports = {
* @param {String} opts.module - the id of the module requesting the icon
* @param {String} opts.icon - the name of the icon
* @return {Promise<Buffer>} - the icon file as a Buffer or null if no icon available
* @memberof RED.nodes
* @memberof @node-red/runtime_nodes
*/
getIcon: function(opts) {
return new Promise(function(resolve,reject) {

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.projects
* @mixin @node-red/runtime_projects
*/
var runtime;
@@ -33,7 +33,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
listProjects: function(opts) {
return runtime.storage.projects.listProjects(opts.user).then(function(list) {
@@ -57,7 +57,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {Object} opts.project - the project information
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
createProject: function(opts) {
return runtime.storage.projects.createProject(opts.user, opts.project)
@@ -70,7 +70,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project to initialise
* @param {Object} opts.project - the project information
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
initialiseProject: function(opts) {
// Initialised set when creating default files for an empty repo
@@ -82,7 +82,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - the active project
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getActiveProject: function(opts) {
return Promise.resolve(runtime.storage.projects.getActiveProject(opts.user));
@@ -94,7 +94,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project to activate
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
setActiveProject: function(opts) {
var currentProject = runtime.storage.projects.getActiveProject(opts.user);
@@ -111,7 +111,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project to get
* @return {Promise<Object>} - the project metadata
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getProject: function(opts) {
return runtime.storage.projects.getProject(opts.user, opts.id)
@@ -124,7 +124,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project to update
* @param {Object} opts.project - the project information
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
updateProject: function(opts) {
return runtime.storage.projects.updateProject(opts.user, opts.id, opts.project);
@@ -136,7 +136,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project to update
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
deleteProject: function(opts) {
return runtime.storage.projects.deleteProject(opts.user, opts.id);
@@ -149,7 +149,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {Boolean} opts.remote - whether to include status of remote repos
* @return {Promise<Object>} - the project status
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getStatus: function(opts) {
return runtime.storage.projects.getStatus(opts.user, opts.id, opts.remote)
@@ -162,7 +162,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {Boolean} opts.remote - whether to return remote branches (true) or local (false)
* @return {Promise<Object>} - a list of the local branches
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getBranches: function(opts) {
return runtime.storage.projects.getBranches(opts.user, opts.id, opts.remote);
@@ -175,7 +175,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.branch - the name of the branch
* @return {Promise<Object>} - the status of the branch
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getBranchStatus: function(opts) {
return runtime.storage.projects.getBranchStatus(opts.user, opts.id, opts.branch);
@@ -189,7 +189,7 @@ var api = module.exports = {
* @param {String} opts.branch - the name of the branch
* @param {Boolean} opts.create - whether to create the branch if it doesn't exist
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
setBranch: function(opts) {
return runtime.storage.projects.setBranch(opts.user, opts.id, opts.branch, opts.create)
@@ -203,7 +203,7 @@ var api = module.exports = {
* @param {String} opts.branch - the name of the branch
* @param {Boolean} opts.force - whether to force delete
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
deleteBranch: function(opts) {
return runtime.storage.projects.deleteBranch(opts.user, opts.id, opts.branch, false, opts.force);
@@ -216,7 +216,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.message - the message to associate with the commit
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
commit: function(opts) {
return runtime.storage.projects.commit(opts.user, opts.id,{message: opts.message});
@@ -229,7 +229,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.sha - the sha of the commit to return
* @return {Promise<Object>} - the commit details
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getCommit: function(opts) {
return runtime.storage.projects.getCommit(opts.user, opts.id, opts.sha);
@@ -243,7 +243,7 @@ var api = module.exports = {
* @param {String} opts.limit - limit how many to return
* @param {String} opts.before - id of the commit to work back from
* @return {Promise<Array>} - an array of commits
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getCommits: function(opts) {
return runtime.storage.projects.getCommits(opts.user, opts.id, {
@@ -258,7 +258,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
abortMerge: function(opts) {
return runtime.storage.projects.abortMerge(opts.user, opts.id);
@@ -272,7 +272,7 @@ var api = module.exports = {
* @param {String} opts.path - the path of the file being merged
* @param {String} opts.resolutions - how to resolve the merge conflict
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
resolveMerge: function(opts) {
return runtime.storage.projects.resolveMerge(opts.user, opts.id, opts.path, opts.resolution);
@@ -284,7 +284,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project
* @return {Promise<Object>} - the file listing
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getFiles: function(opts) {
return runtime.storage.projects.getFiles(opts.user, opts.id);
@@ -298,7 +298,7 @@ var api = module.exports = {
* @param {String} opts.path - the path of the file
* @param {String} opts.tree - the version control tree to use
* @return {Promise<String>} - the content of the file
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getFile: function(opts) {
return runtime.storage.projects.getFile(opts.user, opts.id,opts.path,opts.tree);
@@ -311,7 +311,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String|Array} opts.path - the path of the file, or an array of paths
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
stageFile: function(opts) {
return runtime.storage.projects.stageFile(opts.user, opts.id, opts.path);
@@ -324,7 +324,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.path - the path of the file. If not set, all staged files are unstaged
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
unstageFile: function(opts) {
return runtime.storage.projects.unstageFile(opts.user, opts.id, opts.path);
@@ -337,7 +337,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.path - the path of the file
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
revertFile: function(opts) {
return runtime.storage.projects.revertFile(opts.user, opts.id,opts.path)
@@ -351,7 +351,7 @@ var api = module.exports = {
* @param {String} opts.path - the path of the file
* @param {String} opts.type - the type of diff
* @return {Promise<Object>} - the requested diff
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getFileDiff: function(opts) {
return runtime.storage.projects.getFileDiff(opts.user, opts.id, opts.path, opts.type);
@@ -363,7 +363,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project
* @return {Promise<Object>} - a list of project remotes
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
getRemotes: function(opts) {
return runtime.storage.projects.getRemotes(opts.user, opts.id);
@@ -379,7 +379,7 @@ var api = module.exports = {
* @param {String} opts.remote.name - the name of the remote
* @param {String} opts.remote.url - the url of the remote
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
addRemote: function(opts) {
return runtime.storage.projects.addRemote(opts.user, opts.id, opts.remote)
@@ -392,7 +392,7 @@ var api = module.exports = {
* @param {String} opts.id - the id of the project
* @param {String} opts.remote - the name of the remote
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
removeRemote: function(opts) {
return runtime.storage.projects.removeRemote(opts.user, opts.id, opts.remote);
@@ -406,7 +406,7 @@ var api = module.exports = {
* @param {Object} opts.remote - the remote metadata
* @param {String} opts.remote.name - the name of the remote
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
updateRemote: function(opts) {
return runtime.storage.projects.updateRemote(opts.user, opts.id, opts.remote.name, opts.remote)
@@ -417,7 +417,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
pull: function(opts) {
return runtime.storage.projects.pull(opts.user, opts.id, opts.remote, opts.track, opts.allowUnrelatedHistories);
@@ -431,7 +431,7 @@ var api = module.exports = {
* @param {String} opts.remote - the name of the remote
* @param {String} opts.track - whether to set the remote as the upstream
* @return {Promise<Object>} - resolves when complete
* @memberof RED.projects
* @memberof @node-red/runtime_projects
*/
push: function(opts) {
return runtime.storage.projects.push(opts.user, opts.id, opts.remote, opts.track);

View File

@@ -15,7 +15,7 @@
**/
/**
* @namespace RED.settings
* @mixin @node-red/runtime_settings
*/
var util = require("util");
@@ -61,7 +61,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - the runtime settings
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
getRuntimeSettings: function(opts) {
return new Promise(function(resolve,reject) {
@@ -126,7 +126,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - the user settings
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
getUserSettings: function(opts) {
var username;
@@ -144,7 +144,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {Object} opts.settings - the updates to the user settings
* @return {Promise<Object>} - the user settings
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
updateUserSettings: function(opts) {
var username;
@@ -179,7 +179,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @return {Promise<Object>} - the user's ssh keys
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
getUserKeys: function(opts) {
return new Promise(function(resolve,reject) {
@@ -199,7 +199,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {User} opts.id - the id of the key to return
* @return {Promise<String>} - the user's ssh public key
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
getUserKey: function(opts) {
return new Promise(function(resolve,reject) {
@@ -230,7 +230,7 @@ var api = module.exports = {
* @param {User} opts.comment - (option) a comment to associate with the key pair
* @param {User} opts.size - (optional) the size of the key. Default: 2048
* @return {Promise<String>} - the id of the generated key
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
generateUserKey: function(opts) {
return new Promise(function(resolve,reject) {
@@ -250,7 +250,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {User} opts.id - the id of the key to delete
* @return {Promise} - resolves when deleted
* @memberof RED.settings
* @memberof @node-red/runtime_settings
*/
removeUserKey: function(opts) {
return new Promise(function(resolve,reject) {