Skip to content

Environment

Environment

Abstract

Summary of the Environment class

Class Description

The class represents an eLegere environment, such as esi.oncloud.com. An environment is an instance of eLegere.

The environment class does not have methods to modify data on eLegere: it acts as an intermediary class to interface with eLegere and its applications. The getEnvironment and getEnvironmentFromToken functions initialize the Environment class. The user can employ the functions through either username and password or session token or domain id.

Note

The class requires the initialization through the elegere object.

An Example:

1
const myEnv = elegere.getEnvironment("https://esi.oncloud.elegere.com", "j.doe@vesenda.com", "SecretPassword")

Methods

getApplication Promise<Application>

1
getApplication(applicationId: string, domainId: string): Promise<Application>

The getApplication() method returns an initialized Application object from an application id and Domain id.

An Example:

1
const app = await environment.getApplication(context.ApplicationId, context.DomainId);
Parameters

applicationId

string Id identifying the application.

domainId

string Id identifying the domain. The application must belong to the specified domain.

Return Value

Returns a Promise for an Application object.

getOrganization Promise<Organization>

1
getOrganization(organizationName: string): Promise<Organization>

getOrganization takes an organization's name and returns an initialized Organization object.

An Example:

1
const organization = await environment.getOrganization("Vesenda")
Parameters

organizationName

string Represents the name identifying the organization.

Return

Returns a Promise for a Organization object.