Class: Core

Core

This module interfaces with a git repository to facilitate the persistence of SCXML files to be used in the fsm-engine module

Constructor

new Core()

Source:

Methods

(static) addInstance(machineName, versionKey) → {Promise}

Add a new instance to a version of a machine
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The instance key
Type
Promise

(static) addMachine(machineName, versionKey) → {Promise}

Seal a version of a machine
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
Type
Promise

(static) addMachine(name) → {Promise}

Add a new machine to the repository
Parameters:
Name Type Description
name String The name of the new machine
Source:
Returns:
Type
Promise

(static) addSnapshot(machineName, versionKey, instanceKey, info) → {Promise}

Add a new snapshot to an instance of a version of a machine
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
info Object The info Object
Source:
Returns:
The instance key
Type
Promise

(static) addVersion(machineName) → {Promise}

Add a new version to a machine
Parameters:
Name Type Description
machineName String The name of the machine
Source:
Returns:
The version key
Type
Promise

(static) getConfig() → {Object}

Retrieve the repository config.json file as a JavasScript Object
Source:
Returns:
The config Object
Type
Object

(static) getInstanceInfo(machineName, versionKey, instanceKey) → {Object}

Retrieve the instance's info.json file as a JavasScript Object
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
Source:
Returns:
The info Object
Type
Object

(static) getInstanceInfoRoute(machineName, versionKey, instanceKey) → {String}

Retrieve the instance's info.json path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
Source:
Returns:
The route
Type
String

(static) getInstanceRoute(machineName, versionKey, instanceKey) → {String}

Retrieve the instance's directory path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
Source:
Returns:
The route
Type
String

(static) getInstancesKeys(machineName, versionKey) → {Array}

Gets the keys of all of the instances of a version of the machine in the repository
Parameters:
Name Type Description
machineName String The name of the machine to get the instances's keys
versionKey String The key of the version to get the instances's keys
Source:
Returns:
An array with all the instance's keys of the the version
Type
Array

(static) getMachinesNames() → {Array}

Get the names of all of the machines in the repository
Source:
Returns:
An array with all the machine's names
Type
Array

(static) getManifest() → {Object}

Retrieve the repository manifest.json file as a JavasScript Object
Source:
Returns:
The manifest Object
Type
Object

(static) getRepositoryPath() → {String}

Retrieve the repository path
Source:
Returns:
The path to the repository
Type
String

(static) getSnapshotInfo(machineName, versionKey, instanceKey, snapshotKey) → {Object}

Retrieve the snapshot's info.json file as a JavasScript Object
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
snapshotKey String The key of the snapshot
Source:
Returns:
The info Object
Type
Object

(static) getSnapshotInfoRoute(machineName, versionKey, instanceKey, snapshotKey) → {String}

Retrieve the snapshot's info.json path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
snapshotKey String The key of the snapshot
Source:
Returns:
The route
Type
String

(static) getSnapshotRoute(machineName, versionKey, instanceKey, snapshotKey) → {String}

Retrieve the snapshot's directory path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
snapshotKey String The key of the snapshot
Source:
Returns:
The route
Type
String

(static) getSnapshotsKeys(machineName, versionKey, instanceKey) → {Array}

Gets the keys of all of the snapshots of the instance of a version of the machine in the repository
Parameters:
Name Type Description
machineName String The name of the machine to get the snapshots's keys
versionKey String The key of the version to get the snapshots's keys
instanceKey String The key of the instance to get the snapshot's keys
Source:
Returns:
An array with all the snapshot's keys of the instance
Type
Array

(static) getVersionInfo(machineName, versionKey) → {Object}

Retrieve the version info.json file as a JavasScript Object
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The info Object
Type
Object

(static) getVersionInfoRoute(machineName, versionKey) → {String}

Retrieve the version's info.json file path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The route
Type
String

(static) getVersionModelRoute(machineName, versionKey) → {String}

Retrieve the version's model.scxml file path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The route
Type
String

(static) getVersionRoute(machineName, versionKey) → {String}

Retrieve the version directory path
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The route
Type
String

(static) getVersionSCXML(machineName, versionKey) → {String}

Retrieve the version model.scxml file as a String
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
Source:
Returns:
The model
Type
String

(static) getVersionsKeys(machineName) → {Array}

Get the keys of all of the versions of machine in the repository
Parameters:
Name Type Description
machineName String The name of the machine to get the version's keys
Source:
Returns:
An array with all the version's keys of the machine
Type
Array

(static) init() → {Promise}

Initializes the repository connection
Source:
Returns:
Repository connection
Type
Promise

(static) initRemoteGitPlaintext(cloneURL, user, password) → {Promise}

Initializes the repository connection using ssh password
Parameters:
Name Type Description
cloneURL String The URL of the remote repository
user String username to use to authenticate.
password String password to use to authenticate.
Source:
Returns:
Repository connection
Type
Promise

(static) initRemoteGitSSH(cloneURL, publicKey, privateKey, passphrase) → {Promise}

Initializes the repository connection using ssh password
Parameters:
Name Type Description
cloneURL String The URL of the remote repository
publicKey String The public key of the credential.
privateKey String The private key of the credential.
passphrase String The passphrase of the credential.
Source:
Returns:
Repository connection
Type
Promise

(static) isSCXMLValid(model) → {Promise}

Validates SCXML markup as a string
Parameters:
Name Type Description
model String A string with the SCXML document to validate
Source:
Returns:
True if the SCXML is valid false otherwise
Type
Promise

(static) removeMachine(name) → {Promise}

Remove a machine from the repository
Parameters:
Name Type Description
name String The name of the machine
Source:
Returns:
Type
Promise

(static) setConfig(config, message) → {Promise}

Update the repository config.json file using a JavasScript Object
Parameters:
Name Type Description
config Object The config Object to save
message String If supplied it is used as the message for the commit
Source:
Returns:
Type
Promise

(static) setInstanceInfo(machineName, versionKey, instanceKey, info, message) → {Promise}

Update the instance's info.json file using a JavasScript Object
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
instanceKey String The key of the instance
info Object The info Object to save
message String If supplied it is used as the message for the commit
Source:
Returns:
Type
Promise

(static) setManifest(manifest, message) → {Promise}

Update the repository manifest.json file using a JavasScript Object
Parameters:
Name Type Description
manifest Object The manifest Object to save
message String If supplied it is used as the message for the commit
Source:
Returns:
Type
Promise

(static) setVersionInfo(machineName, versionKey, info, message) → {Promise}

Update the version info.json file using a JavasScript Object
Parameters:
Name Type Description
machineName String The name of the machine
versionKey String The key of the version
info Object The info Object to save
message String If supplied it is used as the message for the commit
Source:
Returns:
Type
Promise

(static) setVersionSCXML(model, machineName, versionKey, message) → {Promise}

Update the version model.scxml file using a String
Parameters:
Name Type Description
model String The model
machineName String The name of the machine
versionKey String The key of the version
message String If supplied it is used as the message for the commit
Source:
Returns:
Type
Promise