backstage
72 строки · 2.0 Кб
1/*
2* Copyright 2020 The Backstage Authors
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16import { cloudbuildApiRef, CloudbuildClient } from './api';17import { rootRouteRef } from './routes';18import {19createPlugin,20createApiFactory,21googleAuthApiRef,22createRoutableExtension,23createComponentExtension,24} from '@backstage/core-plugin-api';25
26/** @public */
27export const cloudbuildPlugin = createPlugin({28id: 'cloudbuild',29apis: [30createApiFactory({31api: cloudbuildApiRef,32deps: { googleAuthApi: googleAuthApiRef },33factory({ googleAuthApi }) {34return new CloudbuildClient(googleAuthApi);35},36}),37],38routes: {39entityContent: rootRouteRef,40},41});42
43/** @public */
44export const EntityCloudbuildContent = cloudbuildPlugin.provide(45createRoutableExtension({46name: 'EntityCloudbuildContent',47component: () => import('./components/Router').then(m => m.Router),48mountPoint: rootRouteRef,49}),50);51
52/** @public */
53export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide(54createComponentExtension({55name: 'EntityLatestCloudbuildRunCard',56component: {57lazy: () =>58import('./components/Cards').then(m => m.LatestWorkflowRunCard),59},60}),61);62
63/** @public */
64export const EntityLatestCloudbuildsForBranchCard = cloudbuildPlugin.provide(65createComponentExtension({66name: 'EntityLatestCloudbuildsForBranchCard',67component: {68lazy: () =>69import('./components/Cards').then(m => m.LatestWorkflowsForBranchCard),70},71}),72);73