import AuthRequestProxy = require("../portalAuthorization/AuthRequestProxy"); import { IAuthProvider } from "../typings/IAuthProvider"; import { IClusterClientProvider } from "../typings/IClusterClientProvider"; import { IClusterClientResponse } from "../typings/IClusterClient"; export interface ExternServiceV2Deps { authProvider: IAuthProvider; clusterClientProvider: IClusterClientProvider; } export class ExternServiceV2 { private _http: AuthRequestProxy; constructor({ clusterClientProvider, authProvider }: ExternServiceV2Deps) { const clusterClient = clusterClientProvider.createClusterClient( "api.extern.accounts.v2" ); this._http = new AuthRequestProxy({ clusterClient, authProvider }); } async getOrganization(orgId: string) { return this._http.send({ url: `organizations/${orgId}`, method: "GET" }); } }