@backstage/core-app-api 0.2.1 → 0.5.0-next.0
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 +59 -0
- package/dist/index.d.ts +140 -165
- package/dist/index.esm.js +259 -84
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# @backstage/core-app-api
|
|
2
2
|
|
|
3
|
+
## 0.5.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ceebe25391: Removed deprecated `SignInResult` type, which was replaced with the new `onSignInSuccess` callback.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/core-plugin-api@0.6.0-next.0
|
|
13
|
+
- @backstage/config@0.1.13-next.0
|
|
14
|
+
|
|
15
|
+
## 0.4.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- e2eb92c109: Removed previously deprecated `ApiRegistry` export.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 34442cd5cf: Fixed an issue where valid SAML and GitHub sessions would be considered invalid and not be stored.
|
|
24
|
+
|
|
25
|
+
Deprecated the `SamlSession` and `GithubSession` types.
|
|
26
|
+
|
|
27
|
+
- 784d8078ab: Removed direct and transitive MUI dependencies.
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- @backstage/config@0.1.12
|
|
30
|
+
- @backstage/core-plugin-api@0.5.0
|
|
31
|
+
|
|
32
|
+
## 0.3.1
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead.
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- @backstage/core-plugin-api@0.4.1
|
|
39
|
+
- @backstage/core-components@0.8.3
|
|
40
|
+
|
|
41
|
+
## 0.3.0
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- a195284c7b: Updated `WebStorageApi` to reflect the `StorageApi` changes in `@backstage/core-plugin-api`.
|
|
46
|
+
- b3605da81c: - Removed deprecated definition `createApp` from `@backstage/core-app-api` which has been replaced by `@backstage/app-defaults#createApp`
|
|
47
|
+
- Removed deprecated type `BackstagePluginWithAnyOutput`
|
|
48
|
+
- Removed deprecated constructors for `GithubAuth`, `OAuth2`, and `SamlAuth` as the `create` method should be used instead
|
|
49
|
+
- 68f8b10ccd: - Removed deprecation configuration option `theme` from `AppTheme` of the `AppThemeApi`
|
|
50
|
+
- Removed reference to `theme` in the `app-defaults` default `AppTheme`
|
|
51
|
+
- Removed logic in `AppThemeProvider` that creates `ThemeProvider` from `appTheme.theme`
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- 7927005152: Add `FetchApi` and related `fetchApiRef` which implement fetch, with an added Backstage token header when available.
|
|
56
|
+
- 518ddc00bc: Schema-validate local storage cached session info on load
|
|
57
|
+
- Updated dependencies
|
|
58
|
+
- @backstage/app-defaults@0.1.3
|
|
59
|
+
- @backstage/core-plugin-api@0.4.0
|
|
60
|
+
- @backstage/core-components@0.8.2
|
|
61
|
+
|
|
3
62
|
## 0.2.1
|
|
4
63
|
|
|
5
64
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ReactNode, PropsWithChildren, ComponentType } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ApiHolder, ApiRef, ApiFactory, AnyApiRef, ProfileInfo,
|
|
3
|
+
import { ApiHolder, ApiRef, ApiFactory, AnyApiRef, ProfileInfo, BackstageIdentityResponse, OAuthRequestApi, DiscoveryApi, AuthProviderInfo, OAuthApi, SessionApi, SessionState, AuthRequestOptions, gitlabAuthApiRef, googleAuthApiRef, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, oktaAuthApiRef, auth0AuthApiRef, microsoftAuthApiRef, oneloginAuthApiRef, bitbucketAuthApiRef, atlassianAuthApiRef, AlertApi, AlertMessage, AnalyticsApi, AnalyticsEvent, AppThemeApi, AppTheme, ErrorApi, ErrorApiError, ErrorApiErrorContext, FeatureFlagsApi, FeatureFlag, FeatureFlagsSaveOptions, FetchApi, IdentityApi, OAuthRequesterOptions, OAuthRequester, PendingOAuthRequest, StorageApi, StorageValueSnapshot, BackstagePlugin, IconComponent, ExternalRouteRef, AnyApiFactory, RouteRef, SubRouteRef } from '@backstage/core-plugin-api';
|
|
4
4
|
import * as _backstage_types from '@backstage/types';
|
|
5
|
-
import { Observable } from '@backstage/types';
|
|
6
|
-
import { AppConfig } from '@backstage/config';
|
|
5
|
+
import { Observable, JsonValue } from '@backstage/types';
|
|
6
|
+
import { Config, AppConfig } from '@backstage/config';
|
|
7
7
|
export { ConfigReader } from '@backstage/config';
|
|
8
|
-
import { createApp as createApp$1 } from '@backstage/app-defaults';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Prop types for the ApiProvider component.
|
|
@@ -31,45 +30,6 @@ declare const ApiProvider: {
|
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
declare type ApiImpl<T = unknown> = readonly [ApiRef<T>, T];
|
|
35
|
-
declare class ApiRegistryBuilder {
|
|
36
|
-
private apis;
|
|
37
|
-
add<T, I extends T>(api: ApiRef<T>, impl: I): I;
|
|
38
|
-
build(): ApiRegistry;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A registry for utility APIs.
|
|
42
|
-
*
|
|
43
|
-
* @public
|
|
44
|
-
* @deprecated Will be removed, use {@link @backstage/test-utils#TestApiProvider} or {@link @backstage/test-utils#TestApiRegistry} instead.
|
|
45
|
-
*/
|
|
46
|
-
declare class ApiRegistry implements ApiHolder {
|
|
47
|
-
private readonly apis;
|
|
48
|
-
static builder(): ApiRegistryBuilder;
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new ApiRegistry with a list of API implementations.
|
|
51
|
-
*
|
|
52
|
-
* @param apis - A list of pairs mapping an ApiRef to its respective implementation
|
|
53
|
-
*/
|
|
54
|
-
static from(apis: ApiImpl[]): ApiRegistry;
|
|
55
|
-
/**
|
|
56
|
-
* Creates a new ApiRegistry with a single API implementation.
|
|
57
|
-
*
|
|
58
|
-
* @param api - ApiRef for the API to add
|
|
59
|
-
* @param impl - Implementation of the API to add
|
|
60
|
-
*/
|
|
61
|
-
static with<T>(api: ApiRef<T>, impl: T): ApiRegistry;
|
|
62
|
-
constructor(apis: Map<string, unknown>);
|
|
63
|
-
/**
|
|
64
|
-
* Returns a new ApiRegistry with the provided API added to the existing ones.
|
|
65
|
-
*
|
|
66
|
-
* @param api - ApiRef for the API to add
|
|
67
|
-
* @param impl - Implementation of the API to add
|
|
68
|
-
*/
|
|
69
|
-
with<T>(api: ApiRef<T>, impl: T): ApiRegistry;
|
|
70
|
-
get<T>(api: ApiRef<T>): T | undefined;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
33
|
/**
|
|
74
34
|
* @public
|
|
75
35
|
*/
|
|
@@ -135,6 +95,7 @@ declare class ApiFactoryRegistry implements ApiFactoryHolder {
|
|
|
135
95
|
* Session information for GitHub auth.
|
|
136
96
|
*
|
|
137
97
|
* @public
|
|
98
|
+
* @deprecated This type is internal and will be removed
|
|
138
99
|
*/
|
|
139
100
|
declare type GithubSession = {
|
|
140
101
|
providerInfo: {
|
|
@@ -143,23 +104,7 @@ declare type GithubSession = {
|
|
|
143
104
|
expiresAt?: Date;
|
|
144
105
|
};
|
|
145
106
|
profile: ProfileInfo;
|
|
146
|
-
backstageIdentity:
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
declare type GetSessionOptions = {
|
|
150
|
-
optional?: boolean;
|
|
151
|
-
instantPopup?: boolean;
|
|
152
|
-
scopes?: Set<string>;
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* A sessions manager keeps track of the current session and makes sure that
|
|
156
|
-
* multiple simultaneous requests for sessions with different scope are handled
|
|
157
|
-
* in a correct way.
|
|
158
|
-
*/
|
|
159
|
-
declare type SessionManager<T> = {
|
|
160
|
-
getSession(options: GetSessionOptions): Promise<T | undefined>;
|
|
161
|
-
removeSession(): Promise<void>;
|
|
162
|
-
sessionState$(): Observable<SessionState>;
|
|
107
|
+
backstageIdentity: BackstageIdentityResponse;
|
|
163
108
|
};
|
|
164
109
|
|
|
165
110
|
/**
|
|
@@ -188,15 +133,12 @@ declare type AuthApiCreateOptions = {
|
|
|
188
133
|
declare class GithubAuth implements OAuthApi, SessionApi {
|
|
189
134
|
private readonly sessionManager;
|
|
190
135
|
static create(options: OAuthApiCreateOptions): GithubAuth;
|
|
191
|
-
|
|
192
|
-
* @deprecated will be made private in the future. Use create method instead.
|
|
193
|
-
*/
|
|
194
|
-
constructor(sessionManager: SessionManager<GithubSession>);
|
|
136
|
+
private constructor();
|
|
195
137
|
signIn(): Promise<void>;
|
|
196
138
|
signOut(): Promise<void>;
|
|
197
139
|
sessionState$(): Observable<SessionState>;
|
|
198
140
|
getAccessToken(scope?: string, options?: AuthRequestOptions): Promise<string>;
|
|
199
|
-
getBackstageIdentity(options?: AuthRequestOptions): Promise<
|
|
141
|
+
getBackstageIdentity(options?: AuthRequestOptions): Promise<BackstageIdentityResponse | undefined>;
|
|
200
142
|
getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
|
|
201
143
|
static normalizeScope(scope?: string): Set<string>;
|
|
202
144
|
}
|
|
@@ -219,22 +161,6 @@ declare class GoogleAuth {
|
|
|
219
161
|
static create(options: OAuthApiCreateOptions): typeof googleAuthApiRef.T;
|
|
220
162
|
}
|
|
221
163
|
|
|
222
|
-
/**
|
|
223
|
-
* Session information for generic OAuth2 auth.
|
|
224
|
-
*
|
|
225
|
-
* @public
|
|
226
|
-
*/
|
|
227
|
-
declare type OAuth2Session = {
|
|
228
|
-
providerInfo: {
|
|
229
|
-
idToken: string;
|
|
230
|
-
accessToken: string;
|
|
231
|
-
scopes: Set<string>;
|
|
232
|
-
expiresAt: Date;
|
|
233
|
-
};
|
|
234
|
-
profile: ProfileInfo;
|
|
235
|
-
backstageIdentity: BackstageIdentity;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
164
|
/**
|
|
239
165
|
* OAuth2 create options.
|
|
240
166
|
* @public
|
|
@@ -251,42 +177,41 @@ declare class OAuth2 implements OAuthApi, OpenIdConnectApi, ProfileInfoApi, Back
|
|
|
251
177
|
static create(options: OAuth2CreateOptions): OAuth2;
|
|
252
178
|
private readonly sessionManager;
|
|
253
179
|
private readonly scopeTransform;
|
|
254
|
-
|
|
255
|
-
* @deprecated will be made private in the future. Use create method instead.
|
|
256
|
-
*/
|
|
257
|
-
constructor(options: {
|
|
258
|
-
sessionManager: SessionManager<OAuth2Session>;
|
|
259
|
-
scopeTransform: (scopes: string[]) => string[];
|
|
260
|
-
});
|
|
180
|
+
private constructor();
|
|
261
181
|
signIn(): Promise<void>;
|
|
262
182
|
signOut(): Promise<void>;
|
|
263
183
|
sessionState$(): Observable<SessionState>;
|
|
264
184
|
getAccessToken(scope?: string | string[], options?: AuthRequestOptions): Promise<string>;
|
|
265
185
|
getIdToken(options?: AuthRequestOptions): Promise<string>;
|
|
266
|
-
getBackstageIdentity(options?: AuthRequestOptions): Promise<
|
|
186
|
+
getBackstageIdentity(options?: AuthRequestOptions): Promise<BackstageIdentityResponse | undefined>;
|
|
267
187
|
getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
|
|
268
188
|
private static normalizeScopes;
|
|
269
189
|
}
|
|
270
190
|
|
|
271
191
|
/**
|
|
272
|
-
*
|
|
192
|
+
* Session information for generic OAuth2 auth.
|
|
273
193
|
*
|
|
274
194
|
* @public
|
|
275
195
|
*/
|
|
276
|
-
declare
|
|
277
|
-
|
|
278
|
-
|
|
196
|
+
declare type OAuth2Session = {
|
|
197
|
+
providerInfo: {
|
|
198
|
+
idToken: string;
|
|
199
|
+
accessToken: string;
|
|
200
|
+
scopes: Set<string>;
|
|
201
|
+
expiresAt: Date;
|
|
202
|
+
};
|
|
203
|
+
profile: ProfileInfo;
|
|
204
|
+
backstageIdentity: BackstageIdentityResponse;
|
|
205
|
+
};
|
|
279
206
|
|
|
280
207
|
/**
|
|
281
|
-
*
|
|
208
|
+
* Implements the OAuth flow to Okta products.
|
|
282
209
|
*
|
|
283
210
|
* @public
|
|
284
211
|
*/
|
|
285
|
-
declare
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
backstageIdentity: BackstageIdentity;
|
|
289
|
-
};
|
|
212
|
+
declare class OktaAuth {
|
|
213
|
+
static create(options: OAuthApiCreateOptions): typeof oktaAuthApiRef.T;
|
|
214
|
+
}
|
|
290
215
|
|
|
291
216
|
/**
|
|
292
217
|
* Implements a general SAML based auth flow.
|
|
@@ -297,16 +222,25 @@ declare class SamlAuth implements ProfileInfoApi, BackstageIdentityApi, SessionA
|
|
|
297
222
|
private readonly sessionManager;
|
|
298
223
|
static create(options: AuthApiCreateOptions): SamlAuth;
|
|
299
224
|
sessionState$(): Observable<SessionState>;
|
|
300
|
-
|
|
301
|
-
* @deprecated will be made private in the future. Use create method instead.
|
|
302
|
-
*/
|
|
303
|
-
constructor(sessionManager: SessionManager<SamlSession>);
|
|
225
|
+
private constructor();
|
|
304
226
|
signIn(): Promise<void>;
|
|
305
227
|
signOut(): Promise<void>;
|
|
306
|
-
getBackstageIdentity(options?: AuthRequestOptions): Promise<
|
|
228
|
+
getBackstageIdentity(options?: AuthRequestOptions): Promise<BackstageIdentityResponse | undefined>;
|
|
307
229
|
getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
|
|
308
230
|
}
|
|
309
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Session information for SAML auth.
|
|
234
|
+
*
|
|
235
|
+
* @public
|
|
236
|
+
* @deprecated This type is internal and will be removed
|
|
237
|
+
*/
|
|
238
|
+
declare type ExportedSamlSession = {
|
|
239
|
+
userId: string;
|
|
240
|
+
profile: ProfileInfo;
|
|
241
|
+
backstageIdentity: BackstageIdentityResponse;
|
|
242
|
+
};
|
|
243
|
+
|
|
310
244
|
/**
|
|
311
245
|
* Implements the OAuth flow to Auth0 products.
|
|
312
246
|
*
|
|
@@ -373,7 +307,7 @@ declare type BitbucketSession = {
|
|
|
373
307
|
expiresAt?: Date;
|
|
374
308
|
};
|
|
375
309
|
profile: ProfileInfo;
|
|
376
|
-
backstageIdentity:
|
|
310
|
+
backstageIdentity: BackstageIdentityResponse;
|
|
377
311
|
};
|
|
378
312
|
|
|
379
313
|
/**
|
|
@@ -511,6 +445,87 @@ declare class LocalStorageFeatureFlags implements FeatureFlagsApi {
|
|
|
511
445
|
private load;
|
|
512
446
|
}
|
|
513
447
|
|
|
448
|
+
/**
|
|
449
|
+
* A middleware that modifies the behavior of an ongoing fetch.
|
|
450
|
+
*
|
|
451
|
+
* @public
|
|
452
|
+
*/
|
|
453
|
+
interface FetchMiddleware {
|
|
454
|
+
/**
|
|
455
|
+
* Applies this middleware to an inner implementation.
|
|
456
|
+
*
|
|
457
|
+
* @param next - The next, inner, implementation, that this middleware shall
|
|
458
|
+
* call out to as part of the request cycle.
|
|
459
|
+
*/
|
|
460
|
+
apply(next: typeof fetch): typeof fetch;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Builds a fetch API, based on the builtin fetch wrapped by a set of optional
|
|
465
|
+
* middleware implementations that add behaviors.
|
|
466
|
+
*
|
|
467
|
+
* @remarks
|
|
468
|
+
*
|
|
469
|
+
* The middleware are applied in reverse order, i.e. the last one will be
|
|
470
|
+
* "closest" to the base implementation. Passing in `[M1, M2, M3]` effectively
|
|
471
|
+
* leads to `M1(M2(M3(baseImplementation)))`.
|
|
472
|
+
*
|
|
473
|
+
* @public
|
|
474
|
+
*/
|
|
475
|
+
declare function createFetchApi(options: {
|
|
476
|
+
baseImplementation?: typeof fetch | undefined;
|
|
477
|
+
middleware?: FetchMiddleware | FetchMiddleware[] | undefined;
|
|
478
|
+
}): FetchApi;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* A collection of common middlewares for the FetchApi.
|
|
482
|
+
*
|
|
483
|
+
* @public
|
|
484
|
+
*/
|
|
485
|
+
declare class FetchMiddlewares {
|
|
486
|
+
/**
|
|
487
|
+
* Handles translation from `plugin://` URLs to concrete http(s) URLs based on
|
|
488
|
+
* the discovery API.
|
|
489
|
+
*
|
|
490
|
+
* @remarks
|
|
491
|
+
*
|
|
492
|
+
* If the request is for `plugin://catalog/entities?filter=x=y`, the discovery
|
|
493
|
+
* API will be queried for `'catalog'`. If it returned
|
|
494
|
+
* `https://backstage.example.net/api/catalog`, the resulting query would be
|
|
495
|
+
* `https://backstage.example.net/api/catalog/entities?filter=x=y`.
|
|
496
|
+
*
|
|
497
|
+
* If the incoming URL protocol was not `plugin`, the request is just passed
|
|
498
|
+
* through verbatim to the underlying implementation.
|
|
499
|
+
*/
|
|
500
|
+
static resolvePluginProtocol(options: {
|
|
501
|
+
discoveryApi: DiscoveryApi;
|
|
502
|
+
}): FetchMiddleware;
|
|
503
|
+
/**
|
|
504
|
+
* Injects a Backstage token header when the user is signed in.
|
|
505
|
+
*
|
|
506
|
+
* @remarks
|
|
507
|
+
*
|
|
508
|
+
* Per default, an `Authorization: Bearer <token>` is generated. This can be
|
|
509
|
+
* customized using the `header` option.
|
|
510
|
+
*
|
|
511
|
+
* The header injection only happens on allowlisted URLs. Per default, if the
|
|
512
|
+
* `config` option is passed in, the `backend.baseUrl` is allowlisted, unless
|
|
513
|
+
* the `urlPrefixAllowlist` option is passed in, in which case it takes
|
|
514
|
+
* precedence. If you pass in neither config nor an allowlist, the middleware
|
|
515
|
+
* will have no effect.
|
|
516
|
+
*/
|
|
517
|
+
static injectIdentityAuth(options: {
|
|
518
|
+
identityApi: IdentityApi;
|
|
519
|
+
config?: Config;
|
|
520
|
+
urlPrefixAllowlist?: string[];
|
|
521
|
+
header?: {
|
|
522
|
+
name: string;
|
|
523
|
+
value: (backstageToken: string) => string;
|
|
524
|
+
};
|
|
525
|
+
}): FetchMiddleware;
|
|
526
|
+
private constructor();
|
|
527
|
+
}
|
|
528
|
+
|
|
514
529
|
/**
|
|
515
530
|
* The OAuthRequestManager is an implementation of the OAuthRequestApi.
|
|
516
531
|
*
|
|
@@ -543,10 +558,11 @@ declare class WebStorage implements StorageApi {
|
|
|
543
558
|
namespace?: string;
|
|
544
559
|
}): WebStorage;
|
|
545
560
|
get<T>(key: string): T | undefined;
|
|
561
|
+
snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T>;
|
|
546
562
|
forBucket(name: string): WebStorage;
|
|
547
563
|
set<T>(key: string, data: T): Promise<void>;
|
|
548
564
|
remove(key: string): Promise<void>;
|
|
549
|
-
observe$<T>(key: string): Observable<
|
|
565
|
+
observe$<T>(key: string): Observable<StorageValueSnapshot<T>>;
|
|
550
566
|
private getKeyName;
|
|
551
567
|
private notifyChanges;
|
|
552
568
|
private subscribers;
|
|
@@ -562,27 +578,6 @@ declare type BootErrorPageProps = {
|
|
|
562
578
|
step: 'load-config' | 'load-chunk';
|
|
563
579
|
error: Error;
|
|
564
580
|
};
|
|
565
|
-
/**
|
|
566
|
-
* The outcome of signing in on the sign-in page.
|
|
567
|
-
*
|
|
568
|
-
* @public
|
|
569
|
-
* @deprecated replaced by passing the {@link @backstage/core-plugin-api#IdentityApi} to the {@link SignInPageProps.onSignInSuccess} instead.
|
|
570
|
-
*/
|
|
571
|
-
declare type SignInResult = {
|
|
572
|
-
/**
|
|
573
|
-
* User ID that will be returned by the IdentityApi
|
|
574
|
-
*/
|
|
575
|
-
userId: string;
|
|
576
|
-
profile: ProfileInfo;
|
|
577
|
-
/**
|
|
578
|
-
* Function used to retrieve an ID token for the signed in user.
|
|
579
|
-
*/
|
|
580
|
-
getIdToken?: () => Promise<string>;
|
|
581
|
-
/**
|
|
582
|
-
* Sign out handler that will be called if the user requests to sign out.
|
|
583
|
-
*/
|
|
584
|
-
signOut?: () => Promise<void>;
|
|
585
|
-
};
|
|
586
581
|
/**
|
|
587
582
|
* Props for the `SignInPage` component of {@link AppComponents}.
|
|
588
583
|
*
|
|
@@ -694,7 +689,7 @@ declare type TargetRouteMap<ExternalRoutes extends {
|
|
|
694
689
|
};
|
|
695
690
|
/**
|
|
696
691
|
* A function that can bind from external routes of a given plugin, to concrete
|
|
697
|
-
* routes of other plugins. See {@link
|
|
692
|
+
* routes of other plugins. See {@link createSpecializedApp}.
|
|
698
693
|
*
|
|
699
694
|
* @public
|
|
700
695
|
*/
|
|
@@ -702,28 +697,7 @@ declare type AppRouteBinder = <ExternalRoutes extends {
|
|
|
702
697
|
[name: string]: ExternalRouteRef;
|
|
703
698
|
}>(externalRoutes: ExternalRoutes, targetRoutes: PartialKeys<TargetRouteMap<ExternalRoutes>, KeysWithType<ExternalRoutes, ExternalRouteRef<any, true>>>) => void;
|
|
704
699
|
/**
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
* @public
|
|
708
|
-
* @remarks
|
|
709
|
-
* @deprecated Will be removed
|
|
710
|
-
*
|
|
711
|
-
* The `type: string` type is there to handle output from newer or older plugin
|
|
712
|
-
* API versions that might not be supported by this version of the app API, but
|
|
713
|
-
* we don't want to break at the type checking level. We only use this more
|
|
714
|
-
* permissive type for the `createApp` options, as we otherwise want to stick
|
|
715
|
-
* to using the type for the outputs that we know about in this version of the
|
|
716
|
-
* app api.
|
|
717
|
-
*
|
|
718
|
-
* TODO(freben): This should be marked internal but that's not supported by the api report generation tools yet
|
|
719
|
-
*/
|
|
720
|
-
declare type BackstagePluginWithAnyOutput = Omit<BackstagePlugin<any, any>, 'output'> & {
|
|
721
|
-
output(): (PluginOutput | {
|
|
722
|
-
type: string;
|
|
723
|
-
})[];
|
|
724
|
-
};
|
|
725
|
-
/**
|
|
726
|
-
* The options accepted by {@link createApp}.
|
|
700
|
+
* The options accepted by {@link createSpecializedApp}.
|
|
727
701
|
*
|
|
728
702
|
* @public
|
|
729
703
|
*/
|
|
@@ -750,11 +724,14 @@ declare type AppOptions = {
|
|
|
750
724
|
/**
|
|
751
725
|
* A list of all plugins to include in the app.
|
|
752
726
|
*/
|
|
753
|
-
plugins?:
|
|
754
|
-
output():
|
|
727
|
+
plugins?: Array<BackstagePlugin<any, any> & {
|
|
728
|
+
output?(): Array<{
|
|
729
|
+
type: 'feature-flag';
|
|
730
|
+
name: string;
|
|
731
|
+
} | {
|
|
755
732
|
type: string;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
733
|
+
}>;
|
|
734
|
+
}>;
|
|
758
735
|
/**
|
|
759
736
|
* Supply components to the app to override the default ones.
|
|
760
737
|
*/
|
|
@@ -823,7 +800,7 @@ declare type AppOptions = {
|
|
|
823
800
|
}): void;
|
|
824
801
|
};
|
|
825
802
|
/**
|
|
826
|
-
* The public API of the output of {@link
|
|
803
|
+
* The public API of the output of {@link createSpecializedApp}.
|
|
827
804
|
*
|
|
828
805
|
* @public
|
|
829
806
|
*/
|
|
@@ -868,21 +845,19 @@ declare type AppContext = {
|
|
|
868
845
|
getComponents(): AppComponents;
|
|
869
846
|
};
|
|
870
847
|
|
|
871
|
-
/**
|
|
872
|
-
* Creates a new Backstage App.
|
|
873
|
-
*
|
|
874
|
-
* @deprecated Use {@link @backstage/app-defaults#createApp} from `@backstage/app-defaults` instead
|
|
875
|
-
* @param options - A set of options for creating the app
|
|
876
|
-
* @public
|
|
877
|
-
*/
|
|
878
|
-
declare function createApp(options?: Parameters<typeof createApp$1>[0]): BackstageApp & AppContext;
|
|
879
|
-
|
|
880
848
|
/**
|
|
881
849
|
* Creates a new Backstage App where the full set of options are required.
|
|
882
850
|
*
|
|
883
851
|
* @public
|
|
884
852
|
* @param options - A set of options for creating the app
|
|
885
853
|
* @returns
|
|
854
|
+
* @remarks
|
|
855
|
+
*
|
|
856
|
+
* You will most likely want to use {@link @backstage/app-defaults#createApp},
|
|
857
|
+
* however, this low-level API allows you to provide a full set of options,
|
|
858
|
+
* including your own `components`, `icons`, `defaultApis`, and `themes`. This
|
|
859
|
+
* is particularly useful if you are not using `@backstage/core-components` or
|
|
860
|
+
* MUI, as it allows you to avoid those dependencies completely.
|
|
886
861
|
*/
|
|
887
862
|
declare function createSpecializedApp(options: AppOptions): BackstageApp;
|
|
888
863
|
|
|
@@ -941,4 +916,4 @@ declare type FeatureFlaggedProps = {
|
|
|
941
916
|
*/
|
|
942
917
|
declare const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element;
|
|
943
918
|
|
|
944
|
-
export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiFactoryScope, ApiProvider, ApiProviderProps,
|
|
919
|
+
export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiFactoryScope, ApiProvider, ApiProviderProps, ApiResolver, AppComponents, AppConfigLoader, AppContext, AppIcons, AppOptions, AppRouteBinder, AppThemeSelector, AtlassianAuth, Auth0Auth, AuthApiCreateOptions, BackstageApp, BitbucketAuth, BitbucketSession, BootErrorPageProps, ErrorAlerter, ErrorApiForwarder, ErrorBoundaryFallbackProps, FeatureFlagged, FeatureFlaggedProps, FetchMiddleware, FetchMiddlewares, FlatRoutes, FlatRoutesProps, GithubAuth, GithubSession, GitlabAuth, GoogleAuth, LocalStorageFeatureFlags, MicrosoftAuth, NoOpAnalyticsApi, OAuth2, OAuth2CreateOptions, OAuth2Session, OAuthApiCreateOptions, OAuthRequestManager, OktaAuth, OneLoginAuth, OneLoginAuthCreateOptions, SamlAuth, ExportedSamlSession as SamlSession, SignInPageProps, UnhandledErrorForwarder, UrlPatternDiscovery, WebStorage, createFetchApi, createSpecializedApp, defaultConfigLoader };
|