chore(catalog): replace internal uses of deprecated types
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Replace uses of deprecated types with replacements internally.
|
||||
@@ -12,7 +12,7 @@ import { AnalyzeLocationRequest as AnalyzeLocationRequest_2 } from '@backstage/p
|
||||
import { AnalyzeLocationResponse as AnalyzeLocationResponse_2 } from '@backstage/plugin-catalog-common';
|
||||
import { AnalyzeOptions as AnalyzeOptions_2 } from '@backstage/plugin-catalog-node';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import type { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import { CatalogEntityDocument } from '@backstage/plugin-catalog-common';
|
||||
import { CatalogProcessor as CatalogProcessor_2 } from '@backstage/plugin-catalog-node';
|
||||
import { CatalogProcessorCache as CatalogProcessorCache_2 } from '@backstage/plugin-catalog-node';
|
||||
@@ -26,7 +26,7 @@ import { CatalogProcessorRelationResult as CatalogProcessorRelationResult_2 } fr
|
||||
import { CatalogProcessorResult as CatalogProcessorResult_2 } from '@backstage/plugin-catalog-node';
|
||||
import { Config } from '@backstage/config';
|
||||
import { DefaultCatalogCollatorFactory as DefaultCatalogCollatorFactory_2 } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import type { DefaultCatalogCollatorFactoryOptions as DefaultCatalogCollatorFactoryOptions_2 } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import { DefaultCatalogCollatorFactoryOptions as DefaultCatalogCollatorFactoryOptions_2 } from '@backstage/plugin-search-backend-module-catalog';
|
||||
import { DeferredEntity as DeferredEntity_2 } from '@backstage/plugin-catalog-node';
|
||||
import { EntitiesSearchFilter as EntitiesSearchFilter_2 } from '@backstage/plugin-catalog-node';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
@@ -38,7 +38,6 @@ import { EntityProviderMutation as EntityProviderMutation_2 } from '@backstage/p
|
||||
import { EntityRelationSpec as EntityRelationSpec_2 } from '@backstage/plugin-catalog-node';
|
||||
import { EventBroker } from '@backstage/plugin-events-node';
|
||||
import { GetEntitiesRequest } from '@backstage/catalog-client';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { LocationSpec as LocationSpec_2 } from '@backstage/plugin-catalog-common';
|
||||
import { locationSpecToLocationEntity as locationSpecToLocationEntity_2 } from '@backstage/plugin-catalog-node';
|
||||
import { locationSpecToMetadataName as locationSpecToMetadataName_2 } from '@backstage/plugin-catalog-node';
|
||||
@@ -48,6 +47,10 @@ import { PermissionAuthorizer } from '@backstage/plugin-permission-common';
|
||||
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
|
||||
import { PermissionRule } from '@backstage/plugin-permission-node';
|
||||
import { PermissionRuleParams } from '@backstage/plugin-permission-common';
|
||||
import { PlaceholderResolver as PlaceholderResolver_2 } from '@backstage/plugin-catalog-node';
|
||||
import { PlaceholderResolverParams as PlaceholderResolverParams_2 } from '@backstage/plugin-catalog-node';
|
||||
import { PlaceholderResolverRead as PlaceholderResolverRead_2 } from '@backstage/plugin-catalog-node';
|
||||
import { PlaceholderResolverResolveUrl as PlaceholderResolverResolveUrl_2 } from '@backstage/plugin-catalog-node';
|
||||
import { PluginDatabaseManager } from '@backstage/backend-common';
|
||||
import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
||||
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
||||
@@ -160,7 +163,7 @@ export class CatalogBuilder {
|
||||
setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder;
|
||||
setPlaceholderResolver(
|
||||
key: string,
|
||||
resolver: PlaceholderResolver,
|
||||
resolver: PlaceholderResolver_2,
|
||||
): CatalogBuilder;
|
||||
setProcessingInterval(
|
||||
processingInterval: ProcessingIntervalFunction,
|
||||
@@ -349,8 +352,8 @@ export class FileReaderProcessor implements CatalogProcessor_2 {
|
||||
// @public (undocumented)
|
||||
export type LocationAnalyzer = {
|
||||
analyzeLocation(
|
||||
location: AnalyzeLocationRequest,
|
||||
): Promise<AnalyzeLocationResponse>;
|
||||
location: AnalyzeLocationRequest_2,
|
||||
): Promise<AnalyzeLocationResponse_2>;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
@@ -401,34 +404,22 @@ export class PlaceholderProcessor implements CatalogProcessor_2 {
|
||||
|
||||
// @public (undocumented)
|
||||
export type PlaceholderProcessorOptions = {
|
||||
resolvers: Record<string, PlaceholderResolver>;
|
||||
resolvers: Record<string, PlaceholderResolver_2>;
|
||||
reader: UrlReader;
|
||||
integrations: ScmIntegrationRegistry;
|
||||
};
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type PlaceholderResolver = (
|
||||
params: PlaceholderResolverParams,
|
||||
) => Promise<JsonValue>;
|
||||
export type PlaceholderResolver = PlaceholderResolver_2;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type PlaceholderResolverParams = {
|
||||
key: string;
|
||||
value: JsonValue;
|
||||
baseUrl: string;
|
||||
read: PlaceholderResolverRead;
|
||||
resolveUrl: PlaceholderResolverResolveUrl;
|
||||
emit: CatalogProcessorEmit_2;
|
||||
};
|
||||
export type PlaceholderResolverParams = PlaceholderResolverParams_2;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type PlaceholderResolverRead = (url: string) => Promise<Buffer>;
|
||||
export type PlaceholderResolverRead = PlaceholderResolverRead_2;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type PlaceholderResolverResolveUrl = (
|
||||
url: string,
|
||||
base: string,
|
||||
) => string;
|
||||
export type PlaceholderResolverResolveUrl = PlaceholderResolverResolveUrl_2;
|
||||
|
||||
// @public
|
||||
export type ProcessingIntervalFunction = () => number;
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
type AnalyzeLocationRequest as _AnalyzeLocationRequest,
|
||||
type AnalyzeLocationResponse as _AnalyzeLocationResponse,
|
||||
type LocationSpec as _LocationSpec,
|
||||
} from '@backstage/plugin-catalog-common';
|
||||
import {
|
||||
locationSpecToMetadataName as _locationSpecToMetadataName,
|
||||
locationSpecToLocationEntity as _locationSpecToLocationEntity,
|
||||
@@ -36,9 +41,12 @@ import {
|
||||
type EntityProviderConnection as _EntityProviderConnection,
|
||||
type EntityProviderMutation as _EntityProviderMutation,
|
||||
type AnalyzeOptions as _AnalyzeOptions,
|
||||
type PlaceholderResolver as _PlaceholderResolver,
|
||||
type PlaceholderResolverParams as _PlaceholderResolverParams,
|
||||
type PlaceholderResolverRead as _PlaceholderResolverRead,
|
||||
type PlaceholderResolverResolveUrl as _PlaceholderResolverResolveUrl,
|
||||
type ScmLocationAnalyzer as _ScmLocationAnalyzer,
|
||||
} from '@backstage/plugin-catalog-node';
|
||||
import { type LocationSpec as _LocationSpec } from '@backstage/plugin-catalog-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -165,3 +173,38 @@ export type AnalyzeOptions = _AnalyzeOptions;
|
||||
* @deprecated import from `@backstage/plugin-catalog-node` instead
|
||||
*/
|
||||
export type ScmLocationAnalyzer = _ScmLocationAnalyzer;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-catalog-node` instead
|
||||
*/
|
||||
export type PlaceholderResolver = _PlaceholderResolver;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-catalog-node` instead
|
||||
*/
|
||||
export type PlaceholderResolverParams = _PlaceholderResolverParams;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-catalog-node` instead
|
||||
*/
|
||||
export type PlaceholderResolverRead = _PlaceholderResolverRead;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-catalog-node` instead
|
||||
*/
|
||||
export type PlaceholderResolverResolveUrl = _PlaceholderResolverResolveUrl;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use the same type from `@backstage/plugin-catalog-common` instead
|
||||
*/
|
||||
export type AnalyzeLocationRequest = _AnalyzeLocationRequest;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use the same type from `@backstage/plugin-catalog-common` instead
|
||||
*/
|
||||
export type AnalyzeLocationResponse = _AnalyzeLocationResponse;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { DefaultCatalogRulesEnforcer } from './CatalogRules';
|
||||
import { LocationSpec } from '@backstage/plugin-catalog-node';
|
||||
import { LocationSpec } from '@backstage/plugin-catalog-common';
|
||||
|
||||
const entity = {
|
||||
user: {
|
||||
|
||||
@@ -18,7 +18,5 @@ export type {
|
||||
AnalyzeLocationEntityField,
|
||||
AnalyzeLocationExistingEntity,
|
||||
AnalyzeLocationGenerateEntity,
|
||||
AnalyzeLocationRequest,
|
||||
AnalyzeLocationResponse,
|
||||
LocationAnalyzer,
|
||||
} from './types';
|
||||
|
||||
@@ -15,24 +15,13 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AnalyzeLocationRequest as NonDeprecatedAnalyzeLocationRequest,
|
||||
AnalyzeLocationResponse as NonDeprecatedAnalyzeLocationResponse,
|
||||
AnalyzeLocationRequest,
|
||||
AnalyzeLocationResponse,
|
||||
AnalyzeLocationExistingEntity as NonDeprecatedAnalyzeLocationExistingEntity,
|
||||
AnalyzeLocationGenerateEntity as NonDeprecatedAnalyzeLocationGenerateEntity,
|
||||
AnalyzeLocationEntityField as NonDeprecatedAnalyzeLocationEntityField,
|
||||
} from '@backstage/plugin-catalog-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use the same type from `@backstage/plugin-catalog-common` instead
|
||||
*/
|
||||
export type AnalyzeLocationRequest = NonDeprecatedAnalyzeLocationRequest;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use the same type from `@backstage/plugin-catalog-common` instead
|
||||
*/
|
||||
export type AnalyzeLocationResponse = NonDeprecatedAnalyzeLocationResponse;
|
||||
|
||||
/**
|
||||
* If the folder pointed to already contained catalog info yaml files, they are
|
||||
* read and emitted like this so that the frontend can inform the user that it
|
||||
|
||||
@@ -17,13 +17,15 @@ import { UrlReader } from '@backstage/backend-common';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { CatalogProcessorResult } from '@backstage/plugin-catalog-node';
|
||||
import {
|
||||
jsonPlaceholderResolver,
|
||||
PlaceholderProcessor,
|
||||
CatalogProcessorResult,
|
||||
PlaceholderResolver,
|
||||
PlaceholderResolverParams,
|
||||
PlaceholderResolverRead,
|
||||
} from '@backstage/plugin-catalog-node';
|
||||
import {
|
||||
jsonPlaceholderResolver,
|
||||
PlaceholderProcessor,
|
||||
textPlaceholderResolver,
|
||||
yamlPlaceholderResolver,
|
||||
} from './PlaceholderProcessor';
|
||||
|
||||
@@ -23,45 +23,11 @@ import { LocationSpec } from '@backstage/plugin-catalog-common';
|
||||
import {
|
||||
CatalogProcessor,
|
||||
CatalogProcessorEmit,
|
||||
PlaceholderResolver,
|
||||
PlaceholderResolverParams,
|
||||
processingResult,
|
||||
} from '@backstage/plugin-catalog-node';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
|
||||
*/
|
||||
export type PlaceholderResolverRead = (url: string) => Promise<Buffer>;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
|
||||
*/
|
||||
export type PlaceholderResolverResolveUrl = (
|
||||
url: string,
|
||||
base: string,
|
||||
) => string;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
|
||||
*/
|
||||
export type PlaceholderResolverParams = {
|
||||
key: string;
|
||||
value: JsonValue;
|
||||
baseUrl: string;
|
||||
read: PlaceholderResolverRead;
|
||||
resolveUrl: PlaceholderResolverResolveUrl;
|
||||
emit: CatalogProcessorEmit;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
|
||||
*/
|
||||
export type PlaceholderResolver = (
|
||||
params: PlaceholderResolverParams,
|
||||
) => Promise<JsonValue>;
|
||||
|
||||
/** @public */
|
||||
export type PlaceholderProcessorOptions = {
|
||||
resolvers: Record<string, PlaceholderResolver>;
|
||||
|
||||
@@ -21,12 +21,6 @@ export { FileReaderProcessor } from './FileReaderProcessor';
|
||||
export { LocationEntityProcessor } from './LocationEntityProcessor';
|
||||
export type { LocationEntityProcessorOptions } from './LocationEntityProcessor';
|
||||
export { PlaceholderProcessor } from './PlaceholderProcessor';
|
||||
export type {
|
||||
PlaceholderProcessorOptions,
|
||||
PlaceholderResolver,
|
||||
PlaceholderResolverParams,
|
||||
PlaceholderResolverRead,
|
||||
PlaceholderResolverResolveUrl,
|
||||
} from './PlaceholderProcessor';
|
||||
export type { PlaceholderProcessorOptions } from './PlaceholderProcessor';
|
||||
export { UrlReaderProcessor } from './UrlReaderProcessor';
|
||||
export { parseEntityYaml } from '../util/parse';
|
||||
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
CatalogProcessorParser,
|
||||
EntitiesSearchFilter,
|
||||
EntityProvider,
|
||||
PlaceholderResolver,
|
||||
ScmLocationAnalyzer,
|
||||
} from '@backstage/plugin-catalog-node';
|
||||
import {
|
||||
@@ -47,7 +48,6 @@ import {
|
||||
CodeOwnersProcessor,
|
||||
FileReaderProcessor,
|
||||
PlaceholderProcessor,
|
||||
PlaceholderResolver,
|
||||
UrlReaderProcessor,
|
||||
} from '../modules';
|
||||
import { ConfigLocationEntityProvider } from '../modules/core/ConfigLocationEntityProvider';
|
||||
|
||||
@@ -29,10 +29,10 @@ import {
|
||||
import {
|
||||
CatalogProcessor,
|
||||
EntityProvider,
|
||||
PlaceholderResolver,
|
||||
ScmLocationAnalyzer,
|
||||
} from '@backstage/plugin-catalog-node';
|
||||
import { loggerToWinstonLogger } from '@backstage/backend-common';
|
||||
import { PlaceholderResolver } from '../modules';
|
||||
|
||||
class CatalogProcessingExtensionPointImpl
|
||||
implements CatalogProcessingExtensionPoint
|
||||
|
||||
Reference in New Issue
Block a user