Skip to main content

foundation-comms

Home > @genesislcap/foundation-comms

foundation-comms package

Classes

Class

Description

AuthError

Represents an error that occurs during authentication.

CurrentUser

Represents the current user (i.e. the user that is currently logged in).

DatasourceDefaults

Default values for a DatasourceConfig

DefaultAuth

The default implementation for the Auth interface.

DefaultConnect

The default implementation for the Connect interface (WS-only).

DefaultConnectEvents

Default ConnectEvents implementation.

DefaultCredentialManager

The default implementation for the CredentialManager interface.

DefaultDatasource

The default implementation for the Datasource interface.

DefaultEntityDatasource

(ALPHA) Default EntityDatasource DI implementation.

DefaultFoundationAnalytics

The default implementation for the FoundationAnalytics interface.

DefaultGenesisResources

Default GenesisResources implementation.

DefaultHttp

The default implementation of the Http interface.

DefaultHttpConnect

The default implementation for the Connect interface (HTTP-only).

DefaultKVStorage

(ALPHA) The default implementation for the KVStorage interface.

DefaultMessageBuilder

Default MessageBuilder implementation.

DefaultMetaCache

The default implementation for the MetaCache interface.

DefaultNetworkMonitor

Default NetworkMonitor implementation.

DefaultSession

The default implementation for the Session interface.

DefaultSocket

Default Socket implementation.

DefaultSocketStatus

Default SocketStatus implementation.

GenesisResourcesMock

SocketMessageHandler

The Socket message handler definition.

SocketObservable

Observable that wraps a WebSocketSubject and provides an Observable interface for sending and receiving messages.

SocketSubject

Subject that wraps a WebSocketSubject and provides a Subject interface for sending and receiving messages.

Enumerations

Enumeration

Description

AuthType

The available ypes of authentication.

EventMessageType

Event Message types

FieldTypeEnum

Available types for a field metadata.

FoundationAnalyticsEventType

Analytics event types

KVEventMessageType

(ALPHA) KV Event Message types

KVMessageType

(ALPHA) KV Message types

MessageCode

General Message codes

MessageType

General Message types

ResourceType

Types of Genesis resources.

SocketReconnectStrategy

Socket reconnection strategies

Functions

Function

Description

criteriaFiltersToFields(filters)

Criteria filters to fields.

dataServerResultFilter(result, rowId)

Data server result filter.

DatasourceEventHandler(Target)

Datasource event handler mixin for target classes that use or are interested in datasource status changes.

extractFieldDefinitions(metadata)

Extracts the field definitions from the metadata.

getConnect()

Get Connect from the DI container.

getDatasource()

Get Datasource from the DI container.

getGenesisResources()

Gets GenesisResources from the DI container.

getGenesisResourcesChannel()

Gets GenesisResourcesChannel from the DI container.

getKVStorage()

Gets KVStorage from the DI container.

getNetworkMonitor()

Gets NetworkMonitor from the DI container.

getSocket()

Gets Socket from the DI container.

getSocketStatus()

Gets SocketStatus from the DI container.

messageHasErrorCode(message, code)

Check if the message contains an error code.

messageOrThrow(message)

Check if the provided message contains an error and throw an Error if it does

normaliseCriteria(criteria, delimiter)

Normalise criteria.

retryInterval(reconnectOptions, scheduler)

Generate reconnect interval based on scheduler

toFieldMetadata(fieldDef)

Converts the field definitions to field metadata.

until(conditionFunc, timeoutMs)

Polls a condition function until it returns true or a timeout is reached.

Interfaces

Interface

Description

Auth

Auth is the main interface for authenticating with a Genesis Server endpoint.

Connect

Represents a connection and its capabilities on a remote server Provides methods to send and receive messages, as well as metadata and schema information.

ConnectConfig

Configuration options for the Connect (WS) instance.

ConnectEvents

ConnectEvents provide hooks to respond to specific connect events.

ConnectEventsEmitter

ConnectEventsEmitter provide event emitting hooks to Connect.

CredentialManager

Represents a system for managing user credentials and authentication tokens.

CredentialManagerConfig

The configuration for the CredentialManager

CredentialManagerCookieConfig

The configuration options for the CredentialManager cookie

Datasource

Datasource interface.

DatasourceConfig

DatasourceConfig DI interface.

DatasourceMetadata

DatasourceMetadata interface.

DatasourceOptions

Options that can be passed when initializing a datasource.

DataUpdate

Data Update definition with details of what data to add, drop, and/or modify.

Dataview

Dataview object

EntityDatasource

(ALPHA) EntityDatasource DI interface.

EntityDatasourceInit

(ALPHA) EntityDatasourceInit interface.

FoundationAnalytics

Represents an analytics tracking system.

GenesisResources

GenesisResources DI interface.

GenesisResourcesChannel

GenesisResourcesChannel DI interface.

GenesisResourcesConfig

GenesisResourcesConfig DI interface.

Http

An interface representing an HTTP client that can make GET and POST requests and return a promise with the response data.

HttpRequestInit

The options object used when making an HTTP request.

JsonSchemaCache

A JSON schema cache definition

KeyValue

(ALPHA) KeyValue interface.

KeyValueTransfer

(ALPHA) KeyValueTransfer interface.

KVStorage

(ALPHA) Represents a KV (key-value) data storage and its capabilities. Provides methods to set and get items from the KV data storage.

KVStorageConfig

