Skip to main content

Connectors Reference

This page provides a detailed reference for the connector architecture in io-oidis-services. For the high-level LCP overview and creating new connectors, see LCP & RPC.

BaseConnector Architecture​

BaseConnector is the abstract base class for all frontend connectors. It handles transport client creation, environment detection, error handling, and reconnection logic.

Construction Options (IConnectorOptions)​

OptionTypeDefaultDescription
clientTypeWebServiceClientTypeauto-detectedExplicit client type override
maxReconnectCountnumber0Max reconnection attempts (-1 = infinite)
serverConfigurationSourcestring | WebServiceConfiguration—Transport client configuration URL
suppressInitbooleanfalseSkip init() during construction
reconnectbooleanfalseEnable automatic reconnection

Client Type Auto-Detection​

When no explicit clientType is provided, getClientType() inspects the runtime environment:

IsLocalhostHosting()  →  HOST_CLIENT
IsJre() / IsPlugin() / IsConnector() → DESKTOP_CONNECTOR
IsOnServer() → HUB_CONNECTOR
(fallback) → BUILDER_CONNECTOR

Namespace Mapping​

Each connector overrides getServerNamespaces() to map client types to backend class namespaces:

protected getServerNamespaces() : any {
const namespaces : any = {};
namespaces[WebServiceClientType.HUB_CONNECTOR] = "Io.Oidis.Hub.Utils.MyManager";
namespaces[WebServiceClientType.DESKTOP_CONNECTOR] = "Io.Oidis.Connector.Connectors.MyManager";
return namespaces;
}

The connector resolves the namespace at init time and all subsequent invoke() calls target that backend class.

Invocation Methods​

MethodAPI StyleUse Case
invoke()Callback chainLegacy code: .DataFormatter().OnError().Then()
asyncInvoke()Promise/async-awaitModern code: await this.asyncInvoke("Method", args)
toSyncInvoke()Promise → Callback bridgeWrap async methods in the callback API
progressWrapper()Promise + progressLong-running operations with OnChange callbacks

Error Handling​

  • ErrorPropagation(true) — Errors are logged as warnings (non-fatal)
  • ErrorPropagation(false) (default) — Errors throw global exceptions in production mode
  • Connection loss — For HUB/REST connectors without reconnect, redirects to /ServerError/Http/ConnectionLost
  • Reconnection — When enabled, auto-reconnects on timeout/close events

Hub Agent Forwarding​

For distributed deployments, a connector can forward requests to a remote agent via Hub:

const connector = MyConnector.getClient();
connector.setAgent("remote-agent-name", "https://hub-url");
// All subsequent calls are forwarded through Hub to the remote agent

This changes the client type to FORWARD_CLIENT and routes requests through ForwardingClient.

Progress Reporting (IFetchProgress)​

For long-running operations, progressWrapper() emits progress updates:

protected Download($url : string) : Promise<string> {
return this.progressWrapper<string>("Download", [$url], ($progress) => {
// $progress.index = current step
// $progress.from = total steps
// $progress.message = status text
});
}

Connector Catalog​

All 16 connectors in io-oidis-services, grouped by function.

System & Environment​

ConnectorPurposeKey Methods
EnvironmentConnectorBackend environment state and initialization progressgetEnvType(), IsEnvironmentLoaded(), getStateChain(), AddLoadingListener()
UpdatesManagerConnectorApplication update managementCheckForUpdates(), InstallUpdate()
CronConnectorScheduled task managementAddTask(), RemoveTask(), GetTasks()

EnvironmentConnector caches a positive IsEnvironmentLoaded() / InitPageEnabled() result and the state chain only until the backend connection is closed or times out, so a restarted backend is checked again instead of being reported as loaded. getStateChain() returns IEnvironmentStep[] (state, label, route, failure); the end state is the last non-failure step and is application specific - see Hub Backend Overview.

File System & Terminal​

ConnectorPurposeKey Methods
FileSystemHandlerConnectorFile I/O, directories, downloads, archivesRead(), Write(), Delete(), Copy(), Download(), Pack(), Unpack()
TerminalConnectorProcess execution and managementExecute(), Spawn(), Elevate(), Kill()
DialogsConnectorNative OS file/folder dialogsShowFileDialog(), ShowSaveFileDialog(), ShowFileExplorer()

Window & UI​

ConnectorPurposeKey Methods
WindowHandlerConnectorWindow management and system trayClose(), Minimize(), Maximize(), CreateNotifyIcon(), setTaskBarProgressState()
IdeHandlerConnectorIDE integrationOpenFile(), OpenProject()

