@backstage/plugin-catalog-backend-module-github 0.1.8-next.2 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/alpha/package.json +1 -1
- package/config.d.ts +11 -1
- package/dist/index.alpha.d.ts +46 -23
- package/dist/index.beta.d.ts +44 -14
- package/dist/index.cjs.js +124 -81
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +44 -14
- package/package.json +15 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-github
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8749df3d02: `GitHubEntityProvider`: Add option to configure schedule via `app-config.yaml` instead of in code.
|
|
8
|
+
|
|
9
|
+
Please find how to configure the schedule at the config at
|
|
10
|
+
https://backstage.io/docs/integrations/github/discovery
|
|
11
|
+
|
|
12
|
+
- 7022aebf35: Added `GithubLocationAnalyzer`. This can be used to add to the `CatalogBuilder`. When added this will be used by `RepoLocationAnalyzer` to figure out if the given URL that you are trying to import from the /catalog-import page already contains catalog-info.yaml files.
|
|
13
|
+
- 51046b58b0: Use schedule from config at backend module.
|
|
14
|
+
|
|
15
|
+
Also, it removes `GithubEntityProviderCatalogModuleOptions`
|
|
16
|
+
in favor of config-only for the backend module setup
|
|
17
|
+
like at other similar modules.
|
|
18
|
+
|
|
19
|
+
- 7edb5909e8: Add missing config schema for the `GitHubEntityProvider`.
|
|
20
|
+
- be9474b103: Replaces in-code uses of `GitHub` by `Github` and deprecates old versions.
|
|
21
|
+
|
|
22
|
+
Deprecates
|
|
23
|
+
|
|
24
|
+
- `GitHubEntityProvider` replaced by `GithubEntityProvider`
|
|
25
|
+
- `GitHubLocationAnalyzer` replaced by `GithubLocationAnalyzer`
|
|
26
|
+
- `GitHubLocationAnalyzerOptions` replaced by `GithubLocationAnalyzerOptions`
|
|
27
|
+
- `GitHubOrgEntityProvider` replaced by `GithubOrgEntityProvider`
|
|
28
|
+
- `GitHubOrgEntityProviderOptions` replaced by `GithubOrgEntityProviderOptions`
|
|
29
|
+
|
|
30
|
+
Renames
|
|
31
|
+
|
|
32
|
+
- `GitHubLocationAnalyzer` to `GithubLocationAnalyzer`
|
|
33
|
+
- `GitHubLocationAnalyzerOptions` to `GithubLocationAnalyzerOptions`
|
|
34
|
+
|
|
35
|
+
- a35a27df70: Updated the `moduleId` of the experimental module export.
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
- @backstage/plugin-catalog-node@1.2.0
|
|
38
|
+
- @backstage/catalog-model@1.1.2
|
|
39
|
+
- @backstage/backend-common@0.15.2
|
|
40
|
+
- @backstage/plugin-catalog-backend@1.5.0
|
|
41
|
+
- @backstage/backend-tasks@0.3.6
|
|
42
|
+
- @backstage/backend-plugin-api@0.1.3
|
|
43
|
+
- @backstage/catalog-client@1.1.1
|
|
44
|
+
- @backstage/config@1.0.3
|
|
45
|
+
- @backstage/errors@1.1.2
|
|
46
|
+
- @backstage/integration@1.3.2
|
|
47
|
+
- @backstage/types@1.0.0
|
|
48
|
+
|
|
3
49
|
## 0.1.8-next.2
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/config.d.ts
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks';
|
|
18
|
+
|
|
17
19
|
export interface Config {
|
|
18
20
|
catalog?: {
|
|
19
21
|
processors?: {
|
|
@@ -48,7 +50,7 @@ export interface Config {
|
|
|
48
50
|
|
|
49
51
|
providers?: {
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
53
|
+
* GithubEntityProvider configuration
|
|
52
54
|
*
|
|
53
55
|
* Uses "default" as default id for the single config variant.
|
|
54
56
|
*/
|
|
@@ -103,6 +105,10 @@ export interface Config {
|
|
|
103
105
|
exclude?: string[];
|
|
104
106
|
};
|
|
105
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* (Optional) TaskScheduleDefinition for the refresh.
|
|
110
|
+
*/
|
|
111
|
+
schedule?: TaskScheduleDefinitionConfig;
|
|
106
112
|
}
|
|
107
113
|
| Record<
|
|
108
114
|
string,
|
|
@@ -156,6 +162,10 @@ export interface Config {
|
|
|
156
162
|
exclude?: string[];
|
|
157
163
|
};
|
|
158
164
|
};
|
|
165
|
+
/**
|
|
166
|
+
* (Optional) TaskScheduleDefinition for the refresh.
|
|
167
|
+
*/
|
|
168
|
+
schedule?: TaskScheduleDefinitionConfig;
|
|
159
169
|
}
|
|
160
170
|
>;
|
|
161
171
|
};
|
package/dist/index.alpha.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ import { GitHubIntegrationConfig } from '@backstage/integration';
|
|
|
17
17
|
import { LocationSpec } from '@backstage/plugin-catalog-backend';
|
|
18
18
|
import { Logger } from 'winston';
|
|
19
19
|
import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
|
20
|
+
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
|
20
21
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
21
22
|
import { ScmLocationAnalyzer } from '@backstage/plugin-catalog-backend';
|
|
22
23
|
import { TaskRunner } from '@backstage/backend-tasks';
|
|
23
|
-
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Extracts repositories out of a GitHub org.
|
|
@@ -55,6 +55,23 @@ export declare class GithubDiscoveryProcessor implements CatalogProcessor {
|
|
|
55
55
|
readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
* @deprecated Use {@link GithubEntityProvider} instead.
|
|
61
|
+
*/
|
|
62
|
+
export declare class GitHubEntityProvider implements EntityProvider {
|
|
63
|
+
private readonly delegate;
|
|
64
|
+
static fromConfig(config: Config, options: {
|
|
65
|
+
logger: Logger;
|
|
66
|
+
schedule?: TaskRunner;
|
|
67
|
+
scheduler?: PluginTaskScheduler;
|
|
68
|
+
}): GitHubEntityProvider[];
|
|
69
|
+
private constructor();
|
|
70
|
+
connect(connection: EntityProviderConnection): Promise<void>;
|
|
71
|
+
getProviderName(): string;
|
|
72
|
+
refresh(logger: Logger): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
/**
|
|
59
76
|
* Discovers catalog files located in [GitHub](https://github.com).
|
|
60
77
|
* The provider will search your GitHub account and register catalog files matching the configured path
|
|
@@ -63,7 +80,7 @@ export declare class GithubDiscoveryProcessor implements CatalogProcessor {
|
|
|
63
80
|
*
|
|
64
81
|
* @public
|
|
65
82
|
*/
|
|
66
|
-
export declare class
|
|
83
|
+
export declare class GithubEntityProvider implements EntityProvider {
|
|
67
84
|
private readonly config;
|
|
68
85
|
private readonly logger;
|
|
69
86
|
private readonly integration;
|
|
@@ -72,8 +89,9 @@ export declare class GitHubEntityProvider implements EntityProvider {
|
|
|
72
89
|
private readonly githubCredentialsProvider;
|
|
73
90
|
static fromConfig(config: Config, options: {
|
|
74
91
|
logger: Logger;
|
|
75
|
-
schedule
|
|
76
|
-
|
|
92
|
+
schedule?: TaskRunner;
|
|
93
|
+
scheduler?: PluginTaskScheduler;
|
|
94
|
+
}): GithubEntityProvider[];
|
|
77
95
|
private constructor();
|
|
78
96
|
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */
|
|
79
97
|
getProviderName(): string;
|
|
@@ -88,26 +106,17 @@ export declare class GitHubEntityProvider implements EntityProvider {
|
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
/**
|
|
91
|
-
* Registers the
|
|
92
|
-
*
|
|
93
|
-
* @alpha
|
|
94
|
-
*/
|
|
95
|
-
export declare const githubEntityProviderCatalogModule: (options?: GithubEntityProviderCatalogModuleOptions | undefined) => BackendFeature;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Options for {@link githubEntityProviderCatalogModule}.
|
|
109
|
+
* Registers the {@link GithubEntityProvider} with the catalog processing extension point.
|
|
99
110
|
*
|
|
100
111
|
* @alpha
|
|
101
112
|
*/
|
|
102
|
-
export declare
|
|
103
|
-
schedule?: TaskScheduleDefinition;
|
|
104
|
-
};
|
|
113
|
+
export declare const githubEntityProviderCatalogModule: (options?: undefined) => BackendFeature;
|
|
105
114
|
|
|
106
115
|
/** @public */
|
|
107
|
-
export declare class
|
|
116
|
+
export declare class GithubLocationAnalyzer implements ScmLocationAnalyzer {
|
|
108
117
|
private readonly catalogClient;
|
|
109
118
|
private readonly config;
|
|
110
|
-
constructor(options:
|
|
119
|
+
constructor(options: GithubLocationAnalyzerOptions);
|
|
111
120
|
supports(url: string): boolean;
|
|
112
121
|
analyze({ url, catalogFilename }: AnalyzeOptions): Promise<{
|
|
113
122
|
existing: {
|
|
@@ -122,7 +131,7 @@ export declare class GitHubLocationAnalyzer implements ScmLocationAnalyzer {
|
|
|
122
131
|
}
|
|
123
132
|
|
|
124
133
|
/** @public */
|
|
125
|
-
export declare type
|
|
134
|
+
export declare type GithubLocationAnalyzerOptions = {
|
|
126
135
|
config: Config;
|
|
127
136
|
discovery: PluginEndpointDiscovery;
|
|
128
137
|
};
|
|
@@ -173,17 +182,25 @@ export declare class GithubMultiOrgReaderProcessor implements CatalogProcessor {
|
|
|
173
182
|
private getAllOrgs;
|
|
174
183
|
}
|
|
175
184
|
|
|
185
|
+
/**
|
|
186
|
+
* @public
|
|
187
|
+
* @deprecated Use {@link GithubOrgEntityProvider} instead.
|
|
188
|
+
*/
|
|
189
|
+
export declare class GitHubOrgEntityProvider extends GithubOrgEntityProvider {
|
|
190
|
+
static fromConfig(config: Config, options: GitHubOrgEntityProviderOptions): GitHubOrgEntityProvider;
|
|
191
|
+
}
|
|
192
|
+
|
|
176
193
|
/**
|
|
177
194
|
* Ingests org data (users and groups) from GitHub.
|
|
178
195
|
*
|
|
179
196
|
* @public
|
|
180
197
|
*/
|
|
181
|
-
export declare class
|
|
198
|
+
export declare class GithubOrgEntityProvider implements EntityProvider {
|
|
182
199
|
private options;
|
|
183
200
|
private readonly credentialsProvider;
|
|
184
201
|
private connection?;
|
|
185
202
|
private scheduleFn?;
|
|
186
|
-
static fromConfig(config: Config, options:
|
|
203
|
+
static fromConfig(config: Config, options: GithubOrgEntityProviderOptions): GithubOrgEntityProvider;
|
|
187
204
|
constructor(options: {
|
|
188
205
|
id: string;
|
|
189
206
|
orgUrl: string;
|
|
@@ -206,11 +223,17 @@ export declare class GitHubOrgEntityProvider implements EntityProvider {
|
|
|
206
223
|
}
|
|
207
224
|
|
|
208
225
|
/**
|
|
209
|
-
*
|
|
226
|
+
* @public
|
|
227
|
+
* @deprecated Use {@link GithubOrgEntityProviderOptions} instead.
|
|
228
|
+
*/
|
|
229
|
+
export declare type GitHubOrgEntityProviderOptions = GithubOrgEntityProviderOptions;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Options for {@link GithubOrgEntityProvider}.
|
|
210
233
|
*
|
|
211
234
|
* @public
|
|
212
235
|
*/
|
|
213
|
-
export declare interface
|
|
236
|
+
export declare interface GithubOrgEntityProviderOptions {
|
|
214
237
|
/**
|
|
215
238
|
* A unique, stable identifier for this provider.
|
|
216
239
|
*
|
|
@@ -252,7 +275,7 @@ export declare interface GitHubOrgEntityProviderOptions {
|
|
|
252
275
|
*
|
|
253
276
|
* @remarks
|
|
254
277
|
*
|
|
255
|
-
* Consider using {@link
|
|
278
|
+
* Consider using {@link GithubOrgEntityProvider} instead.
|
|
256
279
|
*
|
|
257
280
|
* @public
|
|
258
281
|
*/
|
package/dist/index.beta.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ import { GitHubIntegrationConfig } from '@backstage/integration';
|
|
|
17
17
|
import { LocationSpec } from '@backstage/plugin-catalog-backend';
|
|
18
18
|
import { Logger } from 'winston';
|
|
19
19
|
import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
|
20
|
+
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
|
20
21
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
21
22
|
import { ScmLocationAnalyzer } from '@backstage/plugin-catalog-backend';
|
|
22
23
|
import { TaskRunner } from '@backstage/backend-tasks';
|
|
23
|
-
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Extracts repositories out of a GitHub org.
|
|
@@ -55,6 +55,23 @@ export declare class GithubDiscoveryProcessor implements CatalogProcessor {
|
|
|
55
55
|
readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
* @deprecated Use {@link GithubEntityProvider} instead.
|
|
61
|
+
*/
|
|
62
|
+
export declare class GitHubEntityProvider implements EntityProvider {
|
|
63
|
+
private readonly delegate;
|
|
64
|
+
static fromConfig(config: Config, options: {
|
|
65
|
+
logger: Logger;
|
|
66
|
+
schedule?: TaskRunner;
|
|
67
|
+
scheduler?: PluginTaskScheduler;
|
|
68
|
+
}): GitHubEntityProvider[];
|
|
69
|
+
private constructor();
|
|
70
|
+
connect(connection: EntityProviderConnection): Promise<void>;
|
|
71
|
+
getProviderName(): string;
|
|
72
|
+
refresh(logger: Logger): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
/**
|
|
59
76
|
* Discovers catalog files located in [GitHub](https://github.com).
|
|
60
77
|
* The provider will search your GitHub account and register catalog files matching the configured path
|
|
@@ -63,7 +80,7 @@ export declare class GithubDiscoveryProcessor implements CatalogProcessor {
|
|
|
63
80
|
*
|
|
64
81
|
* @public
|
|
65
82
|
*/
|
|
66
|
-
export declare class
|
|
83
|
+
export declare class GithubEntityProvider implements EntityProvider {
|
|
67
84
|
private readonly config;
|
|
68
85
|
private readonly logger;
|
|
69
86
|
private readonly integration;
|
|
@@ -72,8 +89,9 @@ export declare class GitHubEntityProvider implements EntityProvider {
|
|
|
72
89
|
private readonly githubCredentialsProvider;
|
|
73
90
|
static fromConfig(config: Config, options: {
|
|
74
91
|
logger: Logger;
|
|
75
|
-
schedule
|
|
76
|
-
|
|
92
|
+
schedule?: TaskRunner;
|
|
93
|
+
scheduler?: PluginTaskScheduler;
|
|
94
|
+
}): GithubEntityProvider[];
|
|
77
95
|
private constructor();
|
|
78
96
|
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */
|
|
79
97
|
getProviderName(): string;
|
|
@@ -89,13 +107,11 @@ export declare class GitHubEntityProvider implements EntityProvider {
|
|
|
89
107
|
|
|
90
108
|
/* Excluded from this release type: githubEntityProviderCatalogModule */
|
|
91
109
|
|
|
92
|
-
/* Excluded from this release type: GithubEntityProviderCatalogModuleOptions */
|
|
93
|
-
|
|
94
110
|
/** @public */
|
|
95
|
-
export declare class
|
|
111
|
+
export declare class GithubLocationAnalyzer implements ScmLocationAnalyzer {
|
|
96
112
|
private readonly catalogClient;
|
|
97
113
|
private readonly config;
|
|
98
|
-
constructor(options:
|
|
114
|
+
constructor(options: GithubLocationAnalyzerOptions);
|
|
99
115
|
supports(url: string): boolean;
|
|
100
116
|
analyze({ url, catalogFilename }: AnalyzeOptions): Promise<{
|
|
101
117
|
existing: {
|
|
@@ -110,7 +126,7 @@ export declare class GitHubLocationAnalyzer implements ScmLocationAnalyzer {
|
|
|
110
126
|
}
|
|
111
127
|
|
|
112
128
|
/** @public */
|
|
113
|
-
export declare type
|
|
129
|
+
export declare type GithubLocationAnalyzerOptions = {
|
|
114
130
|
config: Config;
|
|
115
131
|
discovery: PluginEndpointDiscovery;
|
|
116
132
|
};
|
|
@@ -161,17 +177,25 @@ export declare class GithubMultiOrgReaderProcessor implements CatalogProcessor {
|
|
|
161
177
|
private getAllOrgs;
|
|
162
178
|
}
|
|
163
179
|
|
|
180
|
+
/**
|
|
181
|
+
* @public
|
|
182
|
+
* @deprecated Use {@link GithubOrgEntityProvider} instead.
|
|
183
|
+
*/
|
|
184
|
+
export declare class GitHubOrgEntityProvider extends GithubOrgEntityProvider {
|
|
185
|
+
static fromConfig(config: Config, options: GitHubOrgEntityProviderOptions): GitHubOrgEntityProvider;
|
|
186
|
+
}
|
|
187
|
+
|
|
164
188
|
/**
|
|
165
189
|
* Ingests org data (users and groups) from GitHub.
|
|
166
190
|
*
|
|
167
191
|
* @public
|
|
168
192
|
*/
|
|
169
|
-
export declare class
|
|
193
|
+
export declare class GithubOrgEntityProvider implements EntityProvider {
|
|
170
194
|
private options;
|
|
171
195
|
private readonly credentialsProvider;
|
|
172
196
|
private connection?;
|
|
173
197
|
private scheduleFn?;
|
|
174
|
-
static fromConfig(config: Config, options:
|
|
198
|
+
static fromConfig(config: Config, options: GithubOrgEntityProviderOptions): GithubOrgEntityProvider;
|
|
175
199
|
constructor(options: {
|
|
176
200
|
id: string;
|
|
177
201
|
orgUrl: string;
|
|
@@ -194,11 +218,17 @@ export declare class GitHubOrgEntityProvider implements EntityProvider {
|
|
|
194
218
|
}
|
|
195
219
|
|
|
196
220
|
/**
|
|
197
|
-
*
|
|
221
|
+
* @public
|
|
222
|
+
* @deprecated Use {@link GithubOrgEntityProviderOptions} instead.
|
|
223
|
+
*/
|
|
224
|
+
export declare type GitHubOrgEntityProviderOptions = GithubOrgEntityProviderOptions;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Options for {@link GithubOrgEntityProvider}.
|
|
198
228
|
*
|
|
199
229
|
* @public
|
|
200
230
|
*/
|
|
201
|
-
export declare interface
|
|
231
|
+
export declare interface GithubOrgEntityProviderOptions {
|
|
202
232
|
/**
|
|
203
233
|
* A unique, stable identifier for this provider.
|
|
204
234
|
*
|
|
@@ -240,7 +270,7 @@ export declare interface GitHubOrgEntityProviderOptions {
|
|
|
240
270
|
*
|
|
241
271
|
* @remarks
|
|
242
272
|
*
|
|
243
|
-
* Consider using {@link
|
|
273
|
+
* Consider using {@link GithubOrgEntityProvider} instead.
|
|
244
274
|
*
|
|
245
275
|
* @public
|
|
246
276
|
*/
|