Skip to main content

Connectors and API

Hub GUI communicates with the hub backend exclusively through connectors. Each connector wraps a set of backend @Extern() methods, making them callable from the browser via LCP (Local Communication Protocol) or RPC.

Communication Pattern​

All hub-gui connectors use the asyncInvoke() pattern inherited from BaseConnector (io-oidis-services):

public async FindUsers($filter : any, $options : any) : Promise<User[]> {
return this.asyncInvoke("FindUsers", $filter, $options);
}

asyncInvoke(methodName, ...args) serializes the call, sends it to the backend connector with the same name, and deserializes the response. The transport layer is handled by the framework — connectors do not use fetch() directly.

tip

One exception: EnvironmentConnector.AttachToPushNotifications() uses LiveContentWrapper.InvokeMethod() for streaming push notifications via a persistent connection.

Singleton Access​

Most connectors expose a static getClient() factory that returns a memoized singleton:

const auth : AuthManagerConnector = AuthManagerConnector.getClient();
const users : User[] = await auth.FindUsers(filter, options);

Exceptions:

  • EnvironmentConnector uses getInstanceSingleton() instead
  • RegistryConnector and ReportsConnector are instantiated directly by their panel controllers

Connector Reference​

ConnectorParentKey MethodsPurpose
AuthManagerConnectorServices AuthManagerConnectorFindUsers, FindGroups, FindOrganizations, HasGroup, getSystemGroups, ExportAuthMethods, ImportAuthMethods, Generate2FAKey, Validate2FA, Has2FAActivated, RegisterAdmin, AuthenticateAdmin, CreateInvitationLink, SendInvitation, getPermissionsReport, ResetDefaultGroups, SyncSystemGroups, getServiceAccounts, SwitchToAccount, getAuthorizationUrl, getColorScheme, setColorSchemeUser, group, organization, and permission management. 2FA setup and validation. OAuth integration. Per-account color scheme, see Extending Hub GUI.
EnvironmentConnectorServices EnvironmentConnectorSendFeedback, getSendMailConfig, setSendMailConfig, getReleaseNotesConfig, getReleaseNotesFor, getFAQTopics, getEventLoopRecords, setEventLoopRecords, getBuildTime, getUpTime, PushNotification, AttachToPushNotifications, Exit, getConnectorsInfo, getAppSettings, SaveAppSettings, SyncAppSettings, getLog, getTrafficStatsEnvironment status, email config, release notes, event loop, push notifications, app settings, server control.
RegistryConnectorBaseConnectorgetConfigs, getUpdates, getDownloads, getFileEntries, UploadFile, RegisterFile, IsInDatabase, Reindex, DeleteConfig, FileEntryToFS, FileEntryToDBConfiguration registry: browse, upload, manage config files and packages.
ReportsConnectorBaseConnectorgetReportingApps, getReports, getReport, ProcessLogs, getRawLogs, TestLogsApplication reports and log analysis.
AuthCodeConnectorBaseConnectorSendAuthCode, RequestAuthCode, ValidateOne-time auth code generation and validation (2FA setup).
SystemLogConnectorBaseConnectorgetLogsList, CleanSystem audit log retrieval and cleanup.
NotificationsConnectorBaseConnectorgetRecords, UploadImage, Save, DeletePush notification CRUD.
WebhooksManagerConnectorBaseConnectorgetWebhooksInfo, setAdapterState, ReactivateAdapterRecords, LoopStart, LoopStop, MasterStopWebhook adapter management and processing control.
AddressesConnectorBaseConnectorAddressFromIco, SuggestCity, SuggestPostalCode, SuggestDistrict, SuggestStreet, SuggestHouseNumber, SuggestAddressAddress lookup and autocomplete (ICO, city, postal code, street).
LoggerClientBaseConnectorProcessTraceForward client-side log traces to server.
PrintConnectorBaseConnectorGeneratePDF, getPrintOptionsPDF generation via Puppeteer. Uses WebSocket transport.
FileInputConnectorBaseConnectorUploadFile upload handling.

Extending Connectors​

Solution projects can extend hub-gui connectors to add project-specific backend methods:

import { AuthManagerConnector as Parent } from "@io-oidis-hub-gui/Io/Oidis/Hub/Gui/Connectors/AuthManagerConnector.js";

export class AuthManagerConnector extends Parent {

public static getClient() : AuthManagerConnector {
return <AuthManagerConnector>super.getClient();
}

public async FindCustomData($filter : any) : Promise<any> {
return this.asyncInvoke("FindCustomData", $filter);
}
}

The extended connector must also have a matching @Extern() method registered on the backend connector in the solution's io-oidis-{name} package.


See also: Hub GUI Overview | Connectors Reference | LCP and RPC | Extending Hub GUI