IAnalyticalBackend
The root of the Analytical Backend SPI.
export interface IAnalyticalBackend
Remarks
It allows configuration related to communication with the backend and access to analytical workspaces.
The analytical backend instance MUST be immutable. Changes to configuration of the backend MUST create a new instance to work with.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| Capabilities available on this backend. | ||
| Configuration used for communication with this backend. |
Methods
Method | Description |
|---|---|
Triggers authentication process against the backend. | |
Returns a service for interacting with the currently authenticated user. | |
Returns service that can be used to work with data sources. | |
Triggers deauthentication process against the backend. | |
Returns service that can be used to obtain license entitlements. | |
Returns service that can be used to load geo location assets. | |
Tests authentication against this backend. | |
Creates new instance of backend on the provided hostname. | |
Returns an organization available on the backend. | |
Returns a service that can be obtained to obtain organizations. | |
Sets authentication provider to be used when backend discovers current session is not authenticated. | |
Sets request correlation metadata that will be included in HTTP requests to the backend. If the IAnalyticalBackend instance already has correlation metadata set, the new metadata will be merged with the existing one. This method provides more flexibility than withTelemetry by allowing arbitrary key-value pairs to be sent. | |
Sets telemetry information that SHOULD be sent to backend to track component usage. | |
Returns an analytical workspace available on this backend. | |
Returns service that can be used to obtain available workspaces. |
Property details
IAnalyticalBackend.capabilitiesproperty
Capabilities available on this backend.
readonly capabilities: IBackendCapabilities;
IAnalyticalBackend.configproperty
Configuration used for communication with this backend.
readonly config: IAnalyticalBackendConfig;
Method details
IAnalyticalBackend.authenticate()method
Triggers authentication process against the backend.
authenticate(force?: boolean): Promise<IAuthenticatedPrincipal>;
Parameters
Parameter | Type | Description |
|---|---|---|
force | boolean | (Optional) indicates whether authentication should be forced = must always be done even if the current session is already authenticated; defaults to false |
Returns
Promise<IAuthenticatedPrincipal>
promise of authenticated principal, or rejection if authentication has failed.
Remarks
If the ‘force’ parameter is specified, then the method MUST always lead to a call to the authentication provider.
If the ‘force’ parameter is not specified, then the method MAY lead to a call to the authentication provider - if the backend lives in an already authenticated session, principal is returned. If the session is not authenticated, then the provider WILL BE called.
IAnalyticalBackend.currentUser()method
Returns a service for interacting with the currently authenticated user.
currentUser(): IUserService;
Returns
an instance that can be used to interact with the user
IAnalyticalBackend.dataSources()method
Returns service that can be used to work with data sources.
dataSources(): IDataSourcesService;
Returns
IAnalyticalBackend.deauthenticate()method
Triggers deauthentication process against the backend.
deauthenticate(returnTo?: string): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
returnTo | string | (Optional) url to redirect after successful relogin |
Returns
Promise<void>
promise of the completed process, or rejection if deauthentication failed.
IAnalyticalBackend.entitlements()method
Returns service that can be used to obtain license entitlements.
entitlements(): IEntitlements;
Returns
IAnalyticalBackend.geo()method
Returns service that can be used to load geo location assets.
geo(): IGeoService;
Returns
IAnalyticalBackend.isAuthenticated()method
Tests authentication against this backend.
isAuthenticated(): Promise<IAuthenticatedPrincipal | null>;
Returns
Promise<IAuthenticatedPrincipal | null>
promise of authenticated principal is returned if authenticated, null is returned if not authenticated.
Remarks
This requires network communication and is thus asynchronous. If the current backend (or session it lives in) is not authenticated, then this method MUST NOT call the authentication provider.
IAnalyticalBackend.onHostname()method
Creates new instance of backend on the provided hostname.
onHostname(hostname: string): IAnalyticalBackend;
Parameters
Parameter | Type | Description |
|---|---|---|
hostname | string | host[:port] |
Returns
new, unauthenticated instance
Remarks
It is valid NOT TO specify any hostname, in which case the analytical backend assumes it should communicate with the current origin.
IAnalyticalBackend.organization()method
Returns an organization available on the backend.
organization(organizationId: string): IOrganization;
Parameters
Parameter | Type | Description |
|---|---|---|
organizationId | string | unique ID of the organization |
Returns
IAnalyticalBackend.organizations()method
Returns a service that can be obtained to obtain organizations.
organizations(): IOrganizations;
Returns
IAnalyticalBackend.withAuthentication()method
Sets authentication provider to be used when backend discovers current session is not authenticated.
withAuthentication(provider: IAuthenticationProvider): IAnalyticalBackend;
Parameters
Parameter | Type | Description |
|---|---|---|
provider | authentication provider to use |
Returns
a new instance of backend, set up with the provider
IAnalyticalBackend.withCorrelation()method
Sets request correlation metadata that will be included in HTTP requests to the backend. If the IAnalyticalBackend instance already has correlation metadata set, the new metadata will be merged with the existing one. This method provides more flexibility than withTelemetry by allowing arbitrary key-value pairs to be sent.
withCorrelation(correlationMetadata: IRequestCorrelationMetadata): IAnalyticalBackend;
Parameters
Parameter | Type | Description |
|---|---|---|
correlationMetadata | key-value pairs to include as correlation metadata |
Returns
a new instance of backend configured with the merged correlation metadata
IAnalyticalBackend.withTelemetry()method
Sets telemetry information that SHOULD be sent to backend to track component usage.
withTelemetry(componentName: string, props: object): IAnalyticalBackend;
Parameters
Parameter | Type | Description |
|---|---|---|
componentName | string | name of component |
props | object | props |
Returns
a new instance of backend, set up with the provided telemetry
IAnalyticalBackend.workspace()method
Returns an analytical workspace available on this backend.
workspace(id: string): IAnalyticalWorkspace;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the workspace |
Returns
an instance that can be used to interact with the workspace
IAnalyticalBackend.workspaces()method
Returns service that can be used to obtain available workspaces.
workspaces(): IWorkspacesQueryFactory;
Returns