import { UserEntity, Entity } from '@backstage/catalog-model'; import * as _backstage_core_plugin_api from '@backstage/core-plugin-api'; import { FetchApi, ConfigApi, IdentityApi } from '@backstage/core-plugin-api'; import { CatalogApi } from '@backstage/plugin-catalog-react'; import * as React from 'react'; import React__default from 'react'; interface IWithChangeLog { createdBy: string; updatedBy: string; createdAt: Date; updatedAt: Date; } type EntityRelations = Record; type ScorecardRuleCondition = { property: string; operator: '=' | '!=' | '>' | '<' | '>=' | '<='; value: number; } | (({ property: string; } | { relation: string; }) & { property: string; operator: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'contains' | 'containsAny' | 'beginsWith' | 'endsWith' | 'doesNotContains' | 'doesNotBeginsWith' | 'doesNotEndsWith' | 'between' | 'notBetween'; value: string | any[]; }) | { property: string; operator: '=' | '!='; value: boolean; } | (({ property: string; } | { relation: string; }) & { operator: 'isEmpty' | 'isNotEmpty'; }); type PortEntity = { identifier: string; title?: string; team?: string[]; icon?: string; blueprint: string; properties: Record; relations?: EntityRelations; scorecards?: Record; }[]; level: string; }>; }; type UserInputs = { properties: Record; order?: string[]; required?: string[]; }; type NotificationFormat = 'json' | 'slack'; type ActionTrigger = { operation: 'CREATE' | 'DELETE' | 'DAY-2'; userInputs: UserInputs; }; type Action = { id: string; identifier: string; blueprint: string; trigger: ActionTrigger; description?: string; approvalNotification?: { type: 'email'; } | { type: 'webhook'; url: string; format?: NotificationFormat; }; userInputs: UserInputs; requiredApproval?: boolean | { type: 'ANY' | 'ALL'; }; invocationMethod: { type: 'KAFKA'; } | { type: 'WEBHOOK'; agent?: boolean; url: string; synchronized?: boolean; method?: 'POST' | 'DELETE' | 'PATCH' | 'PUT'; } | { type: 'GITHUB'; org: string; repo: string; workflow: string; omitPayload?: boolean; omitUserInputs?: boolean; reportWorkflowStatus?: boolean; } | { type: 'GITLAB'; projectName: string; groupName: string; omitPayload?: boolean; omitUserInputs?: boolean; defaultRef?: string; agent: boolean; } | { type: 'AZURE-DEVOPS'; webhook: string; org: string; } | { type: 'MOCK'; }; title?: string; icon?: string; } & IWithChangeLog; type GlobalActionSelfServiceTrigger = { type: 'self-service'; blueprintIdentifier?: string; userInputs: UserInputs; } & ({ operation: 'CREATE'; } | { operation: 'DELETE' | 'DAY-2'; condition?: { type: 'SEARCH'; combinator: 'and' | 'or'; rules: any; }; }); type GlobalActionAutomationTrigger = { type: 'automation'; event: StrictUnion<{ type: 'ENTITY_CREATED'; blueprintIdentifier: string; } | { type: 'ENTITY_UPDATED'; blueprintIdentifier: string; } | { type: 'ENTITY_DELETED'; blueprintIdentifier: string; } | { type: 'TIMER_PROPERTY_EXPIRED'; blueprintIdentifier: string; propertyIdentifier: string; } | { type: 'ANY_ENTITY_CHANGE'; blueprintIdentifier: string; } | { type: 'RUN_CREATED'; actionIdentifier: string; } | { type: 'RUN_UPDATED'; actionIdentifier: string; } | { type: 'ANY_RUN_CHANGE'; actionIdentifier: string; }>; condition?: { type: 'JQ'; expressions: string[]; combinator?: 'and' | 'or'; }; }; type KafkaInvocationAction = { type: 'KAFKA'; payload?: string | unknown[] | Record; }; type WebhookInvocationAction = { type: 'WEBHOOK'; url: string; agent?: boolean | string; synchronized?: boolean | string; method?: string; headers?: Record; body?: string | unknown[] | Record; }; type GithubInvocationAction = { type: 'GITHUB'; org: string; repo: string; workflow: string; reportWorkflowStatus?: boolean | string; workflowInputs?: Record; }; type GitlabInvocationAction = { type: 'GITLAB'; projectName: string; groupName: string; defaultRef?: string; pipelineVariables?: Record; }; type AzureDevopsInvocationAction = { type: 'AZURE_DEVOPS'; webhook: string; org: string; payload?: string | unknown[] | Record; }; type UpsertEntityInvocationAction = { type: 'UPSERT_ENTITY'; blueprintIdentifier: string; mapping: { identifier?: string; title?: string; team?: string | string[]; icon?: string; properties?: Record; relations?: Record; }; }; type ActionInvocationType = StrictUnion; type UnionKeys = T extends T ? keyof T : never; type StrictUnionHelper = T extends any ? T & Partial, keyof T>, undefined>> : never; type StrictUnion = StrictUnionHelper; type GlobalAction = ActionInvocationType> = Pick & { id: string; trigger: StrictUnion; invocationMethod: T; publish?: boolean; } & IWithChangeLog; type FormulaProperty = { title?: string; icon?: string; formula: string; }; type MirrorProperty = { title?: string; path: string; }; type CalculationProperty = { title?: string; icon?: string; type: any; format?: string; calculation: string; spec?: string; description?: string; specAuthentication?: { clientId: string; authorizationUrl: string; tokenUrl: string; authorizationScope?: string[]; }; colorized?: boolean; colors?: string; items?: Record; }; type AggregationAverageOf = 'hour' | 'day' | 'week' | 'month' | 'total'; type AggregationAverageByEntities = { calculationBy: 'entities'; func: 'average'; averageOf: AggregationAverageOf; measureTimeBy?: string; }; type AggregationCountByEntities = { calculationBy: 'entities'; func: 'count'; }; type AggregationByEntities = AggregationAverageByEntities | AggregationCountByEntities; type AggregationAveragePropertyCalc = { property: string; func: 'average'; averageOf: AggregationAverageOf; measureTimeBy?: string; calculationBy: 'property'; }; type AggregationPropertyCalc = { calculationBy: 'property'; func: 'sum' | 'min' | 'max' | 'median'; property: string; }; type AggregationByProperties = AggregationAveragePropertyCalc | AggregationPropertyCalc; type CalculationSpec = AggregationByEntities | AggregationByProperties; type AggregationProperty = { title?: string; icon?: string; type: any; description?: string; target: string; calculationSpec: CalculationSpec; query?: any; }; type Relation = { title?: string; description?: string; target: string; many: boolean; required: boolean; }; type BlueprintSchema = any; type BlueprintDirectOwnership = { type: any; }; type BlueprintInheritedOwnership = { type: any; path: string; }; type BlueprintOwnership = BlueprintDirectOwnership | BlueprintInheritedOwnership; type Blueprint = { identifier: string; title: string; description?: string; icon?: string; schema: BlueprintSchema; formulaProperties?: { [key: string]: FormulaProperty; }; mirrorProperties?: { [key: string]: MirrorProperty; }; calculationProperties?: { [key: string]: CalculationProperty; }; aggregationProperties?: { [key: string]: AggregationProperty; }; relations?: { [key: string]: Relation; }; changelogDestination?: { type: 'KAFKA'; } | { type: 'WEBHOOK'; agent?: boolean; url: string; }; teamInheritance?: { path: string; }; ownership?: BlueprintOwnership; }; type Integration = { installationId: string; installationAppType: string; config: any; resyncState?: { lastResyncEnd: string; status: 'completed' | 'failed' | 'running'; }; }; declare const portApiRef: _backstage_core_plugin_api.ApiRef; type Options = { fetchApi: FetchApi; configApi: ConfigApi; identityApi: IdentityApi; catalogApi: CatalogApi; }; declare class PortAPI { private readonly fetchApi; private readonly configApi; private readonly identityApi; private readonly catalogApi; private readonly backendApiUrl; constructor(options: Options); getUserInfo(): Promise; private getUrl; getActions(blueprintId: string): Promise<(GlobalAction | Action)[]>; executeAction(actionId: string, entityId: string, properties?: Record): Promise; getEntity(entityId: string, blueprintId: string): Promise; getAllScorecardDefinitions(): Promise; search(searchQuery: object, include?: string[]): Promise; createBlueprint(blueprint: string): Promise; getBlueprints(): Promise; getIntegrations(): Promise; updateIntegration(identifier: string, config: string): Promise; } type UsePortResult Promise> = { execute: T; data: Awaited> | undefined; error: Error | undefined; loading: boolean; }; declare function useActionRun(): UsePortResult; declare function useActionsQuery(blueprintId: string): UsePortResult; declare function useBlueprint(): PortAPI['createBlueprint']; declare function useBlueprintsList(): UsePortResult; declare function useEntityQuery(entityId: string | undefined, blueprintId: string): UsePortResult; declare function useIntegrationsList(): UsePortResult; declare function useSearchQuery(searchQuery: any, include?: string[]): UsePortResult; declare function useUserInfo(): UsePortResult; declare const index_d_useActionRun: typeof useActionRun; declare const index_d_useActionsQuery: typeof useActionsQuery; declare const index_d_useBlueprint: typeof useBlueprint; declare const index_d_useBlueprintsList: typeof useBlueprintsList; declare const index_d_useEntityQuery: typeof useEntityQuery; declare const index_d_useIntegrationsList: typeof useIntegrationsList; declare const index_d_useSearchQuery: typeof useSearchQuery; declare const index_d_useUserInfo: typeof useUserInfo; declare namespace index_d { export { index_d_useActionRun as useActionRun, index_d_useActionsQuery as useActionsQuery, index_d_useBlueprint as useBlueprint, index_d_useBlueprintsList as useBlueprintsList, index_d_useEntityQuery as useEntityQuery, index_d_useIntegrationsList as useIntegrationsList, index_d_useSearchQuery as useSearchQuery, index_d_useUserInfo as useUserInfo }; } declare const SettingsPage: () => React__default.JSX.Element; declare function PortInformationCard$1(): React__default.JSX.Element; declare function Actions$1(): React__default.JSX.Element; declare function ScorecardCard$1(): React__default.JSX.Element | null; declare const portPlugin: _backstage_core_plugin_api.BackstagePlugin<{ root: _backstage_core_plugin_api.RouteRef; }, {}, {}>; declare const EntityTabPortContent: ({ blueprint, entities, isLoading, }: { blueprint: string; entities: PortEntity[]; isLoading: boolean; }) => React.JSX.Element; declare const ScorecardCard: typeof ScorecardCard$1; declare const Actions: typeof Actions$1; declare const PortInformationCard: typeof PortInformationCard$1; declare const ScorecardsPage: () => React.JSX.Element; declare const useEntityRoutes: () => React__default.JSX.Element[]; declare const isPortDataAvailable: (entity: Entity) => boolean; export { Actions, index_d as ApiHooks, EntityTabPortContent, PortAPI, PortInformationCard, ScorecardCard, ScorecardsPage, SettingsPage, isPortDataAvailable, portApiRef, portPlugin, useEntityRoutes };