update all usages of ApiBlueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-unprocessed-entities': patch
|
||||
'@backstage/frontend-app-api': patch
|
||||
'@backstage/core-compat-api': patch
|
||||
'@backstage/plugin-scaffolder-react': patch
|
||||
'@backstage/plugin-catalog-import': patch
|
||||
'@backstage/plugin-notifications': patch
|
||||
'@backstage/plugin-kubernetes': patch
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
'@backstage/plugin-api-docs': patch
|
||||
'@backstage/plugin-devtools': patch
|
||||
'@backstage/plugin-techdocs': patch
|
||||
'@backstage/plugin-catalog': patch
|
||||
'@backstage/plugin-signals': patch
|
||||
'@backstage/plugin-search': patch
|
||||
'@backstage/plugin-home': patch
|
||||
'@backstage/plugin-app': patch
|
||||
---
|
||||
|
||||
Internal update to use the new variant of `ApiBlueprint`.
|
||||
@@ -310,7 +310,7 @@ export function collectLegacyRoutes(
|
||||
...Array.from(plugin.getApis()).map(factory =>
|
||||
ApiBlueprint.make({
|
||||
name: factory.api.id,
|
||||
params: { factory },
|
||||
params: define => define(factory),
|
||||
}),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -232,31 +232,32 @@ describe('convertLegacyApp', () => {
|
||||
const catalogOverride = catalogPlugin.withOverrides({
|
||||
extensions: [
|
||||
catalogPlugin.getExtension('api:catalog').override({
|
||||
params: {
|
||||
factory: createApiFactory(
|
||||
catalogApiRef,
|
||||
catalogApiMock({
|
||||
entities: [
|
||||
{
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'test',
|
||||
metadata: {
|
||||
name: 'x',
|
||||
params: define =>
|
||||
define({
|
||||
api: catalogApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
catalogApiMock({
|
||||
entities: [
|
||||
{
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'test',
|
||||
metadata: {
|
||||
name: 'x',
|
||||
},
|
||||
spec: {},
|
||||
},
|
||||
spec: {},
|
||||
},
|
||||
{
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'other',
|
||||
metadata: {
|
||||
name: 'x',
|
||||
{
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'other',
|
||||
metadata: {
|
||||
name: 'x',
|
||||
},
|
||||
spec: {},
|
||||
},
|
||||
spec: {},
|
||||
},
|
||||
],
|
||||
}),
|
||||
),
|
||||
},
|
||||
],
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -74,7 +74,10 @@ export function convertLegacyAppOptions(
|
||||
new Map(allApis.map(api => [api.api.id, api])).values(),
|
||||
);
|
||||
const extensions: ExtensionDefinition[] = deduplicatedApis.map(factory =>
|
||||
ApiBlueprint.make({ name: factory.api.id, params: { factory } }),
|
||||
ApiBlueprint.make({
|
||||
name: factory.api.id,
|
||||
params: define => define(factory),
|
||||
}),
|
||||
);
|
||||
|
||||
if (icons) {
|
||||
|
||||
@@ -29,7 +29,10 @@ export function convertLegacyPlugin(
|
||||
options: { extensions: ExtensionDefinition[] },
|
||||
): NewBackstagePlugin {
|
||||
const apiExtensions = Array.from(legacyPlugin.getApis()).map(factory =>
|
||||
ApiBlueprint.make({ name: factory.api.id, params: { factory } }),
|
||||
ApiBlueprint.make({
|
||||
name: factory.api.id,
|
||||
params: define => define(factory),
|
||||
}),
|
||||
);
|
||||
return createFrontendPlugin({
|
||||
pluginId: legacyPlugin.getId(),
|
||||
|
||||
@@ -31,11 +31,7 @@ import {
|
||||
import { screen, render } from '@testing-library/react';
|
||||
import { createSpecializedApp } from './createSpecializedApp';
|
||||
import { mockApis, TestApiRegistry } from '@backstage/test-utils';
|
||||
import {
|
||||
configApiRef,
|
||||
createApiFactory,
|
||||
featureFlagsApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { configApiRef, featureFlagsApiRef } from '@backstage/core-plugin-api';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { ApiProvider, ConfigReader } from '@backstage/core-app-api';
|
||||
import { Fragment } from 'react';
|
||||
@@ -148,16 +144,20 @@ describe('createSpecializedApp', () => {
|
||||
],
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory(featureFlagsApiRef, {
|
||||
registerFlag(flag) {
|
||||
flags.push(flag);
|
||||
},
|
||||
getRegisteredFlags() {
|
||||
return flags;
|
||||
},
|
||||
} as typeof featureFlagsApiRef.T),
|
||||
},
|
||||
params: define =>
|
||||
define({
|
||||
api: featureFlagsApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
({
|
||||
registerFlag(flag) {
|
||||
flags.push(flag);
|
||||
},
|
||||
getRegisteredFlags() {
|
||||
return flags;
|
||||
},
|
||||
} as typeof featureFlagsApiRef.T),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
@@ -253,15 +253,14 @@ describe('createSpecializedApp', () => {
|
||||
pluginId: 'first',
|
||||
extensions: [
|
||||
ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: analyticsApiRef,
|
||||
deps: {},
|
||||
factory: () => {
|
||||
throw new Error('BROKEN');
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
@@ -295,13 +294,12 @@ describe('createSpecializedApp', () => {
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: analyticsApiRef,
|
||||
deps: {},
|
||||
factory: mockAnalyticsApi,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { defaultEntityContentGroups } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -73,9 +75,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'entity-card:api-docs/consumed-apis': ExtensionDefinition<{
|
||||
kind: 'entity-card';
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
ApiBlueprint,
|
||||
NavItemBlueprint,
|
||||
PageBlueprint,
|
||||
createApiFactory,
|
||||
createFrontendPlugin,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
|
||||
@@ -55,8 +54,8 @@ const apiDocsNavItem = NavItemBlueprint.make({
|
||||
|
||||
const apiDocsConfigApi = ApiBlueprint.make({
|
||||
name: 'config',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: apiDocsConfigRef,
|
||||
deps: {},
|
||||
factory: () => {
|
||||
@@ -68,7 +67,6 @@ const apiDocsConfigApi = ApiBlueprint.make({
|
||||
};
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const apiDocsExplorerPage = PageBlueprint.makeWithOverrides({
|
||||
|
||||
+191
-81
@@ -6,7 +6,9 @@
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AppTheme } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ComponentRef } from '@backstage/frontend-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
@@ -222,9 +224,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/analytics': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -237,9 +243,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/app-language': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -252,9 +262,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/app-theme': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -275,9 +289,13 @@ const appPlugin: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'app-theme';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/atlassian-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -290,9 +308,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/bitbucket-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -305,9 +327,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/bitbucket-server-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -320,9 +346,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/components': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -350,9 +380,13 @@ const appPlugin: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'components';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/dialog': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -365,9 +399,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/discovery': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -380,9 +418,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/error': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -395,9 +437,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/feature-flags': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -410,9 +456,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/fetch': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -425,9 +475,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/github-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -440,9 +494,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/gitlab-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -455,9 +513,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/google-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -470,9 +532,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/icons': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -499,9 +565,13 @@ const appPlugin: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'icons';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/microsoft-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -514,9 +584,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/oauth-request': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -529,9 +603,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/okta-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -544,9 +622,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/onelogin-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -559,9 +641,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/permission': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -574,9 +660,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/scm-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -589,9 +679,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/scm-integrations': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -604,9 +698,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/storage': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -619,9 +717,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/translations': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -653,9 +755,13 @@ const appPlugin: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'translations';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:app/vmware-cloud-auth': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -668,9 +774,13 @@ const appPlugin: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'app-root-element:app/alert-display': ExtensionDefinition<{
|
||||
config: {
|
||||
|
||||
@@ -39,7 +39,6 @@ import {
|
||||
} from '../../../packages/core-app-api/src/apis/implementations';
|
||||
|
||||
import {
|
||||
createApiFactory,
|
||||
alertApiRef,
|
||||
analyticsApiRef,
|
||||
errorApiRef,
|
||||
@@ -75,18 +74,17 @@ import { DefaultDialogApi } from './apis/DefaultDialogApi';
|
||||
export const apis = [
|
||||
ApiBlueprint.make({
|
||||
name: 'dialog',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: dialogApiRef,
|
||||
deps: {},
|
||||
factory: () => new DefaultDialogApi(),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'discovery',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: discoveryApiRef,
|
||||
deps: { configApi: configApiRef },
|
||||
factory: ({ configApi }) =>
|
||||
@@ -94,32 +92,29 @@ export const apis = [
|
||||
`${configApi.getString('backend.baseUrl')}/api/{{ pluginId }}`,
|
||||
),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'alert',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: alertApiRef,
|
||||
deps: {},
|
||||
factory: () => new AlertApiForwarder(),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'analytics',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: analyticsApiRef,
|
||||
deps: {},
|
||||
factory: () => new NoOpAnalyticsApi(),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'error',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: errorApiRef,
|
||||
deps: { alertApi: alertApiRef },
|
||||
factory: ({ alertApi }) => {
|
||||
@@ -128,22 +123,20 @@ export const apis = [
|
||||
return errorApi;
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'storage',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: storageApiRef,
|
||||
deps: { errorApi: errorApiRef },
|
||||
factory: ({ errorApi }) => WebStorage.create({ errorApi }),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'fetch',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: fetchApiRef,
|
||||
deps: {
|
||||
configApi: configApiRef,
|
||||
@@ -164,22 +157,20 @@ export const apis = [
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'oauth-request',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: oauthRequestApiRef,
|
||||
deps: {},
|
||||
factory: () => new OAuthRequestManager(),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'google-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: googleAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -194,12 +185,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'microsoft-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: microsoftAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -214,12 +204,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'github-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: githubAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -235,12 +224,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'okta-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: oktaAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -255,12 +243,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'gitlab-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: gitlabAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -275,12 +262,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'onelogin-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: oneloginAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -295,12 +281,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'bitbucket-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: bitbucketAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -316,12 +301,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'bitbucket-server-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: bitbucketServerAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -337,12 +321,11 @@ export const apis = [
|
||||
environment: configApi.getOptionalString('auth.environment'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'atlassian-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: atlassianAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -358,12 +341,11 @@ export const apis = [
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'vmware-cloud-auth',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: vmwareCloudAuthApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -379,12 +361,11 @@ export const apis = [
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'permission',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: permissionApiRef,
|
||||
deps: {
|
||||
discovery: discoveryApiRef,
|
||||
@@ -394,22 +375,18 @@ export const apis = [
|
||||
factory: ({ config, discovery, identity }) =>
|
||||
IdentityPermissionApi.create({ config, discovery, identity }),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'scm-auth',
|
||||
params: {
|
||||
factory: ScmAuth.createDefaultApiFactory(),
|
||||
},
|
||||
params: define => define(ScmAuth.createDefaultApiFactory()),
|
||||
}),
|
||||
ApiBlueprint.make({
|
||||
name: 'scm-integrations',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: scmIntegrationsApiRef,
|
||||
deps: { configApi: configApiRef },
|
||||
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
] as const;
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
import { AppLanguageSelector } from '../../../../packages/core-app-api/src/apis/implementations/AppLanguageApi';
|
||||
import { appLanguageApiRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { ApiBlueprint, createApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { ApiBlueprint } from '@backstage/frontend-plugin-api';
|
||||
|
||||
export const AppLanguageApi = ApiBlueprint.make({
|
||||
name: 'app-language',
|
||||
params: {
|
||||
factory: createApiFactory(
|
||||
appLanguageApiRef,
|
||||
AppLanguageSelector.createWithStorage(),
|
||||
),
|
||||
},
|
||||
params: define =>
|
||||
define({
|
||||
api: appLanguageApiRef,
|
||||
deps: {},
|
||||
factory: () => AppLanguageSelector.createWithStorage(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
createExtensionInput,
|
||||
ThemeBlueprint,
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
appThemeApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
@@ -41,14 +40,16 @@ export const AppThemeApi = ApiBlueprint.makeWithOverrides({
|
||||
}),
|
||||
},
|
||||
factory: (originalFactory, { inputs }) => {
|
||||
return originalFactory({
|
||||
factory: createApiFactory(
|
||||
appThemeApiRef,
|
||||
AppThemeSelector.createWithStorage(
|
||||
inputs.themes.map(i => i.get(ThemeBlueprint.dataRefs.theme)),
|
||||
),
|
||||
),
|
||||
});
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: appThemeApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
AppThemeSelector.createWithStorage(
|
||||
inputs.themes.map(i => i.get(ThemeBlueprint.dataRefs.theme)),
|
||||
),
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
createComponentExtension,
|
||||
createExtensionInput,
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
componentsApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
@@ -36,15 +35,17 @@ export const ComponentsApi = ApiBlueprint.makeWithOverrides({
|
||||
),
|
||||
},
|
||||
factory: (originalFactory, { inputs }) => {
|
||||
return originalFactory({
|
||||
factory: createApiFactory(
|
||||
componentsApiRef,
|
||||
DefaultComponentsApi.fromComponents(
|
||||
inputs.components.map(i =>
|
||||
i.get(createComponentExtension.componentDataRef),
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: componentsApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
DefaultComponentsApi.fromComponents(
|
||||
inputs.components.map(i =>
|
||||
i.get(createComponentExtension.componentDataRef),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
featureFlagsApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
@@ -27,12 +26,11 @@ import { LocalStorageFeatureFlags } from '../../../../packages/core-app-api/src/
|
||||
*/
|
||||
export const FeatureFlagsApi = ApiBlueprint.make({
|
||||
name: 'feature-flags',
|
||||
params: {
|
||||
// TODO: properly discovery feature flags, maybe rework the whole thing
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
// TODO: properly discovery feature flags, maybe rework the whole thing
|
||||
api: featureFlagsApiRef,
|
||||
deps: {},
|
||||
factory: () => new LocalStorageFeatureFlags(),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
createExtensionInput,
|
||||
IconBundleBlueprint,
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
iconsApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
@@ -37,15 +36,17 @@ export const IconsApi = ApiBlueprint.makeWithOverrides({
|
||||
}),
|
||||
},
|
||||
factory: (originalFactory, { inputs }) => {
|
||||
return originalFactory({
|
||||
factory: createApiFactory(
|
||||
iconsApiRef,
|
||||
new DefaultIconsApi(
|
||||
inputs.icons
|
||||
.map(i => i.get(IconBundleBlueprint.dataRefs.icons))
|
||||
.reduce((acc, bundle) => ({ ...acc, ...bundle }), defaultIcons),
|
||||
),
|
||||
),
|
||||
});
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: iconsApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
new DefaultIconsApi(
|
||||
inputs.icons
|
||||
.map(i => i.get(IconBundleBlueprint.dataRefs.icons))
|
||||
.reduce((acc, bundle) => ({ ...acc, ...bundle }), defaultIcons),
|
||||
),
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
import {
|
||||
ApiBlueprint,
|
||||
TranslationBlueprint,
|
||||
createApiFactory,
|
||||
createExtensionInput,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import {
|
||||
@@ -39,8 +38,8 @@ export const TranslationsApi = ApiBlueprint.makeWithOverrides({
|
||||
),
|
||||
},
|
||||
factory: (originalFactory, { inputs }) => {
|
||||
return originalFactory({
|
||||
factory: createApiFactory({
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: translationApiRef,
|
||||
deps: { languageApi: appLanguageApiRef },
|
||||
factory: ({ languageApi }) =>
|
||||
@@ -51,6 +50,6 @@ export const TranslationsApi = ApiBlueprint.makeWithOverrides({
|
||||
),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/core-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/core-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -103,9 +105,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'page:catalog-import': ExtensionDefinition<{
|
||||
kind: 'page';
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import {
|
||||
configApiRef,
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
@@ -53,8 +52,8 @@ const catalogImportPage = PageBlueprint.make({
|
||||
});
|
||||
|
||||
const catalogImportApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: catalogImportApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -81,7 +80,6 @@ const catalogImportApi = ApiBlueprint.make({
|
||||
configApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -30,9 +32,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'nav-item:catalog-unprocessed-entities': ExtensionDefinition<{
|
||||
kind: 'nav-item';
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
createApiFactory,
|
||||
createFrontendPlugin,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
@@ -37,8 +36,8 @@ import { rootRouteRef } from '../routes';
|
||||
|
||||
/** @alpha */
|
||||
export const catalogUnprocessedEntitiesApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: catalogUnprocessedEntitiesApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -47,7 +46,6 @@ export const catalogUnprocessedEntitiesApi = ApiBlueprint.make({
|
||||
factory: ({ discoveryApi, fetchApi }) =>
|
||||
new CatalogUnprocessedEntitiesClient(discoveryApi, fetchApi),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { defaultEntityContentGroups } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -146,9 +148,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:catalog/entity-presentation': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -161,9 +167,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:catalog/starred-entities': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -176,9 +186,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'catalog-filter:catalog/kind': ExtensionDefinition<{
|
||||
config: {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
storageApiRef,
|
||||
@@ -33,8 +32,8 @@ import {
|
||||
} from '../apis';
|
||||
|
||||
export const catalogApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: catalogApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -43,31 +42,28 @@ export const catalogApi = ApiBlueprint.make({
|
||||
factory: ({ discoveryApi, fetchApi }) =>
|
||||
new CatalogClient({ discoveryApi, fetchApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const catalogStarredEntitiesApi = ApiBlueprint.make({
|
||||
name: 'starred-entities',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: starredEntitiesApiRef,
|
||||
deps: { storageApi: storageApiRef },
|
||||
factory: ({ storageApi }) =>
|
||||
new DefaultStarredEntitiesApi({ storageApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const entityPresentationApi = ApiBlueprint.make({
|
||||
name: 'entity-presentation',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: entityPresentationApiRef,
|
||||
deps: { catalogApiImp: catalogApiRef },
|
||||
factory: ({ catalogApiImp }) =>
|
||||
DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -30,9 +32,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'nav-item:devtools': ExtensionDefinition<{
|
||||
kind: 'nav-item';
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
createApiFactory,
|
||||
createFrontendPlugin,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
@@ -34,8 +33,8 @@ import { rootRouteRef } from '../routes';
|
||||
|
||||
/** @alpha */
|
||||
export const devToolsApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: devToolsApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -44,7 +43,6 @@ export const devToolsApi = ApiBlueprint.make({
|
||||
factory: ({ discoveryApi, fetchApi }) =>
|
||||
new DevToolsClient({ discoveryApi, fetchApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
@@ -31,9 +33,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'app-root-element:home/visit-listener': ExtensionDefinition<{
|
||||
kind: 'app-root-element';
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
AppRootElementBlueprint,
|
||||
identityApiRef,
|
||||
storageApiRef,
|
||||
createApiFactory,
|
||||
ApiBlueprint,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { compatWrapper } from '@backstage/core-compat-api';
|
||||
@@ -79,8 +78,8 @@ const visitListenerAppRootElement = AppRootElementBlueprint.make({
|
||||
|
||||
const visitsApi = ApiBlueprint.make({
|
||||
name: 'visits',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: visitsApiRef,
|
||||
deps: {
|
||||
storageApi: storageApiRef,
|
||||
@@ -89,7 +88,6 @@ const visitsApi = ApiBlueprint.make({
|
||||
factory: ({ storageApi, identityApi }) =>
|
||||
VisitsStorageApi.create({ storageApi, identityApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { defaultEntityContentGroups } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -33,9 +35,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:kubernetes/auth-providers': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -48,9 +54,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:kubernetes/cluster-link-formatter': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -63,9 +73,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:kubernetes/proxy': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -78,9 +92,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'entity-content:kubernetes/kubernetes': ExtensionDefinition<{
|
||||
kind: 'entity-content';
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
@@ -41,8 +40,8 @@ import {
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const kubernetesApiExtension = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: kubernetesApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -56,13 +55,12 @@ export const kubernetesApiExtension = ApiBlueprint.make({
|
||||
kubernetesAuthProvidersApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const kubernetesProxyApi = ApiBlueprint.make({
|
||||
name: 'proxy',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: kubernetesProxyApiRef,
|
||||
deps: {
|
||||
kubernetesApi: kubernetesApiRef,
|
||||
@@ -72,13 +70,12 @@ export const kubernetesProxyApi = ApiBlueprint.make({
|
||||
kubernetesApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const kubernetesAuthProvidersApi = ApiBlueprint.make({
|
||||
name: 'auth-providers',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: kubernetesAuthProvidersApiRef,
|
||||
deps: {
|
||||
gitlabAuthApi: gitlabAuthApiRef,
|
||||
@@ -109,13 +106,12 @@ export const kubernetesAuthProvidersApi = ApiBlueprint.make({
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const kubernetesClusterLinkFormatterApi = ApiBlueprint.make({
|
||||
name: 'cluster-link-formatter',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: kubernetesClusterLinkFormatterApiRef,
|
||||
deps: { googleAuthApi: googleAuthApiRef },
|
||||
factory: deps => {
|
||||
@@ -126,5 +122,4 @@ export const kubernetesClusterLinkFormatterApi = ApiBlueprint.make({
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -29,9 +31,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'page:notifications': ExtensionDefinition<{
|
||||
kind: 'page';
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import {
|
||||
ApiBlueprint,
|
||||
PageBlueprint,
|
||||
createApiFactory,
|
||||
createFrontendPlugin,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
@@ -41,14 +40,13 @@ const page = PageBlueprint.make({
|
||||
});
|
||||
|
||||
const api = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: notificationsApiRef,
|
||||
deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
|
||||
factory: ({ discoveryApi, fetchApi }) =>
|
||||
new NotificationsClient({ discoveryApi, fetchApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyApiRef } from '@backstage/core-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { ApiRef } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { CustomFieldValidator } from '@backstage/plugin-scaffolder-react';
|
||||
@@ -218,9 +220,13 @@ export const formFieldsApi: ExtensionDefinition<{
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'form-fields';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
createExtensionInput,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { formFieldsApiRef } from './ref';
|
||||
@@ -53,12 +52,12 @@ export const formFieldsApi = ApiBlueprint.makeWithOverrides({
|
||||
e.get(FormFieldBlueprint.dataRefs.formFieldLoader),
|
||||
);
|
||||
|
||||
return originalFactory({
|
||||
factory: createApiFactory({
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: formFieldsApiRef,
|
||||
deps: {},
|
||||
factory: () => new DefaultScaffolderFormFieldsApi(formFieldLoaders),
|
||||
}),
|
||||
});
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { ApiRef } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -66,9 +68,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:scaffolder/form-decorators': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -93,9 +99,13 @@ const _default: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'form-decorators';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:scaffolder/form-fields': ExtensionDefinition<{
|
||||
config: {};
|
||||
@@ -120,9 +130,13 @@ const _default: FrontendPlugin<
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'form-fields';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'entity-icon-link:scaffolder/launch-template': ExtensionDefinition<{
|
||||
kind: 'entity-icon-link';
|
||||
@@ -273,9 +287,13 @@ export const formDecoratorsApi: ExtensionDefinition<{
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'form-decorators';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
createExtensionInput,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { ScaffolderFormDecoratorsApi } from './types';
|
||||
@@ -58,8 +57,8 @@ export const formDecoratorsApi = ApiBlueprint.makeWithOverrides({
|
||||
e.get(FormDecoratorBlueprint.dataRefs.formDecoratorLoader),
|
||||
);
|
||||
|
||||
return originalFactory({
|
||||
factory: createApiFactory({
|
||||
return originalFactory(define =>
|
||||
define({
|
||||
api: formDecoratorsApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
@@ -67,6 +66,6 @@ export const formDecoratorsApi = ApiBlueprint.makeWithOverrides({
|
||||
decorators: formDecorators,
|
||||
}),
|
||||
}),
|
||||
});
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
NavItemBlueprint,
|
||||
PageBlueprint,
|
||||
ApiBlueprint,
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
identityApiRef,
|
||||
@@ -74,8 +73,8 @@ export const repoUrlPickerFormField = FormFieldBlueprint.make({
|
||||
});
|
||||
|
||||
export const scaffolderApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: scaffolderApiRef,
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
@@ -91,5 +90,4 @@ export const scaffolderApi = ApiBlueprint.make({
|
||||
identityApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/core-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/core-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
@@ -35,9 +37,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'nav-item:search': ExtensionDefinition<{
|
||||
kind: 'nav-item';
|
||||
@@ -145,9 +151,13 @@ export const searchApi: ExtensionDefinition<{
|
||||
configInput: {};
|
||||
output: ConfigurableExtensionDataRef<AnyApiFactory, 'core.api.factory', {}>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
useApi,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
createApiFactory,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
import {
|
||||
@@ -77,14 +76,13 @@ import {
|
||||
|
||||
/** @alpha */
|
||||
export const searchApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: searchApiRef,
|
||||
deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
|
||||
factory: ({ discoveryApi, fetchApi }) =>
|
||||
new SearchClient({ discoveryApi, fetchApi }),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const useSearchPageStyles = makeStyles((theme: Theme) => ({
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -25,9 +27,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'app-root-element:signals/signals-display': ExtensionDefinition<{
|
||||
kind: 'app-root-element';
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import {
|
||||
ApiBlueprint,
|
||||
AppRootElementBlueprint,
|
||||
createApiFactory,
|
||||
createFrontendPlugin,
|
||||
discoveryApiRef,
|
||||
identityApiRef,
|
||||
@@ -28,8 +27,8 @@ import { SignalsDisplay } from './plugin';
|
||||
import { compatWrapper } from '@backstage/core-compat-api';
|
||||
|
||||
const api = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: signalApiRef,
|
||||
deps: {
|
||||
identity: identityApiRef,
|
||||
@@ -42,7 +41,6 @@ const api = ApiBlueprint.make({
|
||||
});
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const signalsDisplayAppRootElement = AppRootElementBlueprint.make({
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { BlueprintParams } from '@backstage/frontend-plugin-api/src/wiring/createExtensionBlueprint';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { defaultEntityContentGroups } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -46,9 +48,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'api:techdocs/storage': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
@@ -61,9 +67,13 @@ const _default: FrontendPlugin<
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => BlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'empty-state:techdocs/entity-content': ExtensionDefinition<{
|
||||
config: {};
|
||||
|
||||
@@ -26,7 +26,6 @@ import {
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import {
|
||||
configApiRef,
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
@@ -68,8 +67,8 @@ const techdocsEntityIconLink = EntityIconLinkBlueprint.make({
|
||||
/** @alpha */
|
||||
const techDocsStorageApi = ApiBlueprint.make({
|
||||
name: 'storage',
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: techdocsStorageApiRef,
|
||||
deps: {
|
||||
configApi: configApiRef,
|
||||
@@ -83,13 +82,12 @@ const techDocsStorageApi = ApiBlueprint.make({
|
||||
fetchApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
const techDocsClientApi = ApiBlueprint.make({
|
||||
params: {
|
||||
factory: createApiFactory({
|
||||
params: define =>
|
||||
define({
|
||||
api: techdocsApiRef,
|
||||
deps: {
|
||||
configApi: configApiRef,
|
||||
@@ -103,7 +101,6 @@ const techDocsClientApi = ApiBlueprint.make({
|
||||
fetchApi,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
|
||||
Reference in New Issue
Block a user