From ef9ab322dea45a93af5498f601e85817e43e153f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 18 Aug 2022 16:58:54 +0200 Subject: [PATCH] it just keeps :broom: -ing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/tough-dolphins-smile.md | 19 ++++++++ packages/catalog-client/api-report.md | 2 +- packages/catalog-client/src/CatalogClient.ts | 4 +- packages/core-plugin-api/api-report.md | 5 +-- .../src/plugin-options/usePluginOptions.tsx | 9 ++-- plugins/api-docs/api-report.md | 45 +++++-------------- .../ApiDefinitionCard/ApiDefinitionCard.tsx | 1 + .../ApiDefinitionCard/ApiDefinitionWidget.tsx | 2 + .../DefaultApiExplorerPage.tsx | 8 ++-- .../AsyncApiDefinitionWidget.tsx | 2 + .../ProvidingComponentsCard.tsx | 1 + .../GraphQlDefinitionWidget.tsx | 2 + .../GrpcApiDefinitionWidget.tsx | 2 + .../OpenApiDefinitionWidget.tsx | 2 + .../PlainApiDefinitionWidget.tsx | 2 + plugins/api-docs/src/config.ts | 2 + plugins/api-docs/src/index.ts | 1 + plugins/api-docs/src/plugin.ts | 1 + plugins/apollo-explorer/api-report.md | 6 +-- .../ApolloExplorerPage/ApolloExplorerPage.tsx | 3 +- plugins/azure-devops-backend/api-report.md | 5 +-- .../src/api/AzureDevOpsApi.ts | 6 +-- plugins/badges-backend/api-report.md | 28 ------------ plugins/badges-backend/src/badges.ts | 1 + .../lib/BadgeBuilder/DefaultBadgeBuilder.ts | 1 + .../src/lib/BadgeBuilder/types.ts | 4 ++ plugins/badges-backend/src/service/router.ts | 2 + plugins/badges-backend/src/types.ts | 7 +++ plugins/badges/api-report.md | 9 +--- .../src/components/EntityBadgesDialog.tsx | 7 ++- plugins/badges/src/plugin.ts | 2 + plugins/catalog-react/api-report.md | 24 +++------- .../src/components/EntityTable/columns.tsx | 9 ++-- plugins/circleci/api-report.md | 5 +-- plugins/circleci/src/api/CircleCIApi.ts | 3 +- plugins/cloudbuild/api-report.md | 18 ++------ .../cloudbuild/src/components/Cards/Cards.tsx | 14 ++---- .../WorkflowRunDetails/WorkflowRunDetails.tsx | 4 +- .../WorkflowRunStatus/WorkflowRunStatus.tsx | 7 +-- .../WorkflowRunsTable/WorkflowRunsTable.tsx | 4 +- .../src/components/useWorkflowRuns.ts | 3 +- plugins/kubernetes/api-report.md | 19 ++------ .../HorizontalPodAutoscalerDrawer.tsx | 9 ++-- .../HorizontalPodAutoscalers/index.ts | 1 + .../src/components/Pods/PodDrawer.tsx | 11 ++--- plugins/scaffolder-backend/api-report.md | 18 ++------ .../actions/builtin/fetch/helpers.ts | 10 ++--- .../src/scaffolder/tasks/DatabaseTaskStore.ts | 20 ++++----- .../api-report.md | 25 +++-------- .../src/engines/ElasticSearchClientWrapper.ts | 43 +++++++++--------- plugins/sonarqube-backend/api-report.md | 18 +++----- .../src/service/sonarqubeInfoProvider.ts | 24 +++++----- plugins/techdocs/api-report.md | 6 +-- .../TechDocsReaderPageSubheader.tsx | 6 +-- scripts/api-extractor.ts | 3 -- 55 files changed, 193 insertions(+), 302 deletions(-) create mode 100644 .changeset/tough-dolphins-smile.md diff --git a/.changeset/tough-dolphins-smile.md b/.changeset/tough-dolphins-smile.md new file mode 100644 index 0000000000..bb4f0a39a8 --- /dev/null +++ b/.changeset/tough-dolphins-smile.md @@ -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 diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 5fcae87dd5..964a3c1018 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -78,7 +78,7 @@ export class CatalogClient implements CatalogApi { }; }); addLocation( - { type, target, dryRun }: AddLocationRequest, + request: AddLocationRequest, options?: CatalogRequestOptions, ): Promise; getEntities( diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index 371ac55db4..8ddc3eb36d 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -272,9 +272,11 @@ export class CatalogClient implements CatalogApi { * {@inheritdoc CatalogApi.addLocation} */ async addLocation( - { type = 'url', target, dryRun }: AddLocationRequest, + request: AddLocationRequest, options?: CatalogRequestOptions, ): Promise { + const { type = 'url', target, dryRun } = request; + const response = await this.fetchApi.fetch( `${await this.discoveryApi.getBaseUrl('catalog')}/locations${ dryRun ? '?dryRun=true' : '' diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 87fc344a02..0738d7bac5 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -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 = { diff --git a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx index 82684636d6..4fdacc1ace 100644 --- a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx +++ b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx @@ -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); diff --git a/plugins/api-docs/api-report.md b/plugins/api-docs/api-report.md index 9f226e52c7..0872d97355 100644 --- a/plugins/api-docs/api-report.md +++ b/plugins/api-docs/api-report.md @@ -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; -// 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['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; diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx index 353b973626..679069f209 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx @@ -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(); const config = useApi(apiDocsConfigRef); diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx index 3b7aa406d4..03a56eaa78 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx @@ -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 [ { diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx index b0acd3567c..ad43205c5f 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx @@ -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' diff --git a/plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx b/plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx index 03bc6fa8a6..2e8710b008 100644 --- a/plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx @@ -25,10 +25,12 @@ const LazyAsyncApiDefinition = React.lazy(() => })), ); +/** @public */ export type AsyncApiDefinitionWidgetProps = { definition: string; }; +/** @public */ export const AsyncApiDefinitionWidget = ( props: AsyncApiDefinitionWidgetProps, ) => { diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx index 939257a2e5..435021e008 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx @@ -34,6 +34,7 @@ import { WarningPanel, } from '@backstage/core-components'; +/** @public */ export const ProvidingComponentsCard = (props: { variant?: InfoCardVariants; }) => { diff --git a/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx b/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx index 1f8a796249..b5cf06e828 100644 --- a/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx @@ -25,10 +25,12 @@ const LazyGraphQlDefinition = React.lazy(() => })), ); +/** @public */ export type GraphQlDefinitionWidgetProps = { definition: string; }; +/** @public */ export const GraphQlDefinitionWidget = ( props: GraphQlDefinitionWidgetProps, ) => { diff --git a/plugins/api-docs/src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx b/plugins/api-docs/src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx index c5f9b071ef..b6bf317099 100644 --- a/plugins/api-docs/src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx @@ -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, ) => { diff --git a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx index 606e476454..424a52136b 100644 --- a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx @@ -25,10 +25,12 @@ const LazyOpenApiDefinition = React.lazy(() => })), ); +/** @public */ export type OpenApiDefinitionWidgetProps = { definition: string; }; +/** @public */ export const OpenApiDefinitionWidget = ( props: OpenApiDefinitionWidgetProps, ) => { diff --git a/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx b/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx index b7f1e8afc0..c7d7d83c8d 100644 --- a/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx @@ -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, ) => { diff --git a/plugins/api-docs/src/config.ts b/plugins/api-docs/src/config.ts index 979340164b..4d1e650720 100644 --- a/plugins/api-docs/src/config.ts +++ b/plugins/api-docs/src/config.ts @@ -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({ id: 'plugin.api-docs.config', }); +/** @public */ export interface ApiDocsConfig { getApiDefinitionWidget: ( apiEntity: ApiEntity, diff --git a/plugins/api-docs/src/index.ts b/plugins/api-docs/src/index.ts index fe98e9c70e..49b2805aad 100644 --- a/plugins/api-docs/src/index.ts +++ b/plugins/api-docs/src/index.ts @@ -21,6 +21,7 @@ */ export * from './components'; +export type { ApiDocsConfig } from './config'; export { apiDocsConfigRef } from './config'; export { apiDocsPlugin, diff --git a/plugins/api-docs/src/plugin.ts b/plugins/api-docs/src/plugin.ts index 2a10a3afcd..cabe2d82cd 100644 --- a/plugins/api-docs/src/plugin.ts +++ b/plugins/api-docs/src/plugin.ts @@ -25,6 +25,7 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const apiDocsPlugin = createPlugin({ id: 'api-docs', routes: { diff --git a/plugins/apollo-explorer/api-report.md b/plugins/apollo-explorer/api-report.md index 80dae62e60..1d3b41eac1 100644 --- a/plugins/apollo-explorer/api-report.md +++ b/plugins/apollo-explorer/api-report.md @@ -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: { diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx index c2c02fc646..f90af9bc17 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx +++ b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx @@ -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 (
diff --git a/plugins/azure-devops-backend/api-report.md b/plugins/azure-devops-backend/api-report.md index 712a433920..5918195827 100644 --- a/plugins/azure-devops-backend/api-report.md +++ b/plugins/azure-devops-backend/api-report.md @@ -77,10 +77,7 @@ export class AzureDevOpsApi { top: number, ): Promise; // (undocumented) - getTeamMembers({ - projectId, - teamId, - }: { + getTeamMembers(options: { projectId: string; teamId: string; }): Promise; diff --git a/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts b/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts index 13edd7419d..3bffa925f5 100644 --- a/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts +++ b/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts @@ -296,13 +296,11 @@ export class AzureDevOpsApi { ); } - public async getTeamMembers({ - projectId, - teamId, - }: { + public async getTeamMembers(options: { projectId: string; teamId: string; }): Promise { + const { projectId, teamId } = options; this.logger?.debug(`Getting team member ids for team '${teamId}'.`); const client = await this.webApi.getCoreApi(); diff --git a/plugins/badges-backend/api-report.md b/plugins/badges-backend/api-report.md index 0660d23fdb..0ecf41ee85 100644 --- a/plugins/badges-backend/api-report.md +++ b/plugins/badges-backend/api-report.md @@ -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; @@ -43,8 +37,6 @@ export type BadgeBuilder = { createBadgeSvg(options: BadgeOptions): Promise; }; -// 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; -// 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) diff --git a/plugins/badges-backend/src/badges.ts b/plugins/badges-backend/src/badges.ts index 78108de080..9167116d95 100644 --- a/plugins/badges-backend/src/badges.ts +++ b/plugins/badges-backend/src/badges.ts @@ -31,6 +31,7 @@ function entityUrl(context: BadgeContext): string { return `${catalogUrl}/${entityUri}`.toLowerCase(); } +/** @public */ export const createDefaultBadgeFactories = (): BadgeFactories => ({ pingback: { createBadge: (context: BadgeContext): Badge => { diff --git a/plugins/badges-backend/src/lib/BadgeBuilder/DefaultBadgeBuilder.ts b/plugins/badges-backend/src/lib/BadgeBuilder/DefaultBadgeBuilder.ts index 78e34351a0..efe58078f7 100644 --- a/plugins/badges-backend/src/lib/BadgeBuilder/DefaultBadgeBuilder.ts +++ b/plugins/badges-backend/src/lib/BadgeBuilder/DefaultBadgeBuilder.ts @@ -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) {} diff --git a/plugins/badges-backend/src/lib/BadgeBuilder/types.ts b/plugins/badges-backend/src/lib/BadgeBuilder/types.ts index e2be17a7db..fa1dd4a5ad 100644 --- a/plugins/badges-backend/src/lib/BadgeBuilder/types.ts +++ b/plugins/badges-backend/src/lib/BadgeBuilder/types.ts @@ -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; createBadgeJson(options: BadgeOptions): Promise; diff --git a/plugins/badges-backend/src/service/router.ts b/plugins/badges-backend/src/service/router.ts index b7211a0aad..2006b45dc4 100644 --- a/plugins/badges-backend/src/service/router.ts +++ b/plugins/badges-backend/src/service/router.ts @@ -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 { diff --git a/plugins/badges-backend/src/types.ts b/plugins/badges-backend/src/types.ts index 0467b18155..eec7063f88 100644 --- a/plugins/badges-backend/src/types.ts +++ b/plugins/badges-backend/src/types.ts @@ -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; } diff --git a/plugins/badges/api-report.md b/plugins/badges/api-report.md index e3af0857a4..b051bbb452 100644 --- a/plugins/badges/api-report.md +++ b/plugins/badges/api-report.md @@ -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; diff --git a/plugins/badges/src/components/EntityBadgesDialog.tsx b/plugins/badges/src/components/EntityBadgesDialog.tsx index 422dbc96a3..097bba5581 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.tsx @@ -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')); diff --git a/plugins/badges/src/plugin.ts b/plugins/badges/src/plugin.ts index ee88fb31e0..7ef3025458 100644 --- a/plugins/badges/src/plugin.ts +++ b/plugins/badges/src/plugin.ts @@ -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', diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index 5232c49150..6e0ba235b7 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -109,20 +109,13 @@ export const columnFactories: Readonly<{ createEntityRefColumn(options: { defaultKind?: string; }): TableColumn; - createEntityRelationColumn({ - title, - relation, - defaultKind, - filter: entityFilter, - }: { + createEntityRelationColumn(options: { title: string; relation: string; - defaultKind?: string | undefined; - filter?: - | { - kind: string; - } - | undefined; + defaultKind?: string; + filter?: { + kind: string; + }; }): TableColumn; createOwnerColumn(): TableColumn; createDomainColumn(): TableColumn; @@ -324,12 +317,7 @@ export const EntityTable: { createEntityRefColumn(options: { defaultKind?: string | undefined; }): TableColumn; - createEntityRelationColumn({ - title, - relation, - defaultKind, - filter: entityFilter, - }: { + createEntityRelationColumn(options: { title: string; relation: string; defaultKind?: string | undefined; diff --git a/plugins/catalog-react/src/components/EntityTable/columns.tsx b/plugins/catalog-react/src/components/EntityTable/columns.tsx index 72b6931e94..292235c78c 100644 --- a/plugins/catalog-react/src/components/EntityTable/columns.tsx +++ b/plugins/catalog-react/src/components/EntityTable/columns.tsx @@ -70,17 +70,14 @@ export const columnFactories = Object.freeze({ ), }; }, - createEntityRelationColumn({ - title, - relation, - defaultKind, - filter: entityFilter, - }: { + createEntityRelationColumn(options: { title: string; relation: string; defaultKind?: string; filter?: { kind: string }; }): TableColumn { + const { title, relation, defaultKind, filter: entityFilter } = options; + function getRelations(entity: T): CompoundEntityRef[] { return getEntityRelations(entity, relation, entityFilter); } diff --git a/plugins/circleci/api-report.md b/plugins/circleci/api-report.md index e8640ec78b..034cfae3ee 100644 --- a/plugins/circleci/api-report.md +++ b/plugins/circleci/api-report.md @@ -44,10 +44,7 @@ export class CircleCIApi { ): Promise; // (undocumented) getBuilds( - { - limit, - offset, - }: { + pagination: { limit: number; offset: number; }, diff --git a/plugins/circleci/src/api/CircleCIApi.ts b/plugins/circleci/src/api/CircleCIApi.ts index 78b8b378d6..931feec4d5 100644 --- a/plugins/circleci/src/api/CircleCIApi.ts +++ b/plugins/circleci/src/api/CircleCIApi.ts @@ -62,9 +62,10 @@ export class CircleCIApi { } async getBuilds( - { limit = 10, offset = 0 }: { limit: number; offset: number }, + pagination: { limit: number; offset: number }, options: Partial, ) { + const { limit = 10, offset = 0 } = pagination; return getBuildSummaries('', { options: { limit, diff --git a/plugins/cloudbuild/api-report.md b/plugins/cloudbuild/api-report.md index 5d2dc325e4..34b50b54d8 100644 --- a/plugins/cloudbuild/api-report.md +++ b/plugins/cloudbuild/api-report.md @@ -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; diff --git a/plugins/cloudbuild/src/components/Cards/Cards.tsx b/plugins/cloudbuild/src/components/Cards/Cards.tsx index 82e0eb1b88..75c9ee432b 100644 --- a/plugins/cloudbuild/src/components/Cards/Cards.tsx +++ b/plugins/cloudbuild/src/components/Cards/Cards.tsx @@ -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 ( diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index a6a63770ca..0e532178e1 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -61,8 +61,8 @@ const useStyles = makeStyles(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); diff --git a/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx b/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx index 3f43d84ce4..fce8566dc0 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx @@ -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': diff --git a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index d79d481cd4..a8e2a12ea8 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -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({ diff --git a/plugins/cloudbuild/src/components/useWorkflowRuns.ts b/plugins/cloudbuild/src/components/useWorkflowRuns.ts index f2e107ea3f..424f08e38d 100644 --- a/plugins/cloudbuild/src/components/useWorkflowRuns.ts +++ b/plugins/cloudbuild/src/components/useWorkflowRuns.ts @@ -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); diff --git a/plugins/kubernetes/api-report.md b/plugins/kubernetes/api-report.md index ccb4dcae8d..5cf1c3ed34 100644 --- a/plugins/kubernetes/api-report.md +++ b/plugins/kubernetes/api-report.md @@ -208,16 +208,10 @@ export interface GroupedResponses extends DeploymentResources { // @public (undocumented) export const GroupedResponsesContext: React_2.Context; -// 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) diff --git a/plugins/kubernetes/src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.tsx b/plugins/kubernetes/src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.tsx index 504a4f26bc..ca7abe07aa 100644 --- a/plugins/kubernetes/src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.tsx +++ b/plugins/kubernetes/src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.tsx @@ -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 ( { +/** @public */ +export const PodDrawer = (props: { pod: V1Pod; expanded?: boolean }) => { + const { pod, expanded } = props; + return ( ; // (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; // @public -export function fetchContents({ - reader, - integrations, - baseUrl, - fetchUrl, - outputPath, -}: { +export function fetchContents(options: { reader: UrlReader; integrations: ScmIntegrations; baseUrl?: string; diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts index a01fcee6f7..4b82595cfd 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts @@ -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 diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts index d62e59744f..978affb864 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts @@ -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('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 { + 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('task_events') .where({ task_id: taskId, diff --git a/plugins/search-backend-module-elasticsearch/api-report.md b/plugins/search-backend-module-elasticsearch/api-report.md index 5a951948c2..be54fe9d4a 100644 --- a/plugins/search-backend-module-elasticsearch/api-report.md +++ b/plugins/search-backend-module-elasticsearch/api-report.md @@ -132,17 +132,13 @@ export class ElasticSearchClientWrapper { refreshOnCompletion?: string | boolean; }): BulkHelper; // (undocumented) - createIndex({ - index, - }: { + createIndex(options: { index: string; }): | TransportRequestPromise, unknown>> | TransportRequestPromise_2, unknown>>; // (undocumented) - deleteIndex({ - index, - }: { + deleteIndex(options: { index: string | string[]; }): | TransportRequestPromise, unknown>> @@ -152,17 +148,13 @@ export class ElasticSearchClientWrapper { options: ElasticSearchClientOptions, ): ElasticSearchClientWrapper; // (undocumented) - getAliases({ - aliases, - }: { + getAliases(options: { aliases: string[]; }): | TransportRequestPromise, unknown>> | TransportRequestPromise_2, unknown>>; // (undocumented) - indexExists({ - index, - }: { + indexExists(options: { index: string | string[]; }): | TransportRequestPromise> @@ -174,19 +166,14 @@ export class ElasticSearchClientWrapper { | TransportRequestPromise, unknown>> | TransportRequestPromise_2, unknown>>; // (undocumented) - search({ - index, - body, - }: { + search(options: { index: string | string[]; body: Object; }): | TransportRequestPromise, unknown>> | TransportRequestPromise_2, unknown>>; // (undocumented) - updateAliases({ - actions, - }: { + updateAliases(options: { actions: ElasticSearchAliasAction[]; }): | TransportRequestPromise, unknown>> diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts index bcf67e091c..395f861223 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts @@ -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: { diff --git a/plugins/sonarqube-backend/api-report.md b/plugins/sonarqube-backend/api-report.md index f4c48cadce..0fbd463cf3 100644 --- a/plugins/sonarqube-backend/api-report.md +++ b/plugins/sonarqube-backend/api-report.md @@ -13,13 +13,10 @@ export function createRouter(options: RouterOptions): Promise; // @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; @@ -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; diff --git a/plugins/sonarqube-backend/src/service/sonarqubeInfoProvider.ts b/plugins/sonarqube-backend/src/service/sonarqubeInfoProvider.ts index 7027738d2c..2b96e6764e 100644 --- a/plugins/sonarqube-backend/src/service/sonarqubeInfoProvider.ts +++ b/plugins/sonarqube-backend/src/service/sonarqubeInfoProvider.ts @@ -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; @@ -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 { + const { componentKey, instanceName } = options; const { baseUrl, apiKey } = this.config.getInstanceConfig({ sonarqubeName: instanceName, }); diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 7922ea992e..b2f0331a9b 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -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 diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx index a0013e81ab..0cef4d521f 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx @@ -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 ( - +