(ALPHA) KVStorageConfig DI interface.

LogoutResult

Represents the result of a user logout operation.

MessageBuilder

A utility class for building different types of messages.

MetadataCache

A Metadata cache definition

MonitoredResourceChecksResult

MonitoredResourceChecksResult.

MonitoredResourceMetadata

MonitoredResourceMetadata.

NetworkMonitor

NetworkMonitor monitors network and resource availability and health.

NetworkMonitorConfig

NetworkMonitorConfig DI interface.

SerializedSocketStatus

SerializedSocketStatus provides the serialize state of the web socket.

Serializer

A Serializer interface for serializing and deserializing objects.

Session

Represents a session storage and its capabilities. Provides methods to set and get items from the specified storage.

Socket

Represents a WebSocket used to establish a communication channel between client and a Genesis server. Provides methods for socket connection, sending and receiving WS messages.

SocketStatus

SocketStatus provides the state of the web socket.

User

Represents a User object with associated permissions and profiles.

Namespaces

Namespace

Description

FoundationAnalyticsEvent

Namespace for all Analytics event types

MessageDetails

Namespace for all Message detail types

Variables

Variable

Description

CommitAckEventType

CommitEventType

CommitResponseEventType

credentialSeparator

The default separator used for splitting credential parts.

DatasourceStatusChanged

DatasourceStatusChanged.

defaultConnectConfig

The default configuration for connecting to a WS service.

defaultCredentialManagerConfig

The default configuration for the CredentialManager service.

defaultCredentialRequestOptions

The default request options for the CredentialManager service.

defaultDatasourceConfig

Default DatasourceConfig DI implementation.

defaultGenesisResourcesConfig

Default GenesisResourcesConfig implementation.

defaultKVStorageConfig

(ALPHA) The default configuration for the KVStorage service.

defaultNetworkMonitorConfig

Default NetworkMonitorConfig DI implementation.

exponentialScheduler

Expontential Interval scheduler for reconnect

GenesisResourcesChannelId

isWebSocketExpression

Regular Expression to test valid WebSocket (wss and ws) hosts

linearScheduler

Linear Interval scheduler for reconnect

logger

Logger for the foundation-comms package

MAX_RECONNECT_ATTEMPTS

Default number of reconnect attempts

MetadataEventType

networkLogger

StreamCompleteEventType

StreamErrorEventType

StreamEventType

SystemHealthChanged

SystemHealthChanged.

TYPES_MAP

Types map for FieldTypeEnum.

Type Aliases

Type Alias

Description

AuthInfo

Union type of all authentication information types.

BasicAuthInfo

Represents basic authentication information.

BasicCredentialsInput

Represents basic credentials for a user.

CommitAckEvent

CommitAckEventDetail

CommitEvent

CommitEventDetail

CommitParams

Parameters for a COMMIT message

CommitResponseEvent

CommitResponseEventDetail

ConnectionStatus

The connection status of the Genesis client.

CredentialData_2

Represents user credentials.

DataserverParams

Parameters for a DATA_LOGON messages

DatasourceStatus

DatasourceStatus.

DatasourceStatusChangedEvent

DatasourceStatusChangedEvent.

FieldMetadata

Field Metadata definition.

FilteredDataServerResult

Fitlered result after initial DATASERVER data fetch.

GenesisConnectEvents

Genesis connect events that can be monitored to invoke resource checking.

GenesisResourcesEvents

GetCredentialOptions

Represents options for retrieving credentials.

IndexDetail

Index Detail definition.

JwtAuthInfo

Represents JWT authentication information.

KVEventFailureResponse

(ALPHA) KVStorage type.

KVValue

(ALPHA) KVValue type.

LoginResult

Represents the result of a user login operation.

Message

Base Message type for all DETAIL variants

MessageError

Error definition for a message result

MetaCache

Union type of MetadataCache and JsonSchemaCache

Metadata

Metadata definition for a given resource.

MetadataDetail

Metadata Detail definition.

MetadataEvent

MetadataEventDetail

MonitoredResource

MonitoredResource.

MonitoredResourceChecks

MonitoredResourceChecks.

MonitoredResourceDataLogon

MonitoredResourceDataLogon.

PingMessage

PongMessage

RawDataServerResult

Raw result from a DATASERVER data fetch.

RefreshAuthInfo

Represents refresh token authentication information.

RefreshCredentialsInput

Represents refresh credentials for a user.

ReplyDetail

Reply Detail definition.

RequestDetailsParam

RequestParams

Parameters for a REQ_ messages

RequestServerResult

Raw result from a REQUEST_SERVER data fetch.

ResourceHealth

ResourceHealth.

ResourceItem

ResourcesMessage

RowData

Row Data definition.

SchemaResponse

Schema Response definition.

ServerRow

Server Row definition.

SocketConnectOptions

The Socket connection options definition.

SocketReconnectOptions

Socket reconnection options

SocketReconnectScheduler

Socket reconnection scheduler

SsoAuthInfo

Represents SSO authentication information.

SSOCredentialsInput

Represents SSO credentials for a user.

StorageType

The available browser storage types.

StreamCompleteEvent

StreamCompleteEventDetail

StreamErrorEvent

StreamErrorEventDetail

StreamEvent

StreamEventDetail

StreamEventFunctions

SystemHealthChangedEvent

SystemHealthChangedEvent.

SystemHealthStatus

SystemHealthStatus.