@@ -11,9 +11,28 @@ import { CatalogProcessorCache } from '@backstage/plugin-catalog-node';
11
11
import { CatalogProcessorEmit } from ' @backstage/plugin-catalog-node' ;
12
12
import { DiscoveryService } from ' @backstage/backend-plugin-api' ;
13
13
import { Entity } from ' @backstage/catalog-model' ;
14
+ import { EntityProvider } from ' @backstage/plugin-catalog-node' ;
15
+ import { EntityProviderConnection } from ' @backstage/plugin-catalog-node' ;
14
16
import { LocationSpec } from ' @backstage/plugin-catalog-common' ;
17
+ import { MarketplaceCollection } from ' @red-hat-developer-hub/backstage-plugin-marketplace-common' ;
15
18
import { MarketplacePackage } from ' @red-hat-developer-hub/backstage-plugin-marketplace-common' ;
16
19
import { MarketplacePlugin } from ' @red-hat-developer-hub/backstage-plugin-marketplace-common' ;
20
+ import { SchedulerServiceTaskRunner } from ' @backstage/backend-plugin-api' ;
21
+
22
+ // @public (undocumented)
23
+ export abstract class BaseEntityProvider <T extends Entity > implements EntityProvider {
24
+ constructor (taskRunner : SchedulerServiceTaskRunner );
25
+ // (undocumented)
26
+ connect(connection : EntityProviderConnection ): Promise <void >;
27
+ // (undocumented)
28
+ getEntities(allEntities : JsonFileData <T >[]): T [];
29
+ // (undocumented)
30
+ abstract getKind(): string ;
31
+ // (undocumented)
32
+ abstract getProviderName(): string ;
33
+ // (undocumented)
34
+ run(): Promise <void >;
35
+ }
17
36
18
37
// @public (undocumented)
19
38
export type CachedData = {
@@ -39,6 +58,12 @@ export class DynamicPackageInstallStatusProcessor implements CatalogProcessor {
39
58
preProcessEntity(entity : Entity , _location : LocationSpec , _emit : CatalogProcessorEmit , _originLocation : LocationSpec , cache : CatalogProcessorCache ): Promise <Entity >;
40
59
}
41
60
61
+ // @public (undocumented)
62
+ export type JsonFileData <T > = {
63
+ filePath: string ;
64
+ content: T ;
65
+ };
66
+
42
67
// @public (undocumented)
43
68
export class LocalPackageInstallStatusProcessor implements CatalogProcessor {
44
69
constructor (paths ? : string []);
@@ -60,6 +85,14 @@ export class MarketplaceCollectionProcessor implements CatalogProcessor {
60
85
validateEntityKind(entity : Entity ): Promise <boolean >;
61
86
}
62
87
88
+ // @public (undocumented)
89
+ export class MarketplaceCollectionProvider extends BaseEntityProvider <MarketplaceCollection > {
90
+ // (undocumented)
91
+ getKind(): string ;
92
+ // (undocumented)
93
+ getProviderName(): string ;
94
+ }
95
+
63
96
// @public (undocumented)
64
97
export class MarketplacePackageProcessor implements CatalogProcessor {
65
98
// (undocumented)
@@ -70,6 +103,14 @@ export class MarketplacePackageProcessor implements CatalogProcessor {
70
103
validateEntityKind(entity : Entity ): Promise <boolean >;
71
104
}
72
105
106
+ // @public (undocumented)
107
+ export class MarketplacePackageProvider extends BaseEntityProvider <MarketplacePackage > {
108
+ // (undocumented)
109
+ getKind(): string ;
110
+ // (undocumented)
111
+ getProviderName(): string ;
112
+ }
113
+
73
114
// @public (undocumented)
74
115
export class MarketplacePluginProcessor implements CatalogProcessor {
75
116
// (undocumented)
@@ -80,4 +121,12 @@ export class MarketplacePluginProcessor implements CatalogProcessor {
80
121
validateEntityKind(entity : Entity ): Promise <boolean >;
81
122
}
82
123
124
+ // @public (undocumented)
125
+ export class MarketplacePluginProvider extends BaseEntityProvider <MarketplacePlugin > {
126
+ // (undocumented)
127
+ getKind(): string ;
128
+ // (undocumented)
129
+ getProviderName(): string ;
130
+ }
131
+
83
132
```
0 commit comments