Skip to main content

EDK

Create, manage, build and deploy ELARA project's programmatically using the @elaraai/edk typescript libraries.

example

 import * as edk from '@elaraai/edk' // create a simple application to create a project, add a datasource, build and deploy const project_dir = 'path_to_workspace' async function run() {     // create a project     let project_config = await edk.init({          name: 'A project',          dir: project_dir      })      // add a deployment     project_config = edk.addDeployment({         dir: project_dir,         server: 'https://server_url',         name: 'test',         config: project_config     })      // add a datasource to the project     project_config = edk.addRangeDataSource({         name: "Datasource",         dir: project_dir,         def_dir: 'src/sources',         config: project_config,         start: 1.5,         stop: 1000,         step: 2.3     });      // build the schema     let build = edk.buildSchema({          dir: project_dir,          config: project_config      });     if(build === false) {         //...     }      // deploy the schema     let deploy = await edk.deploySchema({          dir: project_dir,          config: project_config,          deployment: 'test'      });     if(deploy === false) {         //...     }}
run()

Admin#

EnvironmentArguments#

Ƭ EnvironmentArguments: Object

Defines the arguments for addEnvironment command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe environment variable name
overwritebooleantrue if the environment should be overwritten on deployment

UserArguments#

Ƭ UserArguments: Object

Defines the arguments for addUser command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
emailstringthe user's email
gen_dirstringthe relative dir path for the generated file
namestringthe user's name

addEnvironment#

addEnvironment(args): ELARAConfig | null

