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.
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:
EnvironmentConnectorusesgetInstanceSingleton()insteadRegistryConnectorandReportsConnectorare instantiated directly by their panel controllers
Connector Reference
| Connector | Parent | Key Methods | Purpose |
|---|---|---|---|
AuthManagerConnector | Services AuthManagerConnector | FindUsers, FindGroups, FindOrganizations, HasGroup, getSystemGroups, ExportAuthMethods, ImportAuthMethods, Generate2FAKey, Validate2FA, Has2FAActivated, RegisterAdmin, AuthenticateAdmin, CreateInvitationLink, SendInvitation, getPermissionsReport, ResetDefaultGroups, SyncSystemGroups, getServiceAccounts, SwitchToAccount, getAuthorizationUrl, getColorScheme, setColorScheme | User, group, organization, and permission management. 2FA setup and validation. OAuth integration. Per-account color scheme, see Extending Hub GUI. |
EnvironmentConnector | Services EnvironmentConnector | SendFeedback, getSendMailConfig, setSendMailConfig, getReleaseNotesConfig, getReleaseNotesFor, getFAQTopics, getEventLoopRecords, setEventLoopRecords, getBuildTime, getUpTime, PushNotification, AttachToPushNotifications, Exit, getConnectorsInfo, getAppSettings, SaveAppSettings, SyncAppSettings, getLog, getTrafficStats | Environment status, email config, release notes, event loop, push notifications, app settings, server control. |
RegistryConnector | BaseConnector | getConfigs, getUpdates, getDownloads, getFileEntries, UploadFile, RegisterFile, IsInDatabase, Reindex, DeleteConfig, FileEntryToFS, FileEntryToDB | Configuration registry: browse, upload, manage config files and packages. |
ReportsConnector | BaseConnector | getReportingApps, getReports, getReport, ProcessLogs, getRawLogs, TestLogs | Application reports and log analysis. |
AuthCodeConnector | BaseConnector | SendAuthCode, RequestAuthCode, Validate | One-time auth code generation and validation (2FA setup). |
SystemLogConnector | BaseConnector | getLogsList, Clean | System audit log retrieval and cleanup. |
NotificationsConnector | BaseConnector | getRecords, UploadImage, Save, Delete | Push notification CRUD. |
WebhooksManagerConnector | BaseConnector | getWebhooksInfo, setAdapterState, ReactivateAdapterRecords, LoopStart, LoopStop, MasterStop | Webhook adapter management and processing control. |
AddressesConnector | BaseConnector | AddressFromIco, SuggestCity, SuggestPostalCode, SuggestDistrict, SuggestStreet, SuggestHouseNumber, SuggestAddress | Address lookup and autocomplete (ICO, city, postal code, street). |
LoggerClient | BaseConnector | ProcessTrace | Forward client-side log traces to server. |
PrintConnector | BaseConnector | GeneratePDF, getPrintOptions | PDF generation via Puppeteer. Uses WebSocket transport. |
FileInputConnector | BaseConnector | Upload | File 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