|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
```ts
|
|
|
|
|
/// <reference types="node" />
|
|
|
|
|
|
|
|
|
|
import { ActionContext as ActionContext_2 } from '@backstage/plugin-scaffolder-node';
|
|
|
|
|
import { BackendFeature } from '@backstage/backend-plugin-api';
|
|
|
|
|
import { CatalogApi } from '@backstage/catalog-client';
|
|
|
|
|
import { CatalogProcessor } from '@backstage/plugin-catalog-backend';
|
|
|
|
@@ -27,17 +28,20 @@ import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
|
|
|
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
|
|
|
import { ScmIntegrations } from '@backstage/integration';
|
|
|
|
|
import { SpawnOptionsWithoutStdio } from 'child_process';
|
|
|
|
|
import { TaskSecrets } from '@backstage/plugin-scaffolder-node';
|
|
|
|
|
import { TaskSecrets as TaskSecrets_2 } from '@backstage/plugin-scaffolder-node';
|
|
|
|
|
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
|
|
|
|
import { TaskSpecV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
|
|
|
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
|
|
|
|
import { TemplateAction as TemplateAction_2 } from '@backstage/plugin-scaffolder-node';
|
|
|
|
|
import { UrlReader } from '@backstage/backend-common';
|
|
|
|
|
import { Writable } from 'stream';
|
|
|
|
|
|
|
|
|
|
// @public @deprecated (undocumented)
|
|
|
|
|
export type ActionContext<TInput extends JsonObject> = ActionContext_2<TInput>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export const createBuiltinActions: (
|
|
|
|
|
options: CreateBuiltInActionsOptions,
|
|
|
|
|
) => TemplateAction<JsonObject>[];
|
|
|
|
|
) => TemplateAction_2<JsonObject>[];
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export interface CreateBuiltInActionsOptions {
|
|
|
|
@@ -54,7 +58,7 @@ export interface CreateBuiltInActionsOptions {
|
|
|
|
|
export function createCatalogRegisterAction(options: {
|
|
|
|
|
catalogClient: CatalogApi;
|
|
|
|
|
integrations: ScmIntegrations;
|
|
|
|
|
}): TemplateAction<
|
|
|
|
|
}): TemplateAction_2<
|
|
|
|
|
| {
|
|
|
|
|
catalogInfoUrl: string;
|
|
|
|
|
optional?: boolean | undefined;
|
|
|
|
@@ -67,13 +71,13 @@ export function createCatalogRegisterAction(options: {
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export function createCatalogWriteAction(): TemplateAction<{
|
|
|
|
|
export function createCatalogWriteAction(): TemplateAction_2<{
|
|
|
|
|
filePath?: string | undefined;
|
|
|
|
|
entity: Entity;
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export function createDebugLogAction(): TemplateAction<{
|
|
|
|
|
export function createDebugLogAction(): TemplateAction_2<{
|
|
|
|
|
message?: string | undefined;
|
|
|
|
|
listWorkspace?: boolean | undefined;
|
|
|
|
|
}>;
|
|
|
|
@@ -81,7 +85,7 @@ export function createDebugLogAction(): TemplateAction<{
|
|
|
|
|
// @public
|
|
|
|
|
export function createFetchCatalogEntityAction(options: {
|
|
|
|
|
catalogClient: CatalogApi;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
entityRef: string;
|
|
|
|
|
optional?: boolean | undefined;
|
|
|
|
|
}>;
|
|
|
|
@@ -90,7 +94,7 @@ export function createFetchCatalogEntityAction(options: {
|
|
|
|
|
export function createFetchPlainAction(options: {
|
|
|
|
|
reader: UrlReader;
|
|
|
|
|
integrations: ScmIntegrations;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
url: string;
|
|
|
|
|
targetPath?: string | undefined;
|
|
|
|
|
}>;
|
|
|
|
@@ -101,7 +105,7 @@ export function createFetchTemplateAction(options: {
|
|
|
|
|
integrations: ScmIntegrations;
|
|
|
|
|
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
|
|
|
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
url: string;
|
|
|
|
|
targetPath?: string | undefined;
|
|
|
|
|
values: any;
|
|
|
|
@@ -113,12 +117,12 @@ export function createFetchTemplateAction(options: {
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export const createFilesystemDeleteAction: () => TemplateAction<{
|
|
|
|
|
export const createFilesystemDeleteAction: () => TemplateAction_2<{
|
|
|
|
|
files: string[];
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export const createFilesystemRenameAction: () => TemplateAction<{
|
|
|
|
|
export const createFilesystemRenameAction: () => TemplateAction_2<{
|
|
|
|
|
files: Array<{
|
|
|
|
|
from: string;
|
|
|
|
|
to: string;
|
|
|
|
@@ -130,7 +134,7 @@ export const createFilesystemRenameAction: () => TemplateAction<{
|
|
|
|
|
export function createGithubActionsDispatchAction(options: {
|
|
|
|
|
integrations: ScmIntegrations;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
workflowId: string;
|
|
|
|
|
branchOrTagName: string;
|
|
|
|
@@ -146,7 +150,7 @@ export function createGithubActionsDispatchAction(options: {
|
|
|
|
|
export function createGithubIssuesLabelAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
number: number;
|
|
|
|
|
labels: string[];
|
|
|
|
@@ -176,7 +180,7 @@ export type CreateGithubPullRequestClientFactoryInput = {
|
|
|
|
|
export function createGithubRepoCreateAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
homepage?: string | undefined;
|
|
|
|
@@ -243,7 +247,7 @@ export function createGithubRepoPushAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -282,7 +286,7 @@ export function createGithubWebhookAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
defaultWebhookSecret?: string;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
webhookUrl: string;
|
|
|
|
|
webhookSecret?: string | undefined;
|
|
|
|
@@ -297,7 +301,7 @@ export function createGithubWebhookAction(options: {
|
|
|
|
|
export function createPublishAzureAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -312,7 +316,7 @@ export function createPublishAzureAction(options: {
|
|
|
|
|
export function createPublishBitbucketAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -329,7 +333,7 @@ export function createPublishBitbucketAction(options: {
|
|
|
|
|
export function createPublishBitbucketCloudAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -342,7 +346,7 @@ export function createPublishBitbucketCloudAction(options: {
|
|
|
|
|
export function createPublishBitbucketServerAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -359,7 +363,7 @@ export function createPublishBitbucketServerAction(options: {
|
|
|
|
|
export function createPublishGerritAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description: string;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
@@ -373,7 +377,7 @@ export function createPublishGerritAction(options: {
|
|
|
|
|
export function createPublishGerritReviewAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
branch?: string | undefined;
|
|
|
|
|
sourcePath?: string | undefined;
|
|
|
|
@@ -387,7 +391,7 @@ export function createPublishGithubAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
description?: string | undefined;
|
|
|
|
|
homepage?: string | undefined;
|
|
|
|
@@ -460,7 +464,7 @@ export const createPublishGithubPullRequestAction: ({
|
|
|
|
|
integrations,
|
|
|
|
|
githubCredentialsProvider,
|
|
|
|
|
clientFactory,
|
|
|
|
|
}: CreateGithubPullRequestActionOptions) => TemplateAction<{
|
|
|
|
|
}: CreateGithubPullRequestActionOptions) => TemplateAction_2<{
|
|
|
|
|
title: string;
|
|
|
|
|
branchName: string;
|
|
|
|
|
description: string;
|
|
|
|
@@ -477,7 +481,7 @@ export const createPublishGithubPullRequestAction: ({
|
|
|
|
|
export function createPublishGitlabAction(options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
config: Config;
|
|
|
|
|
}): TemplateAction<{
|
|
|
|
|
}): TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
defaultBranch?: string | undefined;
|
|
|
|
|
repoVisibility?: 'internal' | 'private' | 'public' | undefined;
|
|
|
|
@@ -493,7 +497,7 @@ export function createPublishGitlabAction(options: {
|
|
|
|
|
// @public
|
|
|
|
|
export const createPublishGitlabMergeRequestAction: (options: {
|
|
|
|
|
integrations: ScmIntegrationRegistry;
|
|
|
|
|
}) => TemplateAction<{
|
|
|
|
|
}) => TemplateAction_2<{
|
|
|
|
|
repoUrl: string;
|
|
|
|
|
title: string;
|
|
|
|
|
description: string;
|
|
|
|
@@ -510,6 +514,11 @@ export const createPublishGitlabMergeRequestAction: (options: {
|
|
|
|
|
// @public
|
|
|
|
|
export function createRouter(options: RouterOptions): Promise<express.Router>;
|
|
|
|
|
|
|
|
|
|
// @public @deprecated (undocumented)
|
|
|
|
|
export const createTemplateAction: <TInput extends JsonObject>(
|
|
|
|
|
templateAction: TemplateAction_2<TInput>,
|
|
|
|
|
) => TemplateAction_2<TInput>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export type CreateWorkerOptions = {
|
|
|
|
|
taskBroker: TaskBroker;
|
|
|
|
@@ -525,7 +534,7 @@ export type CreateWorkerOptions = {
|
|
|
|
|
// @public
|
|
|
|
|
export interface CurrentClaimedTask {
|
|
|
|
|
createdBy?: string;
|
|
|
|
|
secrets?: TaskSecrets;
|
|
|
|
|
secrets?: TaskSecrets_2;
|
|
|
|
|
spec: TaskSpec;
|
|
|
|
|
taskId: string;
|
|
|
|
|
}
|
|
|
|
@@ -606,7 +615,7 @@ export type OctokitWithPullRequestPluginClient = Octokit & {
|
|
|
|
|
// @public
|
|
|
|
|
export interface RouterOptions {
|
|
|
|
|
// (undocumented)
|
|
|
|
|
actions?: TemplateAction<any>[];
|
|
|
|
|
actions?: TemplateAction_2<any>[];
|
|
|
|
|
// (undocumented)
|
|
|
|
|
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
|
|
|
// (undocumented)
|
|
|
|
@@ -664,7 +673,7 @@ export const scaffolderPlugin: (
|
|
|
|
|
|
|
|
|
|
// @alpha
|
|
|
|
|
export type ScaffolderPluginOptions = {
|
|
|
|
|
actions?: TemplateAction<any>[];
|
|
|
|
|
actions?: TemplateAction_2<any>[];
|
|
|
|
|
taskWorkers?: number;
|
|
|
|
|
taskBroker?: TaskBroker;
|
|
|
|
|
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
|
|
@@ -679,7 +688,7 @@ export type SerializedTask = {
|
|
|
|
|
createdAt: string;
|
|
|
|
|
lastHeartbeatAt?: string;
|
|
|
|
|
createdBy?: string;
|
|
|
|
|
secrets?: TaskSecrets;
|
|
|
|
|
secrets?: TaskSecrets_2;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
@@ -716,7 +725,7 @@ export interface TaskBroker {
|
|
|
|
|
// @public
|
|
|
|
|
export type TaskBrokerDispatchOptions = {
|
|
|
|
|
spec: TaskSpec;
|
|
|
|
|
secrets?: TaskSecrets;
|
|
|
|
|
secrets?: TaskSecrets_2;
|
|
|
|
|
createdBy?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -743,7 +752,7 @@ export interface TaskContext {
|
|
|
|
|
// (undocumented)
|
|
|
|
|
isDryRun?: boolean;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
secrets?: TaskSecrets;
|
|
|
|
|
secrets?: TaskSecrets_2;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
spec: TaskSpec;
|
|
|
|
|
}
|
|
|
|
@@ -770,11 +779,14 @@ export class TaskManager implements TaskContext {
|
|
|
|
|
// (undocumented)
|
|
|
|
|
getWorkspaceName(): Promise<string>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
get secrets(): TaskSecrets | undefined;
|
|
|
|
|
get secrets(): TaskSecrets_2 | undefined;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
get spec(): TaskSpecV1beta3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @public @deprecated (undocumented)
|
|
|
|
|
export type TaskSecrets = TaskSecrets_2;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export type TaskStatus =
|
|
|
|
|
| 'open'
|
|
|
|
@@ -825,7 +837,7 @@ export interface TaskStore {
|
|
|
|
|
export type TaskStoreCreateTaskOptions = {
|
|
|
|
|
spec: TaskSpec;
|
|
|
|
|
createdBy?: string;
|
|
|
|
|
secrets?: TaskSecrets;
|
|
|
|
|
secrets?: TaskSecrets_2;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
@@ -862,14 +874,18 @@ export class TaskWorker {
|
|
|
|
|
start(): void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @public @deprecated (undocumented)
|
|
|
|
|
export type TemplateAction<TInput extends JsonObject> =
|
|
|
|
|
TemplateAction_2<TInput>;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export class TemplateActionRegistry {
|
|
|
|
|
// (undocumented)
|
|
|
|
|
get(actionId: string): TemplateAction<JsonObject>;
|
|
|
|
|
get(actionId: string): TemplateAction_2<JsonObject>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
list(): TemplateAction<JsonObject>[];
|
|
|
|
|
list(): TemplateAction_2<JsonObject>[];
|
|
|
|
|
// (undocumented)
|
|
|
|
|
register<TInput extends JsonObject>(action: TemplateAction<TInput>): void;
|
|
|
|
|
register<TInput extends JsonObject>(action: TemplateAction_2<TInput>): void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|