Networking & Communication​

ConnectorPurposeKey Methods
NetworkingConnectorNetwork port operationsgetFreePort(), AddPortListener(), WriteToPort()
AgentsRegisterConnectorHub agent registration and messagingRegisterAgent(), ForwardMessage(), getAgentsList()

Security & Auth​

ConnectorPurposeKey Methods
AuthManagerConnectorAuthentication, users, groups, tokensLogIn(), LogOut(), Register(), GenerateAuthToken()
CertsConnectorSSL certificate managementGenerateCert(), ImportCert()

Interop & Reporting​

ConnectorPurposeKey Methods
COMproxyConnectorCOM proxy for Windows native componentsInvoke(), CreateInstance()
FFIProxyConnectorForeign Function Interface proxyCall(), LoadLibrary()
VirtualBoxConnectorVirtualBox VM managementStart(), Stop(), Execute(), Copy()
ReportServiceConnectorLogging, email, crash reportsLogIt(), SendMail(), CreateReport()

Async Variants​

Several connectors provide an *Async variant returning native Promises instead of callback chains:

  • FileSystemHandlerConnectorAsync
  • TerminalConnectorAsync
  • DialogsConnectorAsync
  • AgentsRegisterConnectorAsync

Detailed Connector Reference​

FileSystemHandlerConnector​

Wraps the backend FileSystemHandler service for local file I/O, directory operations, HTTP downloads, and archive management. Provides both callback (FileSystemHandlerConnector) and async (FileSystemHandlerConnectorAsync) variants through a shared BaseFileSystemHandlerConnector base.

Namespace mapping:

Client TypeBackend Namespace
DESKTOP_CONNECTORIo.Oidis.Connector.Connectors.FileSystemHandler
BUILDER_CONNECTORIo.Oidis.Builder.Connectors.FileSystemHandler
FORWARD_CLIENTIo.Oidis.Connector.Connectors.FileSystemHandler
HOST_CLIENTIo.Oidis.Connector.Connectors.FileSystemHandler

API overview:

CategoryMethods
Path queriesgetTempPath(), getProjectBasePath(), getAppDataPath(), getLocalAppDataPath(), getHostLocation()
Directory listinggetPathMap(), getNetworkMap(), getDirectoryContent(), Expand()
File operationsRead(), Write(), Delete(), Exists(), IsFile(), IsEmpty(), Rename(), Copy(), CreateDirectory()
DownloadsDownload(), AbortDownload() — full lifecycle with OnStart/OnChange/OnComplete/OnError
ArchivesPack(), Unpack() — ZIP/TAR operations with output path and type options
ShortcutsCreateShortcut(), getLinkTargetPath()

Download supports IFileSystemDownloadOptions for HTTP method, headers, body, proxy config, mTLS, and streaming mode.

TerminalConnector​

Wraps the backend Terminal service for child process creation and management. Provides both callback and async variants.

Namespace mapping:

Client TypeBackend Namespace
DESKTOP_CONNECTORIo.Oidis.Connector.Connectors.Terminal
BUILDER_CONNECTORIo.Oidis.Builder.Connectors.Terminal
FORWARD_CLIENTIo.Oidis.Connector.Connectors.Terminal
HOST_CLIENTIo.Oidis.Connector.Connectors.Terminal

API overview:

MethodDescription
Execute()Run a command and wait for exit (returns exit code + stdout/stderr)
Spawn()Run a command with streaming OnMessage events for stdout/stderr
Elevate()Run a command with elevated (admin) privileges
Open()Open a file/URL with the default OS handler
Kill()Kill a process by path or name

All process methods accept ITerminalOptions for cwd, environment, shell mode, detach, and advanced settings (colored output, noExitOnStderr, stdin).

WindowHandlerConnector​

Wraps the WindowHandler service for native window management, system tray icons, taskbar progress, file dialogs, and in-window script execution.

Namespace mapping:

Client TypeBackend Namespace
CEF_QUERYIo.Oidis.ChromiumRE.Connectors.WindowHandler
DESKTOP_CONNECTORIo.Oidis.Connector.Connectors.WindowHandler

Client type auto-detection overrides the base: uses DESKTOP_CONNECTOR when a target PID/title is provided, otherwise falls back to CEF_QUERY for the hosting window.

API overview:

