@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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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)

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

req Object

the request to log (optional)

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

remote String

the remote to pull

track Boolean

whether to track this remote

allowUnrelatedHistories Boolean
req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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

req Object

the request to log (optional)

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