it just keeps 🧹 -ing

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 16:58:54 +02:00
parent d461eca145
commit ef9ab322de
55 changed files with 193 additions and 302 deletions
+19
View File
@@ -0,0 +1,19 @@
---
'@backstage/catalog-client': patch
'@backstage/core-plugin-api': patch
'@backstage/plugin-api-docs': patch
'@backstage/plugin-apollo-explorer': patch
'@backstage/plugin-azure-devops-backend': patch
'@backstage/plugin-badges': patch
'@backstage/plugin-badges-backend': patch
'@backstage/plugin-catalog-react': patch
'@backstage/plugin-circleci': patch
'@backstage/plugin-cloudbuild': patch
'@backstage/plugin-kubernetes': patch
'@backstage/plugin-scaffolder-backend': patch
'@backstage/plugin-search-backend-module-elasticsearch': patch
'@backstage/plugin-sonarqube-backend': patch
'@backstage/plugin-techdocs': patch
---
Minor API signatures cleanup
+1 -1
View File
@@ -78,7 +78,7 @@ export class CatalogClient implements CatalogApi {
};
});
addLocation(
{ type, target, dryRun }: AddLocationRequest,
request: AddLocationRequest,
options?: CatalogRequestOptions,
): Promise<AddLocationResponse>;
getEntities(
+3 -1
View File
@@ -272,9 +272,11 @@ export class CatalogClient implements CatalogApi {
* {@inheritdoc CatalogApi.addLocation}
*/
async addLocation(
{ type = 'url', target, dryRun }: AddLocationRequest,
request: AddLocationRequest,
options?: CatalogRequestOptions,
): Promise<AddLocationResponse> {
const { type = 'url', target, dryRun } = request;
const response = await this.fetchApi.fetch(
`${await this.discoveryApi.getBaseUrl('catalog')}/locations${
dryRun ? '?dryRun=true' : ''
+1 -4
View File
@@ -649,10 +649,7 @@ export interface PluginOptionsProviderProps {
}
// @alpha
export const PluginProvider: ({
children,
plugin,
}: PluginOptionsProviderProps) => JSX.Element;
export const PluginProvider: (props: PluginOptionsProviderProps) => JSX.Element;
// @public
export type ProfileInfo = {
@@ -39,10 +39,11 @@ export interface PluginOptionsProviderProps {
*
* @alpha
*/
export const PluginProvider = ({
children,
plugin,
}: PluginOptionsProviderProps): JSX.Element => {
export const PluginProvider = (
props: PluginOptionsProviderProps,
): JSX.Element => {
const { children, plugin } = props;
const { Provider } = createVersionedContext<{
1: { plugin: BackstagePlugin | undefined };
}>(contextKey);
+11 -34
View File
@@ -17,13 +17,9 @@ import { TableColumn } from '@backstage/core-components';
import { TableProps } from '@backstage/core-components';
import { UserListFilterKind } from '@backstage/plugin-catalog-react';
// Warning: (ae-missing-release-tag) "ApiDefinitionCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ApiDefinitionCard: () => JSX.Element;
// Warning: (ae-missing-release-tag) "ApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ApiDefinitionWidget = {
type: string;
@@ -32,14 +28,17 @@ export type ApiDefinitionWidget = {
rawLanguage?: string;
};
// Warning: (ae-forgotten-export) The symbol "ApiDocsConfig" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "apiDocsConfigRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ApiDocsConfig {
// (undocumented)
getApiDefinitionWidget: (
apiEntity: ApiEntity,
) => ApiDefinitionWidget | undefined;
}
// @public (undocumented)
export const apiDocsConfigRef: ApiRef<ApiDocsConfig>;
// Warning: (ae-missing-release-tag) "apiDocsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
const apiDocsPlugin: BackstagePlugin<
{
@@ -66,15 +65,11 @@ export const ApiExplorerPage: (
// @public (undocumented)
export const ApiTypeTitle: (props: { apiEntity: ApiEntity }) => JSX.Element;
// Warning: (ae-missing-release-tag) "AsyncApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const AsyncApiDefinitionWidget: (
props: AsyncApiDefinitionWidgetProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "AsyncApiDefinitionWidgetProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type AsyncApiDefinitionWidgetProps = {
definition: string;
@@ -91,11 +86,9 @@ export const ConsumingComponentsCard: (props: {
}) => JSX.Element;
// @public
export const DefaultApiExplorerPage: ({
initiallySelectedFilter,
columns,
actions,
}: DefaultApiExplorerPageProps) => JSX.Element;
export const DefaultApiExplorerPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
// @public
export type DefaultApiExplorerPageProps = {
@@ -104,8 +97,6 @@ export type DefaultApiExplorerPageProps = {
actions?: TableProps<CatalogTableRow>['actions'];
};
// Warning: (ae-missing-release-tag) "defaultDefinitionWidgets" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function defaultDefinitionWidgets(): ApiDefinitionWidget[];
@@ -137,15 +128,11 @@ export const EntityProvidingComponentsCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "GraphQlDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const GraphQlDefinitionWidget: (
props: GraphQlDefinitionWidgetProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "GraphQlDefinitionWidgetProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type GraphQlDefinitionWidgetProps = {
definition: string;
@@ -156,29 +143,21 @@ export const HasApisCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "OpenApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const OpenApiDefinitionWidget: (
props: OpenApiDefinitionWidgetProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "OpenApiDefinitionWidgetProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type OpenApiDefinitionWidgetProps = {
definition: string;
};
// Warning: (ae-missing-release-tag) "PlainApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const PlainApiDefinitionWidget: (
props: PlainApiDefinitionWidgetProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "PlainApiDefinitionWidgetProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type PlainApiDefinitionWidgetProps = {
definition: any;
@@ -190,8 +169,6 @@ export const ProvidedApisCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "ProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ProvidingComponentsCard: (props: {
variant?: InfoCardVariants;
@@ -24,6 +24,7 @@ import { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';
import { CardTab, TabbedCard } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
/** @public */
export const ApiDefinitionCard = () => {
const { entity } = useEntity<ApiEntity>();
const config = useApi(apiDocsConfigRef);
@@ -19,6 +19,7 @@ import { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';
import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';
import { GrpcApiDefinitionWidget } from '../GrpcApiDefinitionWidget';
/** @public */
export type ApiDefinitionWidget = {
type: string;
title: string;
@@ -26,6 +27,7 @@ export type ApiDefinitionWidget = {
rawLanguage?: string;
};
/** @public */
export function defaultDefinitionWidgets(): ApiDefinitionWidget[] {
return [
{
@@ -64,11 +64,9 @@ export type DefaultApiExplorerPageProps = {
* DefaultApiExplorerPage
* @public
*/
export const DefaultApiExplorerPage = ({
initiallySelectedFilter = 'all',
columns,
actions,
}: DefaultApiExplorerPageProps) => {
export const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {
const { initiallySelectedFilter = 'all', columns, actions } = props;
const configApi = useApi(configApiRef);
const generatedSubtitle = `${
configApi.getOptionalString('organization.name') ?? 'Backstage'
@@ -25,10 +25,12 @@ const LazyAsyncApiDefinition = React.lazy(() =>
})),
);
/** @public */
export type AsyncApiDefinitionWidgetProps = {
definition: string;
};
/** @public */
export const AsyncApiDefinitionWidget = (
props: AsyncApiDefinitionWidgetProps,
) => {
@@ -34,6 +34,7 @@ import {
WarningPanel,
} from '@backstage/core-components';
/** @public */
export const ProvidingComponentsCard = (props: {
variant?: InfoCardVariants;
}) => {
@@ -25,10 +25,12 @@ const LazyGraphQlDefinition = React.lazy(() =>
})),
);
/** @public */
export type GraphQlDefinitionWidgetProps = {
definition: string;
};
/** @public */
export const GraphQlDefinitionWidget = (
props: GraphQlDefinitionWidgetProps,
) => {
@@ -19,10 +19,12 @@ import { CodeSnippet } from '@backstage/core-components';
import { useTheme } from '@material-ui/core/styles';
import { BackstageTheme } from '@backstage/theme';
/** @public */
export type GrpcApiDefinitionWidgetProps = {
definition: string;
};
/** @public */
export const GrpcApiDefinitionWidget = (
props: GrpcApiDefinitionWidgetProps,
) => {
@@ -25,10 +25,12 @@ const LazyOpenApiDefinition = React.lazy(() =>
})),
);
/** @public */
export type OpenApiDefinitionWidgetProps = {
definition: string;
};
/** @public */
export const OpenApiDefinitionWidget = (
props: OpenApiDefinitionWidgetProps,
) => {
@@ -17,11 +17,13 @@
import React from 'react';
import { CodeSnippet } from '@backstage/core-components';
/** @public */
export type PlainApiDefinitionWidgetProps = {
definition: any;
language: string;
};
/** @public */
export const PlainApiDefinitionWidget = (
props: PlainApiDefinitionWidgetProps,
) => {
+2
View File
@@ -18,10 +18,12 @@ import { ApiEntity } from '@backstage/catalog-model';
import { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';
import { createApiRef } from '@backstage/core-plugin-api';
/** @public */
export const apiDocsConfigRef = createApiRef<ApiDocsConfig>({
id: 'plugin.api-docs.config',
});
/** @public */
export interface ApiDocsConfig {
getApiDefinitionWidget: (
apiEntity: ApiEntity,
+1
View File
@@ -21,6 +21,7 @@
*/
export * from './components';
export type { ApiDocsConfig } from './config';
export { apiDocsConfigRef } from './config';
export {
apiDocsPlugin,
+1
View File
@@ -25,6 +25,7 @@ import {
createRoutableExtension,
} from '@backstage/core-plugin-api';
/** @public */
export const apiDocsPlugin = createPlugin({
id: 'api-docs',
routes: {
+1 -5
View File
@@ -10,11 +10,7 @@ import { JSONObject } from '@apollo/explorer/src/helpers/types';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
export const ApolloExplorerPage: ({
title,
subtitle,
endpoints,
}: {
export const ApolloExplorerPage: (props: {
title?: string | undefined;
subtitle?: string | undefined;
endpoints: {
@@ -41,7 +41,8 @@ type Props = {
endpoints: EndpointProps[];
};
export const ApolloExplorerPage = ({ title, subtitle, endpoints }: Props) => {
export const ApolloExplorerPage = (props: Props) => {
const { title, subtitle, endpoints } = props;
return (
<Page themeId="tool">
<Header title={title ?? 'Apollo Explorer 👩‍🚀'} subtitle={subtitle ?? ''} />
+1 -4
View File
@@ -77,10 +77,7 @@ export class AzureDevOpsApi {
top: number,
): Promise<RepoBuild[]>;
// (undocumented)
getTeamMembers({
projectId,
teamId,
}: {
getTeamMembers(options: {
projectId: string;
teamId: string;
}): Promise<TeamMember[] | undefined>;
@@ -296,13 +296,11 @@ export class AzureDevOpsApi {
);
}
public async getTeamMembers({
projectId,
teamId,
}: {
public async getTeamMembers(options: {
projectId: string;
teamId: string;
}): Promise<TeamMember[] | undefined> {
const { projectId, teamId } = options;
this.logger?.debug(`Getting team member ids for team '${teamId}'.`);
const client = await this.webApi.getCoreApi();
-28
View File
@@ -9,8 +9,6 @@ import { Entity } from '@backstage/catalog-model';
import express from 'express';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
// Warning: (ae-missing-release-tag) "Badge" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface Badge {
color?: string;
@@ -23,8 +21,6 @@ export interface Badge {
style?: BadgeStyle;
}
// Warning: (ae-missing-release-tag) "BADGE_STYLES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const BADGE_STYLES: readonly [
'plastic',
@@ -34,8 +30,6 @@ export const BADGE_STYLES: readonly [
'social',
];
// Warning: (ae-missing-release-tag) "BadgeBuilder" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BadgeBuilder = {
getBadges(): Promise<BadgeInfo[]>;
@@ -43,8 +37,6 @@ export type BadgeBuilder = {
createBadgeSvg(options: BadgeOptions): Promise<string>;
};
// Warning: (ae-missing-release-tag) "BadgeContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface BadgeContext {
// (undocumented)
@@ -55,39 +47,29 @@ export interface BadgeContext {
entity?: Entity;
}
// Warning: (ae-missing-release-tag) "BadgeFactories" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface BadgeFactories {
// (undocumented)
[id: string]: BadgeFactory;
}
// Warning: (ae-missing-release-tag) "BadgeFactory" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface BadgeFactory {
// (undocumented)
createBadge(context: BadgeContext): Badge;
}
// Warning: (ae-missing-release-tag) "BadgeInfo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BadgeInfo = {
id: string;
};
// Warning: (ae-missing-release-tag) "BadgeOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BadgeOptions = {
badgeInfo: BadgeInfo;
context: BadgeContext;
};
// Warning: (ae-missing-release-tag) "BadgeSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BadgeSpec = {
id: string;
@@ -96,23 +78,15 @@ export type BadgeSpec = {
markdown: string;
};
// Warning: (ae-missing-release-tag) "BadgeStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BadgeStyle = typeof BADGE_STYLES[number];
// Warning: (ae-missing-release-tag) "createDefaultBadgeFactories" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const createDefaultBadgeFactories: () => BadgeFactories;
// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
// Warning: (ae-missing-release-tag) "DefaultBadgeBuilder" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class DefaultBadgeBuilder implements BadgeBuilder {
constructor(factories: BadgeFactories);
@@ -126,8 +100,6 @@ export class DefaultBadgeBuilder implements BadgeBuilder {
protected getMarkdownCode(params: Badge, badgeUrl: string): string;
}
// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface RouterOptions {
// (undocumented)
+1
View File
@@ -31,6 +31,7 @@ function entityUrl(context: BadgeContext): string {
return `${catalogUrl}/${entityUri}`.toLowerCase();
}
/** @public */
export const createDefaultBadgeFactories = (): BadgeFactories => ({
pingback: {
createBadge: (context: BadgeContext): Badge => {
@@ -19,6 +19,7 @@ import { makeBadge, Format } from 'badge-maker';
import { BadgeBuilder, BadgeInfo, BadgeOptions, BadgeSpec } from './types';
import { Badge, BadgeFactories } from '../../types';
/** @public */
export class DefaultBadgeBuilder implements BadgeBuilder {
constructor(private readonly factories: BadgeFactories) {}
@@ -16,15 +16,18 @@
import { Badge, BadgeContext } from '../../types';
/** @public */
export type BadgeInfo = {
id: string;
};
/** @public */
export type BadgeOptions = {
badgeInfo: BadgeInfo;
context: BadgeContext;
};
/** @public */
export type BadgeSpec = {
/** Badge id */
id: string;
@@ -39,6 +42,7 @@ export type BadgeSpec = {
markdown: string;
};
/** @public */
export type BadgeBuilder = {
getBadges(): Promise<BadgeInfo[]>;
createBadgeJson(options: BadgeOptions): Promise<BadgeSpec>;
@@ -26,6 +26,7 @@ import { NotFoundError } from '@backstage/errors';
import { BadgeBuilder, DefaultBadgeBuilder } from '../lib/BadgeBuilder';
import { BadgeContext, BadgeFactories } from '../types';
/** @public */
export interface RouterOptions {
badgeBuilder?: BadgeBuilder;
badgeFactories?: BadgeFactories;
@@ -34,6 +35,7 @@ export interface RouterOptions {
discovery: PluginEndpointDiscovery;
}
/** @public */
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
+7
View File
@@ -17,6 +17,7 @@
import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
/** @public */
export const BADGE_STYLES = [
'plastic',
'flat',
@@ -24,8 +25,11 @@ export const BADGE_STYLES = [
'for-the-badge',
'social',
] as const;
/** @public */
export type BadgeStyle = typeof BADGE_STYLES[number];
/** @public */
export interface Badge {
/** Badge message background color. */
color?: string;
@@ -48,16 +52,19 @@ export interface Badge {
style?: BadgeStyle;
}
/** @public */
export interface BadgeContext {
badgeUrl: string;
config: Config;
entity?: Entity; // for entity badges
}
/** @public */
export interface BadgeFactory {
createBadge(context: BadgeContext): Badge;
}
/** @public */
export interface BadgeFactories {
[id: string]: BadgeFactory;
}
+1 -8
View File
@@ -7,18 +7,11 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
// Warning: (ae-missing-release-tag) "badgesPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const badgesPlugin: BackstagePlugin<{}, {}, {}>;
// Warning: (ae-missing-release-tag) "EntityBadgesDialog" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityBadgesDialog: ({
open,
onClose,
}: {
export const EntityBadgesDialog: (props: {
open: boolean;
onClose?: (() => any) | undefined;
}) => JSX.Element;
@@ -37,12 +37,11 @@ import {
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
type Props = {
export const EntityBadgesDialog = (props: {
open: boolean;
onClose?: () => any;
};
export const EntityBadgesDialog = ({ open, onClose }: Props) => {
}) => {
const { open, onClose } = props;
const theme = useTheme();
const { entity } = useAsyncEntity();
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
+2
View File
@@ -22,6 +22,7 @@ import {
identityApiRef,
} from '@backstage/core-plugin-api';
/** @public */
export const badgesPlugin = createPlugin({
id: 'badges',
apis: [
@@ -34,6 +35,7 @@ export const badgesPlugin = createPlugin({
],
});
/** @public */
export const EntityBadgesDialog = badgesPlugin.provide(
createComponentExtension({
name: 'EntityBadgesDialog',
+6 -18
View File
@@ -109,20 +109,13 @@ export const columnFactories: Readonly<{
createEntityRefColumn<T extends Entity>(options: {
defaultKind?: string;
}): TableColumn<T>;
createEntityRelationColumn<T_1 extends Entity>({
title,
relation,
defaultKind,
filter: entityFilter,
}: {
createEntityRelationColumn<T_1 extends Entity>(options: {
title: string;
relation: string;
defaultKind?: string | undefined;
filter?:
| {
kind: string;
}
| undefined;
defaultKind?: string;
filter?: {
kind: string;
};
}): TableColumn<T_1>;
createOwnerColumn<T_2 extends Entity>(): TableColumn<T_2>;
createDomainColumn<T_3 extends Entity>(): TableColumn<T_3>;
@@ -324,12 +317,7 @@ export const EntityTable: {
createEntityRefColumn<T_1 extends Entity>(options: {
defaultKind?: string | undefined;
}): TableColumn<T_1>;
createEntityRelationColumn<T_2 extends Entity>({
title,
relation,
defaultKind,
filter: entityFilter,
}: {
createEntityRelationColumn<T_2 extends Entity>(options: {
title: string;
relation: string;
defaultKind?: string | undefined;
@@ -70,17 +70,14 @@ export const columnFactories = Object.freeze({
),
};
},
createEntityRelationColumn<T extends Entity>({
title,
relation,
defaultKind,
filter: entityFilter,
}: {
createEntityRelationColumn<T extends Entity>(options: {
title: string;
relation: string;
defaultKind?: string;
filter?: { kind: string };
}): TableColumn<T> {
const { title, relation, defaultKind, filter: entityFilter } = options;
function getRelations(entity: T): CompoundEntityRef[] {
return getEntityRelations(entity, relation, entityFilter);
}
+1 -4
View File
@@ -44,10 +44,7 @@ export class CircleCIApi {
): Promise<BuildWithSteps>;
// (undocumented)
getBuilds(
{
limit,
offset,
}: {
pagination: {
limit: number;
offset: number;
},
+2 -1
View File
@@ -62,9 +62,10 @@ export class CircleCIApi {
}
async getBuilds(
{ limit = 10, offset = 0 }: { limit: number; offset: number },
pagination: { limit: number; offset: number },
options: Partial<CircleCIOptions>,
) {
const { limit = 10, offset = 0 } = pagination;
return getBuildSummaries('', {
options: {
limit,
+4 -14
View File
@@ -128,18 +128,14 @@ export const EntityCloudbuildContent: () => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityLatestCloudbuildRunCard: ({
branch,
}: {
export const EntityLatestCloudbuildRunCard: (props: {
branch: string;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityLatestCloudbuildsForBranchCard: ({
branch,
}: {
export const EntityLatestCloudbuildsForBranchCard: (props: {
branch: string;
}) => JSX.Element;
@@ -163,18 +159,12 @@ export { isCloudbuildAvailable as isPluginApplicableToEntity };
// Warning: (ae-missing-release-tag) "LatestWorkflowRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const LatestWorkflowRunCard: ({
branch,
}: {
branch: string;
}) => JSX.Element;
export const LatestWorkflowRunCard: (props: { branch: string }) => JSX.Element;
// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const LatestWorkflowsForBranchCard: ({
branch,
}: {
export const LatestWorkflowsForBranchCard: (props: {
branch: string;
}) => JSX.Element;
@@ -72,11 +72,8 @@ const WidgetContent = ({
);
};
export const LatestWorkflowRunCard = ({
branch = 'master',
}: {
branch: string;
}) => {
export const LatestWorkflowRunCard = (props: { branch: string }) => {
const { branch = 'master' } = props;
const { entity } = useEntity();
const errorApi = useApi(errorApiRef);
const projectId = entity?.metadata.annotations?.[CLOUDBUILD_ANNOTATION] || '';
@@ -103,11 +100,8 @@ export const LatestWorkflowRunCard = ({
);
};
export const LatestWorkflowsForBranchCard = ({
branch = 'master',
}: {
branch: string;
}) => {
export const LatestWorkflowsForBranchCard = (props: { branch: string }) => {
const { branch = 'master' } = props;
const { entity } = useEntity();
return (
@@ -61,8 +61,8 @@ const useStyles = makeStyles<Theme>(theme => ({
},
}));
export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => {
const { value: projectName, loading, error } = useProjectName(entity);
export const WorkflowRunDetails = (props: { entity: Entity }) => {
const { value: projectName, loading, error } = useProjectName(props.entity);
const [projectId] = (projectName ?? '/').split('/');
const details = useWorkflowRunsDetails(projectId);
@@ -23,11 +23,8 @@ import {
StatusError,
} from '@backstage/core-components';
export const WorkflowRunStatus = ({
status,
}: {
status: string | undefined;
}) => {
export const WorkflowRunStatus = (props: { status: string | undefined }) => {
const { status } = props;
if (status === undefined) return null;
switch (status.toLocaleLowerCase('en-US')) {
case 'queued':
@@ -164,8 +164,8 @@ export const WorkflowRunsTableView = ({
);
};
export const WorkflowRunsTable = ({ entity }: { entity: Entity }) => {
const { value: projectName, loading } = useProjectName(entity);
export const WorkflowRunsTable = (props: { entity: Entity }) => {
const { value: projectName, loading } = useProjectName(props.entity);
const [projectId] = (projectName ?? '/').split('/');
const [tableProps, { retry, setPage, setPageSize }] = useWorkflowRuns({
@@ -33,7 +33,8 @@ export type WorkflowRun = {
rerun: () => void;
};
export function useWorkflowRuns({ projectId }: { projectId: string }) {
export function useWorkflowRuns(options: { projectId: string }) {
const { projectId } = options;
const api = useApi(cloudbuildApiRef);
const errorApi = useApi(errorApiRef);
+4 -15
View File
@@ -208,16 +208,10 @@ export interface GroupedResponses extends DeploymentResources {
// @public (undocumented)
export const GroupedResponsesContext: React_2.Context<GroupedResponses>;
// Warning: (ae-missing-release-tag) "HorizontalPodAutoscalerDrawer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const HorizontalPodAutoscalerDrawer: ({
hpa,
expanded,
children,
}: {
export const HorizontalPodAutoscalerDrawer: (props: {
hpa: V1HorizontalPodAutoscaler;
expanded?: boolean | undefined;
expanded?: boolean;
children?: React_2.ReactNode;
}) => JSX.Element;
@@ -361,15 +355,10 @@ const kubernetesPlugin: BackstagePlugin<
export { kubernetesPlugin };
export { kubernetesPlugin as plugin };
// Warning: (ae-missing-release-tag) "PodDrawer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const PodDrawer: ({
pod,
expanded,
}: {
export const PodDrawer: (props: {
pod: V1Pod;
expanded?: boolean | undefined;
expanded?: boolean;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "PodNamesWithErrorsContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -18,15 +18,14 @@ import React from 'react';
import { V1HorizontalPodAutoscaler } from '@kubernetes/client-node';
import { KubernetesDrawer } from '../KubernetesDrawer/KubernetesDrawer';
export const HorizontalPodAutoscalerDrawer = ({
hpa,
expanded,
children,
}: {
/** @public */
export const HorizontalPodAutoscalerDrawer = (props: {
hpa: V1HorizontalPodAutoscaler;
expanded?: boolean;
children?: React.ReactNode;
}) => {
const { hpa, expanded, children } = props;
return (
<KubernetesDrawer
kind="HorizontalPodAutoscaler"
@@ -13,4 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { HorizontalPodAutoscalerDrawer } from './HorizontalPodAutoscalerDrawer';
+4 -7
View File
@@ -25,13 +25,10 @@ import {
} from '../../utils/pod';
import { KubernetesDrawer } from '../KubernetesDrawer/KubernetesDrawer';
export const PodDrawer = ({
pod,
expanded,
}: {
pod: V1Pod;
expanded?: boolean;
}) => {
/** @public */
export const PodDrawer = (props: { pod: V1Pod; expanded?: boolean }) => {
const { pod, expanded } = props;
return (
<KubernetesDrawer
object={pod}
+4 -14
View File
@@ -456,11 +456,7 @@ export class DatabaseTaskStore implements TaskStore {
// (undocumented)
claimTask(): Promise<SerializedTask | undefined>;
// (undocumented)
completeTask({
taskId,
status,
eventBody,
}: {
completeTask(options: {
taskId: string;
status: TaskStatus;
eventBody: JsonObject;
@@ -488,11 +484,11 @@ export class DatabaseTaskStore implements TaskStore {
tasks: SerializedTask[];
}>;
// (undocumented)
listEvents({ taskId, after }: TaskStoreListEventsOptions): Promise<{
listEvents(options: TaskStoreListEventsOptions): Promise<{
events: SerializedTaskEvent[];
}>;
// (undocumented)
listStaleTasks({ timeoutS }: { timeoutS: number }): Promise<{
listStaleTasks(options: { timeoutS: number }): Promise<{
tasks: {
taskId: string;
}[];
@@ -508,13 +504,7 @@ export type DatabaseTaskStoreOptions = {
export const executeShellCommand: (options: RunCommandOptions) => Promise<void>;
// @public
export function fetchContents({
reader,
integrations,
baseUrl,
fetchUrl,
outputPath,
}: {
export function fetchContents(options: {
reader: UrlReader;
integrations: ScmIntegrations;
baseUrl?: string;
@@ -26,19 +26,15 @@ import path from 'path';
*
* @public
*/
export async function fetchContents({
reader,
integrations,
baseUrl,
fetchUrl = '.',
outputPath,
}: {
export async function fetchContents(options: {
reader: UrlReader;
integrations: ScmIntegrations;
baseUrl?: string;
fetchUrl?: string;
outputPath: string;
}) {
const { reader, integrations, baseUrl, fetchUrl = '.', outputPath } = options;
let fetchUrlIsAbsolute = false;
try {
// eslint-disable-next-line no-new
@@ -211,9 +211,11 @@ export class DatabaseTaskStore implements TaskStore {
}
}
async listStaleTasks({ timeoutS }: { timeoutS: number }): Promise<{
async listStaleTasks(options: { timeoutS: number }): Promise<{
tasks: { taskId: string }[];
}> {
const { timeoutS } = options;
const rawRows = await this.db<RawDbTaskRow>('tasks')
.where('status', 'processing')
.andWhere(
@@ -232,15 +234,13 @@ export class DatabaseTaskStore implements TaskStore {
return { tasks };
}
async completeTask({
taskId,
status,
eventBody,
}: {
async completeTask(options: {
taskId: string;
status: TaskStatus;
eventBody: JsonObject;
}): Promise<void> {
const { taskId, status, eventBody } = options;
let oldStatus: string;
if (status === 'failed' || status === 'completed') {
oldStatus = 'processing';
@@ -301,10 +301,10 @@ export class DatabaseTaskStore implements TaskStore {
});
}
async listEvents({
taskId,
after,
}: TaskStoreListEventsOptions): Promise<{ events: SerializedTaskEvent[] }> {
async listEvents(
options: TaskStoreListEventsOptions,
): Promise<{ events: SerializedTaskEvent[] }> {
const { taskId, after } = options;
const rawEvents = await this.db<RawDbTaskEventRow>('task_events')
.where({
task_id: taskId,
@@ -132,17 +132,13 @@ export class ElasticSearchClientWrapper {
refreshOnCompletion?: string | boolean;
}): BulkHelper<BulkStats>;
// (undocumented)
createIndex({
index,
}: {
createIndex(options: {
index: string;
}):
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
| TransportRequestPromise_2<ApiResponse_2<Record<string, any>, unknown>>;
// (undocumented)
deleteIndex({
index,
}: {
deleteIndex(options: {
index: string | string[];
}):
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
@@ -152,17 +148,13 @@ export class ElasticSearchClientWrapper {
options: ElasticSearchClientOptions,
): ElasticSearchClientWrapper;
// (undocumented)
getAliases({
aliases,
}: {
getAliases(options: {
aliases: string[];
}):
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
| TransportRequestPromise_2<ApiResponse_2<Record<string, any>, unknown>>;
// (undocumented)
indexExists({
index,
}: {
indexExists(options: {
index: string | string[];
}):
| TransportRequestPromise<ApiResponse<boolean, unknown>>
@@ -174,19 +166,14 @@ export class ElasticSearchClientWrapper {
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
| TransportRequestPromise_2<ApiResponse_2<Record<string, any>, unknown>>;
// (undocumented)
search({
index,
body,
}: {
search(options: {
index: string | string[];
body: Object;
}):
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
| TransportRequestPromise_2<ApiResponse_2<Record<string, any>, unknown>>;
// (undocumented)
updateAliases({
actions,
}: {
updateAliases(options: {
actions: ElasticSearchAliasAction[];
}):
| TransportRequestPromise<ApiResponse<Record<string, any>, unknown>>
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Client as ElasticSearchClient } from '@elastic/elasticsearch';
import { Client as OpenSearchClient } from '@opensearch-project/opensearch';
import { Readable } from 'stream';
@@ -69,15 +70,12 @@ export class ElasticSearchClientWrapper {
private readonly elasticSearchClient: ElasticSearchClient | undefined;
private readonly openSearchClient: OpenSearchClient | undefined;
private constructor({
openSearchClient,
elasticSearchClient,
}: {
private constructor(options: {
openSearchClient?: OpenSearchClient;
elasticSearchClient?: ElasticSearchClient;
}) {
this.openSearchClient = openSearchClient;
this.elasticSearchClient = elasticSearchClient;
this.openSearchClient = options.openSearchClient;
this.elasticSearchClient = options.elasticSearchClient;
}
static fromClientOptions(options: ElasticSearchClientOptions) {
@@ -92,13 +90,13 @@ export class ElasticSearchClientWrapper {
});
}
search({ index, body }: { index: string | string[]; body: Object }) {
search(options: { index: string | string[]; body: Object }) {
if (this.openSearchClient) {
return this.openSearchClient.search({ index, body });
return this.openSearchClient.search(options);
}
if (this.elasticSearchClient) {
return this.elasticSearchClient.search({ index, body });
return this.elasticSearchClient.search(options);
}
throw new Error('No client defined');
@@ -132,43 +130,45 @@ export class ElasticSearchClientWrapper {
throw new Error('No client defined');
}
indexExists({ index }: { index: string | string[] }) {
indexExists(options: { index: string | string[] }) {
if (this.openSearchClient) {
return this.openSearchClient.indices.exists({ index });
return this.openSearchClient.indices.exists(options);
}
if (this.elasticSearchClient) {
return this.elasticSearchClient.indices.exists({ index });
return this.elasticSearchClient.indices.exists(options);
}
throw new Error('No client defined');
}
deleteIndex({ index }: { index: string | string[] }) {
deleteIndex(options: { index: string | string[] }) {
if (this.openSearchClient) {
return this.openSearchClient.indices.delete({ index });
return this.openSearchClient.indices.delete(options);
}
if (this.elasticSearchClient) {
return this.elasticSearchClient.indices.delete({ index });
return this.elasticSearchClient.indices.delete(options);
}
throw new Error('No client defined');
}
createIndex({ index }: { index: string }) {
createIndex(options: { index: string }) {
if (this.openSearchClient) {
return this.openSearchClient.indices.create({ index });
return this.openSearchClient.indices.create(options);
}
if (this.elasticSearchClient) {
return this.elasticSearchClient.indices.create({ index });
return this.elasticSearchClient.indices.create(options);
}
throw new Error('No client defined');
}
getAliases({ aliases }: { aliases: string[] }) {
getAliases(options: { aliases: string[] }) {
const { aliases } = options;
if (this.openSearchClient) {
return this.openSearchClient.cat.aliases({
format: 'json',
@@ -186,8 +186,9 @@ export class ElasticSearchClientWrapper {
throw new Error('No client defined');
}
updateAliases({ actions }: { actions: ElasticSearchAliasAction[] }) {
const filteredActions = actions.filter(Boolean);
updateAliases(options: { actions: ElasticSearchAliasAction[] }) {
const filteredActions = options.actions.filter(Boolean);
if (this.openSearchClient) {
return this.openSearchClient.indices.updateAliases({
body: {
+5 -13
View File
@@ -13,13 +13,10 @@ export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public
export class DefaultSonarqubeInfoProvider implements SonarqubeInfoProvider {
static fromConfig(config: Config): DefaultSonarqubeInfoProvider;
getBaseUrl({ instanceName }?: { instanceName?: string }): {
getBaseUrl(options?: { instanceName?: string }): {
baseUrl: string;
};
getFindings({
componentKey,
instanceName,
}: {
getFindings(options: {
componentKey: string;
instanceName?: string;
}): Promise<SonarqubeFindings | undefined>;
@@ -35,9 +32,7 @@ export interface RouterOptions {
export class SonarqubeConfig {
constructor(instances: SonarqubeInstanceConfig[]);
static fromConfig(config: Config): SonarqubeConfig;
getInstanceConfig({
sonarqubeName,
}?: {
getInstanceConfig(options?: {
sonarqubeName?: string;
}): SonarqubeInstanceConfig;
// (undocumented)
@@ -52,13 +47,10 @@ export interface SonarqubeFindings {
// @public
export interface SonarqubeInfoProvider {
getBaseUrl({ instanceName }?: { instanceName?: string }): {
getBaseUrl(options?: { instanceName?: string }): {
baseUrl: string;
};
getFindings({
componentKey,
instanceName,
}: {
getFindings(options: {
componentKey: string;
instanceName?: string;
}): Promise<SonarqubeFindings | undefined>;
@@ -30,7 +30,7 @@ export interface SonarqubeInfoProvider {
* @param instanceName - Name of the sonarqube instance to get the info from
* @returns the url of the instance
*/
getBaseUrl({ instanceName }?: { instanceName?: string }): { baseUrl: string };
getBaseUrl(options?: { instanceName?: string }): { baseUrl: string };
/**
* Query the sonarqube instance corresponding to the instanceName to get all
@@ -43,10 +43,7 @@ export interface SonarqubeInfoProvider {
* @returns All measures with the analysis date. Will return undefined if we
* can't provide the full response
*/
getFindings({
componentKey,
instanceName,
}: {
getFindings(options: {
componentKey: string;
instanceName?: string;
}): Promise<SonarqubeFindings | undefined>;
@@ -185,9 +182,10 @@ export class SonarqubeConfig {
* @returns The requested Sonarqube instance.
* @throws Error when no default config could be found or the requested name couldn't be found in config.
*/
getInstanceConfig({
sonarqubeName,
}: { sonarqubeName?: string } = {}): SonarqubeInstanceConfig {
getInstanceConfig(
options: { sonarqubeName?: string } = {},
): SonarqubeInstanceConfig {
const { sonarqubeName } = options;
const DEFAULT_SONARQUBE_NAME = 'default';
if (!sonarqubeName || sonarqubeName === DEFAULT_SONARQUBE_NAME) {
@@ -303,11 +301,11 @@ export class DefaultSonarqubeInfoProvider implements SonarqubeInfoProvider {
* {@inheritDoc SonarqubeInfoProvider.getBaseUrl}
* @throws Error If configuration can't be retrieved.
*/
getBaseUrl({ instanceName }: { instanceName?: string } = {}): {
getBaseUrl(options: { instanceName?: string } = {}): {
baseUrl: string;
} {
const instanceConfig = this.config.getInstanceConfig({
sonarqubeName: instanceName,
sonarqubeName: options.instanceName,
});
return { baseUrl: instanceConfig.baseUrl };
}
@@ -316,13 +314,11 @@ export class DefaultSonarqubeInfoProvider implements SonarqubeInfoProvider {
* {@inheritDoc SonarqubeInfoProvider.getFindings}
* @throws Error If configuration can't be retrieved.
*/
async getFindings({
componentKey,
instanceName,
}: {
async getFindings(options: {
componentKey: string;
instanceName?: string;
}): Promise<SonarqubeFindings | undefined> {
const { componentKey, instanceName } = options;
const { baseUrl, apiKey } = this.config.getInstanceConfig({
sonarqubeName: instanceName,
});
+2 -4
View File
@@ -353,10 +353,8 @@ export type TechDocsReaderPageRenderFunction = (options: {
}) => JSX.Element;
// @public
export const TechDocsReaderPageSubheader: ({
toolbarProps,
}: {
toolbarProps?: ToolbarProps<'div', {}> | undefined;
export const TechDocsReaderPageSubheader: (props: {
toolbarProps?: ToolbarProps;
}) => JSX.Element | null;
// @public
@@ -47,9 +47,7 @@ const useStyles = makeStyles(theme => ({
* Please use the Tech Docs add-ons to customize it
* @public
*/
export const TechDocsReaderPageSubheader = ({
toolbarProps,
}: {
export const TechDocsReaderPageSubheader = (props: {
toolbarProps?: ToolbarProps;
}) => {
const classes = useStyles();
@@ -81,7 +79,7 @@ export const TechDocsReaderPageSubheader = ({
if (entityMetadataLoading === false && !entityMetadata) return null;
return (
<Toolbar classes={classes} {...toolbarProps}>
<Toolbar classes={classes} {...props.toolbarProps}>
<Box
display="flex"
justifyContent="flex-end"
-3
View File
@@ -201,11 +201,8 @@ const ALLOW_WARNINGS = [
'packages/core-components',
'plugins/allure',
'plugins/apache-airflow',
'plugins/api-docs',
'plugins/app-backend',
'plugins/auth-backend',
'plugins/badges',
'plugins/badges-backend',
'plugins/bitrise',
'plugins/catalog',
'plugins/catalog-graphql',