@node-red/runtime.projects

abortMerge(opts) → {Promise.<Object>}

Abort an in-progress merge

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

Returns:
Type:
Promise.<Object>
  • resolves when complete

addRemote(opts) → {Promise.<Object>}

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote Object

the remote metadata

Name Type Description
name String

the name of the remote

url String

the url of the remote

Returns:
Type:
Promise.<Object>
  • resolves when complete

commit(opts) → {Promise.<Object>}

Commits the current staged files

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

message String

the message to associate with the commit

Returns:
Type:
Promise.<Object>
  • resolves when complete

createProject(opts) → {Promise.<Object>}

Create a new project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

project Object

the project information

Returns:
Type:
Promise.<Object>
  • resolves when complete

deleteBranch(opts) → {Promise.<Object>}

Deletes a branch

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

branch String

the name of the branch

force Boolean

whether to force delete

Returns:
Type:
Promise.<Object>
  • resolves when complete

deleteProject(opts) → {Promise.<Object>}

Deletes a project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project to update

Returns:
Type:
Promise.<Object>
  • resolves when complete

getActiveProject(opts) → {Promise.<Object>}

Gets the active project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

Returns:
Type:
Promise.<Object>
  • the active project

getBranches(opts) → {Promise.<Object>}

Get a list of local branches

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote Boolean

whether to return remote branches (true) or local (false)

Returns:
Type:
Promise.<Object>
  • a list of the local branches

getBranchStatus(opts) → {Promise.<Object>}

Gets the status of a branch

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

branch String

the name of the branch

Returns:
Type:
Promise.<Object>
  • the status of the branch

getCommit(opts) → {Promise.<Object>}

Gets the details of a single commit

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

sha String

the sha of the commit to return

Returns:
Type:
Promise.<Object>
  • the commit details

getCommits(opts) → {Promise.<Array>}

Gets the commit history of the project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

limit String

limit how many to return

before String

id of the commit to work back from

Returns:
Type:
Promise.<Array>
  • an array of commits

getFile(opts) → {Promise.<String>}

Gets the contents of a file

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String

the path of the file

tree String

the version control tree to use

Returns:
Type:
Promise.<String>
  • the content of the file

getFileDiff(opts) → {Promise.<Object>}

Get the diff of a file

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String

the path of the file

type String

the type of diff

Returns:
Type:
Promise.<Object>
  • the requested diff

getFiles(opts) → {Promise.<Object>}

Gets a listing of the files in the project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

Returns:
Type:
Promise.<Object>
  • the file listing

getProject(opts) → {Promise.<Object>}

Gets a projects metadata

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project to get

Returns:
Type:
Promise.<Object>
  • the project metadata

getRemotes(opts) → {Promise.<Object>}

Gets a list of the project remotes

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

Returns:
Type:
Promise.<Object>
  • a list of project remotes

getStatus(opts) → {Promise.<Object>}

Gets current git status of a project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote Boolean

whether to include status of remote repos

Returns:
Type:
Promise.<Object>
  • the project status

initialiseProject(opts) → {Promise.<Object>}

Initialises an empty project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project to initialise

project Object

the project information

Returns:
Type:
Promise.<Object>
  • resolves when complete

listProjects(opts) → {Promise.<Object>}

List projects known to the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

Returns:
Type:
Promise.<Object>
  • resolves when complete

pull(opts) → {Promise.<Object>}

Pull changes from the remote

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

Returns:
Type:
Promise.<Object>
  • resolves when complete

push(opts) → {Promise.<Object>}

Push changes to a remote

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote String

the name of the remote

track String

whether to set the remote as the upstream

Returns:
Type:
Promise.<Object>
  • resolves when complete

removeRemote(opts) → {Promise.<Object>}

Remove a project remote

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote String

the name of the remote

Returns:
Type:
Promise.<Object>
  • resolves when complete

resolveMerge(opts) → {Promise.<Object>}

Resolves a merge conflict

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String

the path of the file being merged

resolutions String

how to resolve the merge conflict

Returns:
Type:
Promise.<Object>
  • resolves when complete

revertFile(opts) → {Promise.<Object>}

Reverts changes to a file back to its commited version

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String

the path of the file

Returns:
Type:
Promise.<Object>
  • resolves when complete

setActiveProject(opts) → {Promise.<Object>}

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project to activate

Returns:
Type:
Promise.<Object>
  • resolves when complete

setBranch(opts) → {Promise.<Object>}

Sets the current local branch

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

branch String

the name of the branch

create Boolean

whether to create the branch if it doesn't exist

Returns:
Type:
Promise.<Object>
  • resolves when complete

stageFile(opts) → {Promise.<Object>}

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String | Array

the path of the file, or an array of paths

Returns:
Type:
Promise.<Object>
  • resolves when complete

unstageFile(opts) → {Promise.<Object>}

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

path String

the path of the file. If not set, all staged files are unstaged

Returns:
Type:
Promise.<Object>
  • resolves when complete

updateProject(opts) → {Promise.<Object>}

Updates the metadata of an existing project

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project to update

project Object

the project information

Returns:
Type:
Promise.<Object>
  • resolves when complete

updateRemote(opts) → {Promise.<Object>}

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the project

remote Object

the remote metadata

Name Type Description
name String

the name of the remote

Returns:
Type:
Promise.<Object>
  • resolves when complete