import * as interfaces from '../ts_interfaces/index.js'; import type { DcRouterApiClient } from './classes.dcrouterapiclient.js'; export class WorkHosterManager { constructor(private clientRef: DcRouterApiClient) {} public async getCapabilities(): Promise { const response = await this.clientRef.request( 'getGatewayCapabilities', this.clientRef.buildRequestPayload() as any, ); return response.capabilities; } public async getDomains(): Promise { const response = await this.clientRef.request( 'getWorkHosterDomains', this.clientRef.buildRequestPayload() as any, ); return response.domains; } public async syncRoute(options: { ownership: interfaces.data.IWorkAppRouteOwnership; route: interfaces.data.IDcRouterRouteConfig; enabled?: boolean; }): Promise { return this.clientRef.request( 'syncWorkAppRoute', this.clientRef.buildRequestPayload({ ownership: options.ownership, route: options.route, enabled: options.enabled, }) as any, ); } public async deleteRoute( ownership: interfaces.data.IWorkAppRouteOwnership, ): Promise { return this.clientRef.request( 'syncWorkAppRoute', this.clientRef.buildRequestPayload({ ownership, delete: true, }) as any, ); } }