import { HttpClient } from './http-client'; import { AuthService } from './services/auth.service'; import { DeviceService } from './services/device.service'; import { ProjectService } from './services/project.service'; import { RoleService } from './services/role.service'; import { TenantService } from './services/tenant.service'; import { UserService } from './services/user.service'; import { LocalStorage } from './storage/local-storage'; import type { IamClientConfig } from './types/common'; class IamClient { readonly http: HttpClient; readonly auth: AuthService; readonly users: UserService; readonly tenants: TenantService; readonly projects: ProjectService; readonly roles: RoleService; readonly devices: DeviceService; constructor(config: IamClientConfig) { const { apiUrl, storage, apiKey } = config; this.http = new HttpClient(apiUrl, storage || new LocalStorage(), apiKey); this.auth = new AuthService(this.http); this.users = new UserService(this.http); this.tenants = new TenantService(this.http); this.projects = new ProjectService(this.http); this.roles = new RoleService(this.http); this.devices = new DeviceService(this.http); } } function createIamClient(config: IamClientConfig): IamClient { return new IamClient(config); } export { IamClient, createIamClient };