Moving KubernetesObjectsProvider interface to kubernetes-node to avoid a cyclic dependency

Signed-off-by: Andres Mauricio Gomez P <andmagom@outlook.com>
This commit is contained in:
Andres Mauricio Gomez P
2023-09-25 12:07:19 -05:00
committed by blam
parent 99c1ef9c26
commit 6b044e8840
14 changed files with 138 additions and 78 deletions
+32 -2
View File
@@ -3,13 +3,43 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { CustomResourceMatcher } from '@backstage/plugin-kubernetes-common';
import { Entity } from '@backstage/catalog-model';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { KubernetesObjectsProvider } from '@backstage/plugin-kubernetes-backend';
import { KubernetesObjectsProvider as KubernetesObjectsProvider_2 } from '@backstage/plugin-kubernetes-node';
import { KubernetesRequestAuth } from '@backstage/plugin-kubernetes-common';
import { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';
// @public (undocumented)
export interface CustomResourcesByEntity extends KubernetesObjectsByEntity {
// (undocumented)
customResources: CustomResourceMatcher[];
}
// @public (undocumented)
export interface KubernetesObjectsByEntity {
// (undocumented)
auth: KubernetesRequestAuth;
// (undocumented)
entity: Entity;
}
// @public (undocumented)
export interface KubernetesObjectsProvider {
// (undocumented)
getCustomResourcesByEntity(
customResourcesByEntity: CustomResourcesByEntity,
): Promise<ObjectsByEntityResponse>;
// (undocumented)
getKubernetesObjectsByEntity(
kubernetesObjectsByEntity: KubernetesObjectsByEntity,
): Promise<ObjectsByEntityResponse>;
}
// @public
export interface KubernetesObjectsProviderExtensionPoint {
// (undocumented)
addObjectsProvider(provider: KubernetesObjectsProvider): void;
addObjectsProvider(provider: KubernetesObjectsProvider_2): void;
}
// @public
+2 -1
View File
@@ -29,6 +29,7 @@
],
"dependencies": {
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/plugin-kubernetes-backend": "workspace:^"
"@backstage/catalog-model": "workspace:^",
"@backstage/plugin-kubernetes-common": "workspace:^"
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createExtensionPoint } from '@backstage/backend-plugin-api';
import { KubernetesObjectsProvider } from '@backstage/plugin-kubernetes-backend';
import { KubernetesObjectsProvider } from '@backstage/plugin-kubernetes-node';
/**
* The interface for {@link kubernetesObjectsProviderExtensionPoint}.
+2
View File
@@ -33,3 +33,5 @@ export {
kubernetesObjectsProviderExtensionPoint,
type KubernetesObjectsProviderExtensionPoint,
} from './extensions';
export * from './types';
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './types';
@@ -0,0 +1,53 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import {
CustomResourceMatcher,
KubernetesRequestAuth,
ObjectsByEntityResponse,
} from '@backstage/plugin-kubernetes-common';
/**
*
* @public
*/
export interface KubernetesObjectsProvider {
getKubernetesObjectsByEntity(
kubernetesObjectsByEntity: KubernetesObjectsByEntity,
): Promise<ObjectsByEntityResponse>;
getCustomResourcesByEntity(
customResourcesByEntity: CustomResourcesByEntity,
): Promise<ObjectsByEntityResponse>;
}
/**
*
* @public
*/
export interface KubernetesObjectsByEntity {
entity: Entity;
auth: KubernetesRequestAuth;
}
/**
*
* @public
*/
export interface CustomResourcesByEntity extends KubernetesObjectsByEntity {
customResources: CustomResourceMatcher[];
}