Create a new {@link EnvironmentDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsEnvironmentArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addUser#

addUser(args): ELARAConfig | null

Create a new {@link UserDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsUserArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

Analytics#

ViewArguments#

Ƭ ViewArguments: Object

Defines the arguments for addView command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name

addView#

addView(args): ELARAConfig | null

Create a new {@link ViewDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsViewArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

Application#

ApplicationArguments#

Ƭ ApplicationArguments: Object

Defines the arguments for addApplication command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe application name

PageArguments#

Ƭ PageArguments: Object

Defines the arguments for the addPanelPage and addUserPage commands.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name

VisualArguments#

Ƭ VisualArguments: Object

Defines the arguments for the addVisual and {@link addUserVisual} commands.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
typeVisualTypethe visual type to create

addApplication#

addApplication(args): ELARAConfig | null

Create a new {@link ApplicationDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsApplicationArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addPanelPage#

addPanelPage(args): ELARAConfig | null

Create a new {@link PanelPageDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsPageArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addUserPage#

addUserPage(args): ELARAConfig | null

Create a new {@link UserPageDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsPageArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addVisual#

addVisual(args): ELARAConfig | null

Create a new {@link VisualDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsVisualArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

DataSource#

ArrayDataSourceArguments#

Ƭ ArrayDataSourceArguments: Object

Defines the arguments for addArrayDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name

ClockDataSourceArguments#

Ƭ ClockDataSourceArguments: Object

Defines the arguments for addClockDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
future_cyclesnumberthe number of cycles in the future to include in the output
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
past_cyclesnumberthe number of cycles in the past to include in the output
periodnumberthe time period in units between rows
unitTimeUnitthe unit of time for each row

CsvDataSourceArguments#

Ƭ CsvDataSourceArguments: Object

Defines the arguments for addCsvDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
uriURIString<"file://" | "ftp://" | "sftp://">the ftp, sftp or file uri

ExcelDataSourceArguments#

Ƭ ExcelDataSourceArguments: Object

Defines the arguments for addExcelDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
uriURIString<"file://" | "ftp://" | "sftp://">the ftp, sftp or file uri

JsonDataSourceArguments#

Ƭ JsonDataSourceArguments: Object

Defines the arguments for addJsonDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
uriURIString<"file://" | "ftp://" | "sftp://">the ftp, sftp or file uri

RangeDataSourceArguments#

Ƭ RangeDataSourceArguments: Object

Defines the arguments for addRangeDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
startnumberthe first number in the range
stepnumberthe step size for each {@link Row}
stopnumberthe last number in the range

RestApiDataSourceArguments#

Ƭ RestApiDataSourceArguments: Object

Defines the arguments for addRestApiDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name

SqlChangeTrackingDataSourceArguments#

Ƭ SqlChangeTrackingDataSourceArguments: Object

Defines the arguments for addSqlChangeTrackingDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
initializestringthe string for initialize stored procedure name
namestringthe entity name
passwordstringthe string for the password
tablesstring[]the strings for table names
updatestringthe string for update stored procedure name
uriURIString``"mssql://"``\the mssql uri
usernamestringthe string for the username

SqlDataSourceArguments#

Ƭ SqlDataSourceArguments: Object

Defines the arguments for addSqlDataSource command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name
passwordstringthe string for the password
uriURIString``"mssql://"``\the mssql uri
usernamestringthe string for the username

addArrayDataSource#

addArrayDataSource(args): ELARAConfig | null

Create a new {@link ArrayDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsArrayDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addClockDataSource#

addClockDataSource(args): ELARAConfig | null

Create a new {@link ClockDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsClockDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addCsvDataSource#

addCsvDataSource(args): ELARAConfig | null

Create a new {@link CsvDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsCsvDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addExcelDataSource#

addExcelDataSource(args): ELARAConfig | null

Create a new {@link ExcelDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsExcelDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addJsonDataSource#

addJsonDataSource(args): ELARAConfig | null

Create a new {@link JsonDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsJsonDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addRangeDataSource#

addRangeDataSource(args): ELARAConfig | null

Create a new {@link RangeDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsRangeDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addRestApiDataSource#

addRestApiDataSource(args): ELARAConfig | null

Create a new {@link RestApiDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsRestApiDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addSqlChangeTrackingDataSource#

addSqlChangeTrackingDataSource(args): Promise<ELARAConfig | null>

Create a new {@link SqlChangeTrackingDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsSqlChangeTrackingDataSourceArguments

Returns#

Promise<ELARAConfig | null>

the updated project {@link ELARAConfig}.


addSqlDataSource#

addSqlDataSource(args): ELARAConfig | null

Create a new {@link SqlDataSourceDefinition}.

remarks This command will create the entity if it doesnt exist already, otherwise will fail if a matching directory already exists.

Parameters#

NameType
argsSqlDataSourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

Pipeline#

PipelineArguments#

Ƭ PipelineArguments: Object

Defines the arguments for addPipeline command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe entity name

addPipeline#

addPipeline(args): ELARAConfig | null

Create a new {@link PipelineDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsPipelineArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

Plugin#

PluginArguments#

Ƭ PluginArguments: Object

Defines the arguments for addPlugin command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe plugin name

addPlugin#

addPlugin(args): ELARAConfig | null

Create a new {@link ELARASchema}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsPluginArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.

Solution#

AssetSchemaArguments#

Ƭ AssetSchemaArguments: Object

Defines the arguments for {@link getAssetSchema} command.

Type declaration#

NameTypeDescription
assetstring | nullthe asset to remove
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path

BuildArguments#

Ƭ BuildArguments: Object

Defines the arguments for buildSchema command.

Type declaration#

NameTypeDescription
cleanboolean | nullset to true if the build should commence with a clean
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path

DeployArguments#

Ƭ DeployArguments: Object

Defines the arguments for deploySchema command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
deploymentstringthe deployment asset name to deploy
dirstringthe ELARA solution directory absolute or relative path
flush?FlushType[]flush the specified services
overwrite?booleanset to true if all environments should be overwritten
restart?booleanset to true if a reset of all service should occur
verbose?booleanset to true if the deployment should show verbose logging

DeploymentArguments#

Ƭ DeploymentArguments: Object

Defines the arguments for addDeployment command.

Type declaration#

NameTypeDescription
application?stringthe application to include in the solution
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path
iterations_gpbigint | undefinedthe number iterations when training a Guassian Process
iterations_utility_estbigint | undefinedthe number iterations to train the utility rate estimator
iterations_xgb_optbigint | undefinedthe number of iterations when training with XGBoost
loglevel?LogLevelthe log level to apply to the deployment
namestringthe deployment name
optimization_iterationsbigint | undefinedthe number of iterations optimization should use
optimization_randomnessnumber | undefinedthe scale of randomness optimization should allow when exploring the cost surface (in units of the total objective function)
optimization_serial_iterationsbigint | undefinedthe number of serial mini-iterations optimization should use per iteration
optimization_trajectories?bigintthe number of simulation trajectories for optimizations for the deployment
samples?bigintthe number of training samples for the deployment
sensitivity_trajectories?bigintthe number of simulation trajectories for sensitivity calculations for the deployment
serverstringthe ELARA server url
trajectories?bigintthe number of simulation trajectories for the deployment
warn?booleanset to true if the cli should prompt before deployment

FlushType#

Ƭ FlushType: "all" | "datasource" | "training" | "admin" | "envs" | "optimization" | "data"

A deployment FlushType.

param the desired {@link }.

remarks Deploying a {@link ELARASchema} requires that a deployment existing in the configuration, and the EDK_CLIENT_ID and EDK_CLIENT_SECRET system environment variables have been set with a valid ELARA server key value pair.


InitArguments#

Ƭ InitArguments: Object

Defines the arguments for the init command.

Type declaration#

NameTypeDescription
dirstringthe ELARA solution directory absolute or relative path
namestringthe ELARA solution name
versionstringthe EDK version

LinkedArguments#

Ƭ LinkedArguments: Object

Defines the arguments for linkedAssets command.

Type declaration#

NameTypeDescription
assetstringthe asset to find the dependancies/dependants for
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path

RemoveArguments#

Ƭ RemoveArguments: Object

Defines the arguments for removeAsset command.

Type declaration#

NameTypeDescription
allboolean | nullset to true if a all assets should be removed
assetstring | nullthe asset to remove
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path

TokenArguments#

Ƭ TokenArguments: Object

Defines the arguments for getToken command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
deploymentstringthe deployment asset name to deploy
dirstringthe ELARA solution directory absolute or relative path

UpdateArguments#

Ƭ UpdateArguments: Object

Defines the arguments for updateAssets command.

Type declaration#

NameTypeDescription
asset?string | nullthe name of an asset to update
cleanboolean | nullset to true if a clean should occur
configELARAConfigthe current {@link ELARAConfig}
dirstringthe ELARA solution directory absolute or relative path
type?string | nullthe type of assets to update

addDeployment#

addDeployment(args): ELARAConfig | null

Create a deployment asset in the {@link ELARAConfig}.

Parameters#

NameType
argsDeploymentArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


assetSchema#

assetSchema(args): ELARASchema | null

Get an asset schema from a solution.

Parameters#

NameType
argsAssetSchemaArguments

Returns#

ELARASchema | null

the related asset {@link ELARASchema}.


buildSchema#

buildSchema(args): boolean

Build the solution {@link ELARASchema}.

Parameters#

NameType
argsBuildArguments

Returns#

boolean

true if the update was successful.


config#

config(dir): Promise<ELARAConfig | null>

Load the config for an ELARA solution.

Parameters#

NameType
dirstring

Returns#

Promise<ELARAConfig | null>

the {@link ELARAConfig} for the project.


deploySchema#

deploySchema(args): Promise<boolean>

Deploy the solution {@link ELARASchema}.

truen

remarks Deploying a {@link ELARASchema} requires that a deployment existing in the configuration, and the EDK_CLIENT_ID and EDK_CLIENT_SECRET system environment variables have been set with a valid ELARA server key value pair.

Parameters#

NameType
argsDeployArguments

Returns#

Promise<boolean>


getToken#

getToken(args): Promise<string | null>

Get an authentication token {@link ELARASchema}.

truen

remarks Getting a token requires that a deployment existing in the configuration, and the EDK_CLIENT_ID and EDK_CLIENT_SECRET system environment variables have been set with a valid ELARA server key value pair.

Parameters#

NameType
argsTokenArguments

Returns#

Promise<string | null>


init#

init(args): Promise<ELARAConfig | null>

Initialise a new ELARA solution and generate base artefacts.

remarks This command will create the solution directory if it doesnt exist already, otherwise will fail if an existing solution exists in the directory.

Parameters#

NameType
argsInitArguments

Returns#

Promise<ELARAConfig | null>

the {@link ELARAConfig} for the new project.


linkedAssets#

linkedAssets(args): ELARAConfig | null

Find the linked assets in a solution.

Parameters#

NameType
argsLinkedArguments

Returns#

ELARAConfig | null

the project {@link ELARAConfig}.


removeAsset#

removeAsset(args): ELARAConfig | null

Remove an asset from a solution.

Parameters#

NameType
argsRemoveArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


updateAssets#

updateAssets(args): Promise<boolean>

Update the generated assets in a solution.

Parameters#

NameType
argsUpdateArguments

Returns#

Promise<boolean>

true if the update was successful.

Structure#

AgentArguments#

Ƭ AgentArguments: Object

Defines the arguments for addAgentStructure command.

Type declaration#

NameTypeDescription
conceptstringthe agent concept
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file

ProcessArguments#

Ƭ ProcessArguments: Object

Defines the arguments for addProcessStructure command.

Type declaration#

NameTypeDescription
conceptstringthe process concept
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file

ResourceArguments#

Ƭ ResourceArguments: Object

Defines the arguments for addResourceStructure command.

Type declaration#

NameTypeDescription
conceptstringthe resource concept
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file

ScenarioArguments#

Ƭ ScenarioArguments: Object

Defines the arguments for addScenario command.

Type declaration#

NameTypeDescription
configELARAConfigthe current {@link ELARAConfig}
def_dirstringthe relative dir path for the definition file
dirstringthe ELARA solution directory absolute or relative path
gen_dirstringthe relative dir path for the generated file
namestringthe scneario name

addAgentStructure#

addAgentStructure(args): ELARAConfig | null

Create a new {@link AgentDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsAgentArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addProcessStructure#

addProcessStructure(args): ELARAConfig | null

Create a new {@link ProcessDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsProcessArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addResourceStructure#

addResourceStructure(args): ELARAConfig | null

Create a new {@link ResourceDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsResourceArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.


addScenario#

addScenario(args): ELARAConfig | null

Create a new {@link ScenarionDefinition}.

remarks This command will edit the entity if it exists already, otherwise will fail if a matching datasource doesnt exist.

Parameters#

NameType
argsScenarioArguments

Returns#

ELARAConfig | null

the updated project {@link ELARAConfig}.