Class: Commands

Commands()

Utility class that implements the commands exposed by the CLI.

Constructor

new Commands()

Source:

Methods

(async, static) compile(target, ctoSystemFile, ctoFiles, output)

Compile the model for a given target

Parameters:
Name Type Description
target string

the target of the code to compile

ctoSystemFile string

the system model file

ctoFiles Array.<string>

the CTO files to convert to code

output string

the output directory

Source:

(async, static) get(ctoSystemFile, ctoFiles, output)

Fetches all external for a set of models dependencies and
saves all the models to a target directory

Parameters:
Name Type Description
ctoSystemFile string

the system model

ctoFiles Array.<string>

the CTO files (can be local file paths or URLs)

output string

the output directory

Source:

(static) setDefaultFileArg(argv, argName, argDefaultName, argDefaultFun, argDefaultValue) → {object}

Set a default for a file argument

Parameters:
Name Type Description
argv object

the inbound argument values object

argName string

the argument name

argDefaultName string

the argument default name

argDefaultFun function

how to compute the argument default

argDefaultValue object

an optional default value if all else fails

Source:
Returns:

a modified argument object

Type
object

(async, static) validate(sample, ctoSystemFile, ctoFiles) → {string}

Validate a sample JSON against the model

Parameters:
Name Type Description
sample string

the sample to validate

ctoSystemFile string

the system model file

ctoFiles Array.<string>

the CTO files to convert to code

Source:
Returns:

serialized form of the validated JSON

Type
string

(static) validateValidateArgs(argv) → {object}

Set default params before we parse a sample text using a template

Parameters:
Name Type Description
argv object

the inbound argument values object

Source:
Returns:

a modfied argument object

Type
object