Skip to content

Files

Latest commit

author
Jamie Klassen
Feb 28, 2023
ab750dd · Feb 28, 2023

History

History
125 lines (113 loc) · 3.01 KB

api-report.md

File metadata and controls

125 lines (113 loc) · 3.01 KB

API Report File for "@backstage/integration-react"

Do not edit this file. It is a report generated by API Extractor.

/// <reference types="react" />

import { ApiFactory } from '@backstage/core-plugin-api';
import { ApiRef } from '@backstage/core-plugin-api';
import { AuthRequestOptions } from '@backstage/core-plugin-api';
import { BackstageIdentityApi } from '@backstage/core-plugin-api';
import { Config } from '@backstage/config';
import { OAuthApi } from '@backstage/core-plugin-api';
import { OpenIdConnectApi } from '@backstage/core-plugin-api';
import { ProfileInfoApi } from '@backstage/core-plugin-api';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { SessionApi } from '@backstage/core-plugin-api';

// @public
export class ScmAuth implements ScmAuthApi {
  static createDefaultApiFactory(): ApiFactory<
    ScmAuthApi,
    ScmAuthApi,
    {
      github: OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
      gitlab: OAuthApi &
        OpenIdConnectApi &
        ProfileInfoApi &
        BackstageIdentityApi &
        SessionApi;
      azure: OAuthApi &
        OpenIdConnectApi &
        ProfileInfoApi &
        BackstageIdentityApi &
        SessionApi;
      bitbucket: OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
    }
  >;
  static forAuthApi(
    authApi: OAuthApi,
    options: {
      host: string;
      scopeMapping: {
        default: string[];
        repoWrite: string[];
      };
    },
  ): ScmAuth;
  static forAzure(
    microsoftAuthApi: OAuthApi,
    options?: {
      host?: string;
    },
  ): ScmAuth;
  static forBitbucket(
    bitbucketAuthApi: OAuthApi,
    options?: {
      host?: string;
    },
  ): ScmAuth;
  static forGithub(
    githubAuthApi: OAuthApi,
    options?: {
      host?: string;
    },
  ): ScmAuth;
  static forGitlab(
    gitlabAuthApi: OAuthApi,
    options?: {
      host?: string;
    },
  ): ScmAuth;
  getCredentials(options: ScmAuthTokenOptions): Promise<ScmAuthTokenResponse>;
  isUrlSupported(url: URL): boolean;
  static merge(...providers: ScmAuth[]): ScmAuthApi;
}

// @public
export interface ScmAuthApi {
  getCredentials(options: ScmAuthTokenOptions): Promise<ScmAuthTokenResponse>;
}

// @public
export const scmAuthApiRef: ApiRef<ScmAuthApi>;

// @public
export interface ScmAuthTokenOptions extends AuthRequestOptions {
  additionalScope?: {
    repoWrite?: boolean;
    customScopes?: {
      github?: string[];
      azure?: string[];
      bitbucket?: string[];
      gitlab?: string[];
    };
  };
  url: string;
}

// @public
export interface ScmAuthTokenResponse {
  headers: {
    [name: string]: string;
  };
  token: string;
}

// @public
export const ScmIntegrationIcon: (
  props: ScmIntegrationIconProps,
) => JSX.Element;

// @public
export type ScmIntegrationIconProps = {
  type?: string;
};

// @public
export class ScmIntegrationsApi {
  static fromConfig(config: Config): ScmIntegrationRegistry;
}

// @public
export const scmIntegrationsApiRef: ApiRef<ScmIntegrationRegistry>;