UNPKG

@atlaskit/profilecard

Version:

A React component to display a card with user information.

51 lines (50 loc) 2.07 kB
import { type TeamCentralReportingLinesData } from '../types'; import CachingClient, { type CacheConfig } from './CachingClient'; export declare const buildReportingLinesQuery: (aaid: string) => { query: string; variables: { aaid: string; }; }; export type TeamCentralCardClientOptions = CacheConfig & { cloudId?: string; gatewayGraphqlUrl: string; /** * If provided, will avoid resolving the org ID internally from the cloud ID, * and use the provided org ID instead */ orgId?: string; teamCentralDisabled?: boolean; }; declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLinesData> { options: TeamCentralCardClientOptions; /** * Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures * This is to handle the case where products may have provided teamCentralUrl, but the site itself * doesn't actually have any TC product. * * There's currently no way to reset this circuit breaker, but that's fine. This is meant to * catch a pretty specific edge case. */ bypassOnFailure: boolean; orgContainsAnyWorkspacePromise: Promise<boolean>; private orgIdPromise; private workspaceExistsWithTypePromise; constructor(options: TeamCentralCardClientOptions); createOrgContainsAnyWorkspacePromise(config: TeamCentralCardClientOptions): Promise<boolean>; getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>; /** * `public` so that mock client can override it; do not use it otherwise! */ makeRequest(userId: string): Promise<TeamCentralReportingLinesData>; checkWorkspaceExists(): Promise<boolean>; getIsGlobalExperienceWorkspace(): Promise<boolean>; getOrgId(): Promise<string | null>; private preloadWorkspaceExistsWithType; private getOrgContainsAnyWorkspace; private getWorkspaceExistsWithType; private preloadOrgId; private getShardedApiPath; private filterReportingLinesUser; } export default TeamCentralCardClient;