@backstage/core-app-api 0.1.16 → 0.1.20
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 +49 -0
- package/dist/index.d.ts +256 -29
- package/dist/index.esm.js +84 -40
- package/dist/index.esm.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @backstage/core-app-api
|
|
2
2
|
|
|
3
|
+
## 0.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 78c512ce8f: I have added default icons for the catalog, scaffolder, techdocs, and search.
|
|
8
|
+
- 8b4284cd5c: Improve API documentation for @backstage/core-plugin-api
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-components@0.7.3
|
|
11
|
+
- @backstage/theme@0.2.13
|
|
12
|
+
- @backstage/core-plugin-api@0.1.13
|
|
13
|
+
|
|
14
|
+
## 0.1.19
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 10615525f3: Switch to use the json and observable types from `@backstage/types`
|
|
19
|
+
- 41c49884d2: Start using the new `@backstage/types` package. Initially, this means using the `Observable` and `Json*` types from there. The types also remain in their old places but deprecated, and will be removed in a future release.
|
|
20
|
+
- 925a967f36: Replace usage of test-utils-core with test-utils
|
|
21
|
+
- 6b615e92c8: Api cleanup, adding `@public` where necessary and tweaking some comments
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/config@0.1.11
|
|
24
|
+
- @backstage/theme@0.2.12
|
|
25
|
+
- @backstage/core-components@0.7.2
|
|
26
|
+
- @backstage/core-plugin-api@0.1.12
|
|
27
|
+
|
|
28
|
+
## 0.1.18
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 202f322927: Atlassian auth provider
|
|
33
|
+
|
|
34
|
+
- AtlassianAuth added to core-app-api
|
|
35
|
+
- Atlassian provider added to plugin-auth-backend
|
|
36
|
+
- Updated user-settings with Atlassian connection
|
|
37
|
+
|
|
38
|
+
- 36e67d2f24: Internal updates to apply more strict checks to throw errors.
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @backstage/core-components@0.7.1
|
|
41
|
+
- @backstage/core-plugin-api@0.1.11
|
|
42
|
+
|
|
43
|
+
## 0.1.17
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 75bc878221: Internal refactor to avoid importing all of `@material-ui/core`.
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
- @backstage/core-components@0.7.0
|
|
50
|
+
- @backstage/theme@0.2.11
|
|
51
|
+
|
|
3
52
|
## 0.1.16
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode, ComponentType } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
|
-
import { ApiHolder, ApiRef, ApiFactory, AnyApiRef, ProfileInfo, BackstageIdentity,
|
|
4
|
+
import { ApiHolder, ApiRef, ApiFactory, AnyApiRef, ProfileInfo, BackstageIdentity, SessionState, OAuthRequestApi, DiscoveryApi, AuthProvider, OAuthApi, SessionApi, AuthRequestOptions, gitlabAuthApiRef, googleAuthApiRef, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, oktaAuthApiRef, auth0AuthApiRef, microsoftAuthApiRef, oneloginAuthApiRef, bitbucketAuthApiRef, atlassianAuthApiRef, AlertApi, AlertMessage, AnalyticsApi, AnalyticsEvent, AppThemeApi, AppTheme, ErrorApi, ErrorContext, FeatureFlagsApi, FeatureFlag, FeatureFlagsSaveOptions, AuthRequesterOptions, AuthRequester, PendingAuthRequest, StorageApi, StorageValueChange, IconComponent, BackstagePlugin, ExternalRouteRef, PluginOutput, AnyApiFactory, RouteRef, SubRouteRef } from '@backstage/core-plugin-api';
|
|
5
|
+
import * as _backstage_types from '@backstage/types';
|
|
6
|
+
import { Observable } from '@backstage/types';
|
|
5
7
|
import { AppConfig } from '@backstage/config';
|
|
6
8
|
export { ConfigReader } from '@backstage/config';
|
|
7
9
|
|
|
@@ -9,8 +11,14 @@ declare type ApiProviderProps = {
|
|
|
9
11
|
apis: ApiHolder;
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Provides an {@link @backstage/core-plugin-api#ApiHolder} for consumption in
|
|
16
|
+
* the React tree.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
12
20
|
declare const ApiProvider: {
|
|
13
|
-
(
|
|
21
|
+
(props: PropsWithChildren<ApiProviderProps>): JSX.Element;
|
|
14
22
|
propTypes: {
|
|
15
23
|
apis: PropTypes.Validator<PropTypes.InferProps<{
|
|
16
24
|
get: PropTypes.Validator<(...args: any[]) => any>;
|
|
@@ -25,34 +33,53 @@ declare class ApiRegistryBuilder {
|
|
|
25
33
|
add<T, I extends T>(api: ApiRef<T>, impl: I): I;
|
|
26
34
|
build(): ApiRegistry;
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A registry for utility APIs.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
28
41
|
declare class ApiRegistry implements ApiHolder {
|
|
29
42
|
private readonly apis;
|
|
30
43
|
static builder(): ApiRegistryBuilder;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new ApiRegistry with a list of API implementations.
|
|
46
|
+
*
|
|
47
|
+
* @param apis - A list of pairs mapping an ApiRef to its respective implementation
|
|
48
|
+
*/
|
|
31
49
|
static from(apis: ApiImpl[]): ApiRegistry;
|
|
32
50
|
/**
|
|
33
51
|
* Creates a new ApiRegistry with a single API implementation.
|
|
34
52
|
*
|
|
35
|
-
* @param api ApiRef for the API to add
|
|
36
|
-
* @param impl Implementation of the API to add
|
|
53
|
+
* @param api - ApiRef for the API to add
|
|
54
|
+
* @param impl - Implementation of the API to add
|
|
37
55
|
*/
|
|
38
56
|
static with<T>(api: ApiRef<T>, impl: T): ApiRegistry;
|
|
39
57
|
constructor(apis: Map<string, unknown>);
|
|
40
58
|
/**
|
|
41
59
|
* Returns a new ApiRegistry with the provided API added to the existing ones.
|
|
42
60
|
*
|
|
43
|
-
* @param api ApiRef for the API to add
|
|
44
|
-
* @param impl Implementation of the API to add
|
|
61
|
+
* @param api - ApiRef for the API to add
|
|
62
|
+
* @param impl - Implementation of the API to add
|
|
45
63
|
*/
|
|
46
64
|
with<T>(api: ApiRef<T>, impl: T): ApiRegistry;
|
|
47
65
|
get<T>(api: ApiRef<T>): T | undefined;
|
|
48
66
|
}
|
|
49
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
50
71
|
declare type ApiFactoryHolder = {
|
|
51
72
|
get<T>(api: ApiRef<T>): ApiFactory<T, T, {
|
|
52
73
|
[key in string]: unknown;
|
|
53
74
|
}> | undefined;
|
|
54
75
|
};
|
|
55
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Handles the actual on-demand instantiation and memoization of APIs out of
|
|
79
|
+
* an {@link ApiFactoryHolder}.
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
56
83
|
declare class ApiResolver implements ApiHolder {
|
|
57
84
|
private readonly factories;
|
|
58
85
|
/**
|
|
@@ -74,6 +101,8 @@ declare type ApiFactoryScope = 'default' | 'app' | 'static';
|
|
|
74
101
|
*
|
|
75
102
|
* Each scope has an assigned priority, where factories registered with
|
|
76
103
|
* higher priority scopes override ones with lower priority.
|
|
104
|
+
*
|
|
105
|
+
* @public
|
|
77
106
|
*/
|
|
78
107
|
declare class ApiFactoryRegistry implements ApiFactoryHolder {
|
|
79
108
|
private readonly factories;
|
|
@@ -93,6 +122,11 @@ declare class ApiFactoryRegistry implements ApiFactoryHolder {
|
|
|
93
122
|
getAllApis(): Set<AnyApiRef>;
|
|
94
123
|
}
|
|
95
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Session information for GitHub auth.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
96
130
|
declare type GithubSession = {
|
|
97
131
|
providerInfo: {
|
|
98
132
|
accessToken: string;
|
|
@@ -131,6 +165,11 @@ declare type AuthApiCreateOptions = {
|
|
|
131
165
|
};
|
|
132
166
|
};
|
|
133
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Implements the OAuth flow to GitHub products.
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
134
173
|
declare class GithubAuth implements OAuthApi, SessionApi {
|
|
135
174
|
private readonly sessionManager;
|
|
136
175
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): GithubAuth;
|
|
@@ -144,14 +183,29 @@ declare class GithubAuth implements OAuthApi, SessionApi {
|
|
|
144
183
|
static normalizeScope(scope?: string): Set<string>;
|
|
145
184
|
}
|
|
146
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Implements the OAuth flow to GitLab products.
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
147
191
|
declare class GitlabAuth {
|
|
148
192
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof gitlabAuthApiRef.T;
|
|
149
193
|
}
|
|
150
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Implements the OAuth flow to Google products.
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
151
200
|
declare class GoogleAuth {
|
|
152
201
|
static create({ discoveryApi, oauthRequestApi, environment, provider, defaultScopes, }: OAuthApiCreateOptions): typeof googleAuthApiRef.T;
|
|
153
202
|
}
|
|
154
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Session information for generic OAuth2 auth.
|
|
206
|
+
*
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
155
209
|
declare type OAuth2Session = {
|
|
156
210
|
providerInfo: {
|
|
157
211
|
idToken: string;
|
|
@@ -163,18 +217,22 @@ declare type OAuth2Session = {
|
|
|
163
217
|
backstageIdentity: BackstageIdentity;
|
|
164
218
|
};
|
|
165
219
|
|
|
166
|
-
declare type Options = {
|
|
167
|
-
sessionManager: SessionManager<OAuth2Session>;
|
|
168
|
-
scopeTransform: (scopes: string[]) => string[];
|
|
169
|
-
};
|
|
170
220
|
declare type CreateOptions$1 = OAuthApiCreateOptions & {
|
|
171
221
|
scopeTransform?: (scopes: string[]) => string[];
|
|
172
222
|
};
|
|
223
|
+
/**
|
|
224
|
+
* Implements a generic OAuth2 flow for auth.
|
|
225
|
+
*
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
173
228
|
declare class OAuth2 implements OAuthApi, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, SessionApi {
|
|
174
229
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, scopeTransform, }: CreateOptions$1): OAuth2;
|
|
175
230
|
private readonly sessionManager;
|
|
176
231
|
private readonly scopeTransform;
|
|
177
|
-
constructor(options:
|
|
232
|
+
constructor(options: {
|
|
233
|
+
sessionManager: SessionManager<OAuth2Session>;
|
|
234
|
+
scopeTransform: (scopes: string[]) => string[];
|
|
235
|
+
});
|
|
178
236
|
signIn(): Promise<void>;
|
|
179
237
|
signOut(): Promise<void>;
|
|
180
238
|
sessionState$(): Observable<SessionState>;
|
|
@@ -185,16 +243,31 @@ declare class OAuth2 implements OAuthApi, OpenIdConnectApi, ProfileInfoApi, Back
|
|
|
185
243
|
private static normalizeScopes;
|
|
186
244
|
}
|
|
187
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Implements the OAuth flow to Okta products.
|
|
248
|
+
*
|
|
249
|
+
* @public
|
|
250
|
+
*/
|
|
188
251
|
declare class OktaAuth {
|
|
189
252
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof oktaAuthApiRef.T;
|
|
190
253
|
}
|
|
191
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Session information for SAML auth.
|
|
257
|
+
*
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
192
260
|
declare type SamlSession = {
|
|
193
261
|
userId: string;
|
|
194
262
|
profile: ProfileInfo;
|
|
195
263
|
backstageIdentity: BackstageIdentity;
|
|
196
264
|
};
|
|
197
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Implements a general SAML based auth flow.
|
|
268
|
+
*
|
|
269
|
+
* @public
|
|
270
|
+
*/
|
|
198
271
|
declare class SamlAuth implements ProfileInfoApi, BackstageIdentityApi, SessionApi {
|
|
199
272
|
private readonly sessionManager;
|
|
200
273
|
static create({ discoveryApi, environment, provider, }: AuthApiCreateOptions): SamlAuth;
|
|
@@ -206,10 +279,20 @@ declare class SamlAuth implements ProfileInfoApi, BackstageIdentityApi, SessionA
|
|
|
206
279
|
getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
|
|
207
280
|
}
|
|
208
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Implements the OAuth flow to Auth0 products.
|
|
284
|
+
*
|
|
285
|
+
* @public
|
|
286
|
+
*/
|
|
209
287
|
declare class Auth0Auth {
|
|
210
288
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof auth0AuthApiRef.T;
|
|
211
289
|
}
|
|
212
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Implements the OAuth flow to Microsoft products.
|
|
293
|
+
*
|
|
294
|
+
* @public
|
|
295
|
+
*/
|
|
213
296
|
declare class MicrosoftAuth {
|
|
214
297
|
static create({ environment, provider, oauthRequestApi, discoveryApi, defaultScopes, }: OAuthApiCreateOptions): typeof microsoftAuthApiRef.T;
|
|
215
298
|
}
|
|
@@ -222,10 +305,20 @@ declare type CreateOptions = {
|
|
|
222
305
|
id: string;
|
|
223
306
|
};
|
|
224
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Implements a OneLogin OAuth flow.
|
|
310
|
+
*
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
225
313
|
declare class OneLoginAuth {
|
|
226
314
|
static create({ discoveryApi, environment, provider, oauthRequestApi, }: CreateOptions): typeof oneloginAuthApiRef.T;
|
|
227
315
|
}
|
|
228
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Session information for Bitbucket auth.
|
|
319
|
+
*
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
229
322
|
declare type BitbucketSession = {
|
|
230
323
|
providerInfo: {
|
|
231
324
|
accessToken: string;
|
|
@@ -236,12 +329,28 @@ declare type BitbucketSession = {
|
|
|
236
329
|
backstageIdentity: BackstageIdentity;
|
|
237
330
|
};
|
|
238
331
|
|
|
332
|
+
/**
|
|
333
|
+
* Implements the OAuth flow to Bitbucket products.
|
|
334
|
+
*
|
|
335
|
+
* @public
|
|
336
|
+
*/
|
|
239
337
|
declare class BitbucketAuth {
|
|
240
338
|
static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof bitbucketAuthApiRef.T;
|
|
241
339
|
}
|
|
242
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Implements the OAuth flow to Atlassian products.
|
|
343
|
+
*
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
346
|
+
declare class AtlassianAuth {
|
|
347
|
+
static create({ discoveryApi, environment, provider, oauthRequestApi, }: OAuthApiCreateOptions): typeof atlassianAuthApiRef.T;
|
|
348
|
+
}
|
|
349
|
+
|
|
243
350
|
/**
|
|
244
351
|
* Base implementation for the AlertApi that simply forwards alerts to consumers.
|
|
352
|
+
*
|
|
353
|
+
* @public
|
|
245
354
|
*/
|
|
246
355
|
declare class AlertApiForwarder implements AlertApi {
|
|
247
356
|
private readonly subject;
|
|
@@ -251,11 +360,19 @@ declare class AlertApiForwarder implements AlertApi {
|
|
|
251
360
|
|
|
252
361
|
/**
|
|
253
362
|
* Base implementation for the AnalyticsApi that does nothing.
|
|
363
|
+
*
|
|
364
|
+
* @public
|
|
254
365
|
*/
|
|
255
366
|
declare class NoOpAnalyticsApi implements AnalyticsApi {
|
|
256
367
|
captureEvent(_event: AnalyticsEvent): void;
|
|
257
368
|
}
|
|
258
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Exposes the themes installed in the app, and permits switching the currently
|
|
372
|
+
* active theme.
|
|
373
|
+
*
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
259
376
|
declare class AppThemeSelector implements AppThemeApi {
|
|
260
377
|
private readonly themes;
|
|
261
378
|
static createWithStorage(themes: AppTheme[]): AppThemeSelector;
|
|
@@ -271,6 +388,8 @@ declare class AppThemeSelector implements AppThemeApi {
|
|
|
271
388
|
/**
|
|
272
389
|
* UrlPatternDiscovery is a lightweight DiscoveryApi implementation.
|
|
273
390
|
* It uses a single template string to construct URLs for each plugin.
|
|
391
|
+
*
|
|
392
|
+
* @public
|
|
274
393
|
*/
|
|
275
394
|
declare class UrlPatternDiscovery implements DiscoveryApi {
|
|
276
395
|
private readonly parts;
|
|
@@ -289,24 +408,24 @@ declare class UrlPatternDiscovery implements DiscoveryApi {
|
|
|
289
408
|
/**
|
|
290
409
|
* Decorates an ErrorApi by also forwarding error messages
|
|
291
410
|
* to the alertApi with an 'error' severity.
|
|
411
|
+
*
|
|
412
|
+
* @public
|
|
292
413
|
*/
|
|
293
414
|
declare class ErrorAlerter implements ErrorApi {
|
|
294
415
|
private readonly alertApi;
|
|
295
416
|
private readonly errorApi;
|
|
296
417
|
constructor(alertApi: AlertApi, errorApi: ErrorApi);
|
|
297
418
|
post(error: Error, context?: ErrorContext): void;
|
|
298
|
-
error$():
|
|
299
|
-
error:
|
|
300
|
-
name: string;
|
|
301
|
-
message: string;
|
|
302
|
-
stack?: string | undefined;
|
|
303
|
-
};
|
|
419
|
+
error$(): _backstage_types.Observable<{
|
|
420
|
+
error: _backstage_core_plugin_api.Error;
|
|
304
421
|
context?: ErrorContext | undefined;
|
|
305
422
|
}>;
|
|
306
423
|
}
|
|
307
424
|
|
|
308
425
|
/**
|
|
309
426
|
* Base implementation for the ErrorApi that simply forwards errors to consumers.
|
|
427
|
+
*
|
|
428
|
+
* @public
|
|
310
429
|
*/
|
|
311
430
|
declare class ErrorApiForwarder implements ErrorApi {
|
|
312
431
|
private readonly subject;
|
|
@@ -317,6 +436,11 @@ declare class ErrorApiForwarder implements ErrorApi {
|
|
|
317
436
|
}>;
|
|
318
437
|
}
|
|
319
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Utility class that helps with error forwarding.
|
|
441
|
+
*
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
320
444
|
declare class UnhandledErrorForwarder {
|
|
321
445
|
/**
|
|
322
446
|
* Add event listener, such that unhandled errors can be forwarded using an given `ErrorApi` instance
|
|
@@ -325,7 +449,10 @@ declare class UnhandledErrorForwarder {
|
|
|
325
449
|
}
|
|
326
450
|
|
|
327
451
|
/**
|
|
328
|
-
*
|
|
452
|
+
* A feature flags implementation that stores the flags in the browser's local
|
|
453
|
+
* storage.
|
|
454
|
+
*
|
|
455
|
+
* @public
|
|
329
456
|
*/
|
|
330
457
|
declare class LocalStorageFeatureFlags implements FeatureFlagsApi {
|
|
331
458
|
private registeredFeatureFlags;
|
|
@@ -343,6 +470,8 @@ declare class LocalStorageFeatureFlags implements FeatureFlagsApi {
|
|
|
343
470
|
* The purpose of this class and the API is to read a stream of incoming requests
|
|
344
471
|
* of OAuth access tokens from different providers with varying scope, and funnel
|
|
345
472
|
* them all together into a single request for each OAuth provider.
|
|
473
|
+
*
|
|
474
|
+
* @public
|
|
346
475
|
*/
|
|
347
476
|
declare class OAuthRequestManager implements OAuthRequestApi {
|
|
348
477
|
private readonly subject;
|
|
@@ -353,15 +482,19 @@ declare class OAuthRequestManager implements OAuthRequestApi {
|
|
|
353
482
|
authRequest$(): Observable<PendingAuthRequest[]>;
|
|
354
483
|
}
|
|
355
484
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
485
|
+
/**
|
|
486
|
+
* An implementation of the storage API, that uses the browser's local storage.
|
|
487
|
+
*
|
|
488
|
+
* @public
|
|
489
|
+
*/
|
|
360
490
|
declare class WebStorage implements StorageApi {
|
|
361
491
|
private readonly namespace;
|
|
362
492
|
private readonly errorApi;
|
|
363
493
|
constructor(namespace: string, errorApi: ErrorApi);
|
|
364
|
-
static create(options:
|
|
494
|
+
static create(options: {
|
|
495
|
+
errorApi: ErrorApi;
|
|
496
|
+
namespace?: string;
|
|
497
|
+
}): WebStorage;
|
|
365
498
|
get<T>(key: string): T | undefined;
|
|
366
499
|
forBucket(name: string): WebStorage;
|
|
367
500
|
set<T>(key: string, data: T): Promise<void>;
|
|
@@ -373,15 +506,25 @@ declare class WebStorage implements StorageApi {
|
|
|
373
506
|
private readonly observable;
|
|
374
507
|
}
|
|
375
508
|
|
|
376
|
-
declare type AppIconsKey = 'brokenImage' | 'catalog' | 'chat' | 'dashboard' | 'docs' | 'email' | 'github' | 'group' | 'help' | 'kind:api' | 'kind:component' | 'kind:domain' | 'kind:group' | 'kind:location' | 'kind:system' | 'kind:user' | 'user' | 'warning';
|
|
509
|
+
declare type AppIconsKey = 'brokenImage' | 'catalog' | 'scaffolder' | 'techdocs' | 'search' | 'chat' | 'dashboard' | 'docs' | 'email' | 'github' | 'group' | 'help' | 'kind:api' | 'kind:component' | 'kind:domain' | 'kind:group' | 'kind:location' | 'kind:system' | 'kind:user' | 'user' | 'warning';
|
|
377
510
|
declare type AppIcons = {
|
|
378
511
|
[key in AppIconsKey]: IconComponent;
|
|
379
512
|
};
|
|
380
513
|
|
|
514
|
+
/**
|
|
515
|
+
* Props for the `BootErrorPage` component of {@link AppComponents}.
|
|
516
|
+
*
|
|
517
|
+
* @public
|
|
518
|
+
*/
|
|
381
519
|
declare type BootErrorPageProps = {
|
|
382
520
|
step: 'load-config' | 'load-chunk';
|
|
383
521
|
error: Error;
|
|
384
522
|
};
|
|
523
|
+
/**
|
|
524
|
+
* The outcome of signing in on the sign-in page.
|
|
525
|
+
*
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
385
528
|
declare type SignInResult = {
|
|
386
529
|
/**
|
|
387
530
|
* User ID that will be returned by the IdentityApi
|
|
@@ -397,17 +540,32 @@ declare type SignInResult = {
|
|
|
397
540
|
*/
|
|
398
541
|
signOut?: () => Promise<void>;
|
|
399
542
|
};
|
|
543
|
+
/**
|
|
544
|
+
* Props for the `SignInPage` component of {@link AppComponents}.
|
|
545
|
+
*
|
|
546
|
+
* @public
|
|
547
|
+
*/
|
|
400
548
|
declare type SignInPageProps = {
|
|
401
549
|
/**
|
|
402
550
|
* Set the sign-in result for the app. This should only be called once.
|
|
403
551
|
*/
|
|
404
552
|
onResult(result: SignInResult): void;
|
|
405
553
|
};
|
|
554
|
+
/**
|
|
555
|
+
* Props for the fallback error boundary.
|
|
556
|
+
*
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
406
559
|
declare type ErrorBoundaryFallbackProps = {
|
|
407
560
|
plugin?: BackstagePlugin;
|
|
408
561
|
error: Error;
|
|
409
562
|
resetError: () => void;
|
|
410
563
|
};
|
|
564
|
+
/**
|
|
565
|
+
* A set of replaceable core components that are part of every Backstage app.
|
|
566
|
+
*
|
|
567
|
+
* @public
|
|
568
|
+
*/
|
|
411
569
|
declare type AppComponents = {
|
|
412
570
|
NotFoundErrorPage: ComponentType<{}>;
|
|
413
571
|
BootErrorPage: ComponentType<BootErrorPageProps>;
|
|
@@ -431,6 +589,8 @@ declare type AppComponents = {
|
|
|
431
589
|
*
|
|
432
590
|
* If multiple config objects are returned in the array, values in the earlier configs
|
|
433
591
|
* will override later ones.
|
|
592
|
+
*
|
|
593
|
+
* @public
|
|
434
594
|
*/
|
|
435
595
|
declare type AppConfigLoader = () => Promise<AppConfig[]>;
|
|
436
596
|
/**
|
|
@@ -455,15 +615,40 @@ declare type TargetRouteMap<ExternalRoutes extends {
|
|
|
455
615
|
}> = {
|
|
456
616
|
[name in keyof ExternalRoutes]: ExternalRoutes[name] extends ExternalRouteRef<infer Params, any> ? RouteRef<Params> | SubRouteRef<Params> : never;
|
|
457
617
|
};
|
|
618
|
+
/**
|
|
619
|
+
* A function that can bind from external routes of a given plugin, to concrete
|
|
620
|
+
* routes of other plugins. See {@link createApp}.
|
|
621
|
+
*
|
|
622
|
+
* @public
|
|
623
|
+
*/
|
|
458
624
|
declare type AppRouteBinder = <ExternalRoutes extends {
|
|
459
625
|
[name: string]: ExternalRouteRef;
|
|
460
626
|
}>(externalRoutes: ExternalRoutes, targetRoutes: PartialKeys<TargetRouteMap<ExternalRoutes>, KeysWithType<ExternalRoutes, ExternalRouteRef<any, true>>>) => void;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
627
|
+
/**
|
|
628
|
+
* Internal helper type that represents a plugin with any type of output.
|
|
629
|
+
*
|
|
630
|
+
* @public
|
|
631
|
+
* @remarks
|
|
632
|
+
*
|
|
633
|
+
* The `type: string` type is there to handle output from newer or older plugin
|
|
634
|
+
* API versions that might not be supported by this version of the app API, but
|
|
635
|
+
* we don't want to break at the type checking level. We only use this more
|
|
636
|
+
* permissive type for the `createApp` options, as we otherwise want to stick
|
|
637
|
+
* to using the type for the outputs that we know about in this version of the
|
|
638
|
+
* app api.
|
|
639
|
+
*
|
|
640
|
+
* TODO(freben): This should be marked internal but that's not supported by the api report generation tools yet
|
|
641
|
+
*/
|
|
464
642
|
declare type BackstagePluginWithAnyOutput = Omit<BackstagePlugin<any, any>, 'output'> & {
|
|
465
|
-
output(): (PluginOutput |
|
|
643
|
+
output(): (PluginOutput | {
|
|
644
|
+
type: string;
|
|
645
|
+
})[];
|
|
466
646
|
};
|
|
647
|
+
/**
|
|
648
|
+
* The options accepted by {@link createApp}.
|
|
649
|
+
*
|
|
650
|
+
* @public
|
|
651
|
+
*/
|
|
467
652
|
declare type AppOptions = {
|
|
468
653
|
/**
|
|
469
654
|
* A collection of ApiFactories to register in the application to either
|
|
@@ -539,6 +724,11 @@ declare type AppOptions = {
|
|
|
539
724
|
bind: AppRouteBinder;
|
|
540
725
|
}): void;
|
|
541
726
|
};
|
|
727
|
+
/**
|
|
728
|
+
* The public API of the output of {@link createApp}.
|
|
729
|
+
*
|
|
730
|
+
* @public
|
|
731
|
+
*/
|
|
542
732
|
declare type BackstageApp = {
|
|
543
733
|
/**
|
|
544
734
|
* Returns all plugins registered for the app.
|
|
@@ -559,6 +749,12 @@ declare type BackstageApp = {
|
|
|
559
749
|
*/
|
|
560
750
|
getRouter(): ComponentType<{}>;
|
|
561
751
|
};
|
|
752
|
+
/**
|
|
753
|
+
* The central context providing runtime app specific state that plugin views
|
|
754
|
+
* want to consume.
|
|
755
|
+
*
|
|
756
|
+
* @public
|
|
757
|
+
*/
|
|
562
758
|
declare type AppContext = {
|
|
563
759
|
/**
|
|
564
760
|
* Get a list of all plugins that are installed in the app.
|
|
@@ -616,18 +812,43 @@ declare class PrivateAppImpl implements BackstageApp {
|
|
|
616
812
|
* which can be rewritten at runtime to contain an additional JSON config object.
|
|
617
813
|
* If runtime config is present, it will be placed first in the config array, overriding
|
|
618
814
|
* other config values.
|
|
815
|
+
*
|
|
816
|
+
* @public
|
|
619
817
|
*/
|
|
620
818
|
declare const defaultConfigLoader: AppConfigLoader;
|
|
621
819
|
/**
|
|
622
820
|
* Creates a new Backstage App.
|
|
821
|
+
*
|
|
822
|
+
* @public
|
|
623
823
|
*/
|
|
624
824
|
declare function createApp(options?: AppOptions): PrivateAppImpl;
|
|
625
825
|
|
|
826
|
+
/**
|
|
827
|
+
* Props for the {@link FlatRoutes} component.
|
|
828
|
+
*
|
|
829
|
+
* @public
|
|
830
|
+
*/
|
|
626
831
|
declare type FlatRoutesProps = {
|
|
627
832
|
children: ReactNode;
|
|
628
833
|
};
|
|
834
|
+
/**
|
|
835
|
+
* A wrapper around a set of routes.
|
|
836
|
+
*
|
|
837
|
+
* @remarks
|
|
838
|
+
*
|
|
839
|
+
* The root of the routing hierarchy in your app should use this component,
|
|
840
|
+
* instead of the one from `react-router-dom`. This ensures that all of the
|
|
841
|
+
* plugin route and utility API wiring happens under the hood.
|
|
842
|
+
*
|
|
843
|
+
* @public
|
|
844
|
+
*/
|
|
629
845
|
declare const FlatRoutes: (props: FlatRoutesProps) => JSX.Element | null;
|
|
630
846
|
|
|
847
|
+
/**
|
|
848
|
+
* Props for the {@link FeatureFlagged} component.
|
|
849
|
+
*
|
|
850
|
+
* @public
|
|
851
|
+
*/
|
|
631
852
|
declare type FeatureFlaggedProps = {
|
|
632
853
|
children: ReactNode;
|
|
633
854
|
} & ({
|
|
@@ -635,6 +856,12 @@ declare type FeatureFlaggedProps = {
|
|
|
635
856
|
} | {
|
|
636
857
|
without: string;
|
|
637
858
|
});
|
|
859
|
+
/**
|
|
860
|
+
* Enables or disables rendering of its children based on the state of a given
|
|
861
|
+
* feature flag.
|
|
862
|
+
*
|
|
863
|
+
* @public
|
|
864
|
+
*/
|
|
638
865
|
declare const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element;
|
|
639
866
|
|
|
640
|
-
export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiProvider, ApiRegistry, ApiResolver, AppComponents, AppConfigLoader, AppContext, AppOptions, AppRouteBinder, AppThemeSelector, Auth0Auth, BackstageApp, BackstagePluginWithAnyOutput, BitbucketAuth, BitbucketSession, BootErrorPageProps, ErrorAlerter, ErrorApiForwarder, ErrorBoundaryFallbackProps, FeatureFlagged, FeatureFlaggedProps, FlatRoutes, GithubAuth, GithubSession, GitlabAuth, GoogleAuth, LocalStorageFeatureFlags, MicrosoftAuth, NoOpAnalyticsApi, OAuth2, OAuth2Session, OAuthRequestManager, OktaAuth, OneLoginAuth, SamlAuth, SignInPageProps, SignInResult, UnhandledErrorForwarder, UrlPatternDiscovery, WebStorage, createApp, defaultConfigLoader };
|
|
867
|
+
export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiProvider, ApiRegistry, ApiResolver, AppComponents, AppConfigLoader, AppContext, AppOptions, AppRouteBinder, AppThemeSelector, AtlassianAuth, Auth0Auth, BackstageApp, BackstagePluginWithAnyOutput, BitbucketAuth, BitbucketSession, BootErrorPageProps, ErrorAlerter, ErrorApiForwarder, ErrorBoundaryFallbackProps, FeatureFlagged, FeatureFlaggedProps, FlatRoutes, FlatRoutesProps, GithubAuth, GithubSession, GitlabAuth, GoogleAuth, LocalStorageFeatureFlags, MicrosoftAuth, NoOpAnalyticsApi, OAuth2, OAuth2Session, OAuthRequestManager, OktaAuth, OneLoginAuth, SamlAuth, SignInPageProps, SignInResult, UnhandledErrorForwarder, UrlPatternDiscovery, WebStorage, createApp, defaultConfigLoader };
|