CategoryMethods
Window stateClose(), Minimize(), Maximize(), Restore(), Show(), Hide(), Exists(), getState()
Window geometryMoveTo(), Resize(), CanResize()
Child windowsOpen(), ScriptExecute(), getCookies(), ShowDebugConsole()
System trayCreateNotifyIcon(), ModifyNotifyIcon(), DestroyNotifyIcon()
TaskbarsetTaskBarProgressState(), setTaskBarProgressValue()
DialogsShowFileDialog()
EventsAddEventListener(), RemoveEventListener(), getEvents()

Events include OnNotifyIconClick, OnNotifyIconDoubleClick, OnNotifyIconBalloonClick, OnNotifyIconContextItemSelected, and OnWindowChanged.

AuthManagerConnector​

Wraps the Hub AuthManager service for user authentication, registration, password management, API token lifecycle, group/role authorization, and organization administration. Uses exclusively async invocation (asyncInvoke) and communicates only with Hub.

Namespace mapping:

Client TypeBackend Namespace
HUB_CONNECTORIo.Oidis.Hub.Utils.AuthManager

API overview:

CategoryMethods
AuthenticationLogIn(), LogOut(), IsAuthenticated(), IsAuthorizedFor(), CurrentToken(), IsPasswordValid()
User managementRegister(), ActivateUser(), DeactivateUser(), RemoveUser(), DeleteUser(), RestoreUser()
PasswordResetPassword(), ResetPasswordConfirm(), ChangePassword(), InvitationConfirm()
ProfilesgetUserId(), getUserProfile(), setUserProfile(), FindUsers(), CheckEmailDuplicity()
GroupsAddGroup(), RemoveGroup(), getGroups(), CreateGroup(), FindGroups(), DeleteGroup(), RestoreGroup()
PermissionsgetAuthorizedMethods(), setAuthorizedMethods(), getAuthorizedMethodsFor(), getGroupMethods()
Auth tokensGenerateAuthToken(), RevokeAuthToken(), UpdateAuthToken(), getAuthToken(), IsAuthTokenValid()
ApplicationsRegisterApp(), getAppMethods()
OrganizationsRegisterOrganization(), setOrganizationProfile(), getOrganizationProfile(), getOrganizationChart()
Org membersAddUserToOrganization(), RemoveUserFromOrganization(), FindOrganizations()
Org lifecycleDeactivateOrganization(), DeleteOrganization(), RestoreOrganization()

Security note: All password methods hash with SHA-1 on the client side before transmission.

Namespace Mapping Summary​

Complete mapping of all 16 connectors to their backend class namespaces:

ConnectorClient Type(s)Backend Namespace(s)
AgentsRegisterConnectorHUBIo.Oidis.Hub.Primitives.AgentsRegister
AuthManagerConnectorHUBIo.Oidis.Hub.Utils.AuthManager
CertsConnectorHUBIo.Oidis.Hub.Connectors.CertsHandler
COMproxyConnectorDESKTOPIo.Oidis.Connector.Connectors.COMproxy
CronConnectorHUBIo.Oidis.Localhost.Utils.CronConnector
DialogsConnectorDESKTOP, BUILDERIo.Oidis.Connector.Connectors.Dialogs, Io.Oidis.Builder.Connectors.Dialogs
EnvironmentConnectorHUBIo.Oidis.Hub.Utils.EnvironmentHelper
FFIProxyConnectorDESKTOP, BUILDER, FORWARDIo.Oidis.Connector.Connectors.FFIProxy, Io.Oidis.Builder.Connectors.FFIProxy
FileSystemHandlerConnectorDESKTOP, BUILDER, FORWARD, HOSTIo.Oidis.Connector.Connectors.FileSystemHandler, Io.Oidis.Builder.Connectors.FileSystemHandler
IdeHandlerConnectorJXBROWSER_BRIDGEIo.Oidis.IdeJRE.Connectors.IdeHandler
NetworkingConnectorDESKTOP, BUILDER, FORWARDIo.Oidis.Connector.Connectors.Network, Io.Oidis.Builder.Connectors.Network
ReportServiceConnectorHUBIo.Oidis.Hub.Utils.ReportAPI
TerminalConnectorDESKTOP, BUILDER, FORWARD, HOSTIo.Oidis.Connector.Connectors.Terminal, Io.Oidis.Builder.Connectors.Terminal
UpdatesManagerConnectorHUBIo.Oidis.Hub.Utils.SelfupdatesManager
VirtualBoxConnectorBUILDERIo.Oidis.Builder.Connectors.VirtualBoxHandler
WindowHandlerConnectorCEF_QUERY, DESKTOPIo.Oidis.ChromiumRE.Connectors.WindowHandler, Io.Oidis.Connector.Connectors.WindowHandler

See also: LCP & RPC | Architecture Overview | Request Forwarding