import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { CatalogScmEvent } from '@backstage/plugin-catalog-node/alpha'; /** * Options for {@link analyzeGitLabWebhookEvent}. * @alpha */ interface AnalyzeWebhookEventOptions { /** Optional logger for debug output when events are ignored or unsupported. */ logger?: LoggerService; /** * Predicate that returns true for file paths that are relevant to the * catalog (e.g. paths ending in `.yaml` or `.yml`). */ isRelevantPath: (path: string) => boolean; } /** * The result of analyzing a GitLab webhook event. * * - `ok` — one or more catalog SCM events were produced. * - `ignored` — the event was valid but not relevant (e.g. push to a * non-default branch, or no catalog files affected). * - `aborted` — the event could not be fully processed due to missing data. * - `unsupported-event` — the event type is not handled by this analyzer. * * @alpha */ type AnalyzeWebhookEventResult = { result: 'unsupported-event'; event: string; } | { result: 'ignored'; reason: string; } | { result: 'aborted'; reason: string; } | { result: 'ok'; events: CatalogScmEvent[]; }; /** * Analyzes a GitLab webhook event and translates it into zero or more catalog * SCM events that entity providers can act on. * * Supported event types: * - `push` — translates file-level adds, modifications, and deletions on the * default branch into `location.created`, `location.updated`, and * `location.deleted` events for paths matching `isRelevantPath`. * - `repository_update` — translates repository renames, transfers, and * deletions into `repository.moved` and `repository.deleted` events. * * @alpha */ declare function analyzeGitLabWebhookEvent(eventType: string, eventPayload: unknown, options: AnalyzeWebhookEventOptions): Promise; /** @alpha */ declare const _feature: _backstage_backend_plugin_api.BackendFeature; export { analyzeGitLabWebhookEvent, _feature as default }; export type { AnalyzeWebhookEventOptions, AnalyzeWebhookEventResult };