@backstage/plugin-scaffolder-backend 0.15.23 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/config.d.ts +0 -25
- package/dist/index.cjs.js +54 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +255 -186
- package/package.json +27 -25
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { ScmIntegrations, ScmIntegrationRegistry, GithubCredentialsProvider } fr
|
|
|
3
3
|
import { CatalogApi } from '@backstage/catalog-client';
|
|
4
4
|
import { Logger } from 'winston';
|
|
5
5
|
import { Writable } from 'stream';
|
|
6
|
-
import * as _backstage_types from '@backstage/types';
|
|
7
6
|
import { JsonValue, JsonObject } from '@backstage/types';
|
|
8
7
|
import { Schema } from 'jsonschema';
|
|
9
8
|
import { TaskSpec, TemplateMetadata } from '@backstage/plugin-scaffolder-common';
|
|
10
9
|
export { TaskSpec, TaskSpecV1beta2, TaskSpecV1beta3, TemplateMetadata } from '@backstage/plugin-scaffolder-common';
|
|
10
|
+
import { Entity, LocationSpec } from '@backstage/catalog-model';
|
|
11
11
|
import { UrlReader, ContainerRunner, PluginDatabaseManager } from '@backstage/backend-common';
|
|
12
12
|
import { Config } from '@backstage/config';
|
|
13
13
|
import { createPullRequest } from 'octokit-plugin-create-pull-request';
|
|
@@ -16,179 +16,27 @@ export { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-back
|
|
|
16
16
|
import { SpawnOptionsWithoutStdio } from 'child_process';
|
|
17
17
|
import { Knex } from 'knex';
|
|
18
18
|
import express from 'express';
|
|
19
|
-
import { TemplateEntityV1beta2, Entity, LocationSpec } from '@backstage/catalog-model';
|
|
20
19
|
import { CatalogProcessor, CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
|
|
21
20
|
|
|
22
21
|
declare function createCatalogRegisterAction(options: {
|
|
23
22
|
catalogClient: CatalogApi;
|
|
24
23
|
integrations: ScmIntegrations;
|
|
25
|
-
}): TemplateAction<
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
}): TemplateAction<{
|
|
25
|
+
catalogInfoUrl: string;
|
|
26
|
+
optional?: boolean | undefined;
|
|
27
|
+
} | {
|
|
28
|
+
repoContentsUrl: string;
|
|
29
|
+
catalogInfoPath?: string | undefined;
|
|
30
|
+
optional?: boolean | undefined;
|
|
31
|
+
}>;
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
private readonly catalogClient;
|
|
34
|
-
constructor(catalogClient: CatalogApi);
|
|
35
|
-
/**
|
|
36
|
-
* Looks up a single template using a template name.
|
|
37
|
-
*
|
|
38
|
-
* Throws a NotFoundError or ConflictError if 0 or multiple templates are found.
|
|
39
|
-
*/
|
|
40
|
-
findTemplate(templateName: string, options?: {
|
|
41
|
-
token?: string;
|
|
42
|
-
}): Promise<TemplateEntityV1beta2>;
|
|
43
|
-
}
|
|
33
|
+
declare function createCatalogWriteAction(): TemplateAction<{
|
|
34
|
+
filePath?: string | undefined;
|
|
35
|
+
entity: Entity;
|
|
36
|
+
}>;
|
|
44
37
|
|
|
45
38
|
declare type TemplateFilter = (...args: JsonValue[]) => JsonValue | undefined;
|
|
46
39
|
|
|
47
|
-
declare const createBuiltinActions: (options: {
|
|
48
|
-
reader: UrlReader;
|
|
49
|
-
integrations: ScmIntegrations;
|
|
50
|
-
catalogClient: CatalogApi;
|
|
51
|
-
containerRunner?: ContainerRunner;
|
|
52
|
-
config: Config;
|
|
53
|
-
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
54
|
-
}) => TemplateAction<any>[];
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* This task is useful for local development and testing of both the scaffolder
|
|
58
|
-
* and scaffolder templates.
|
|
59
|
-
*/
|
|
60
|
-
declare function createDebugLogAction(): TemplateAction<any>;
|
|
61
|
-
|
|
62
|
-
declare function createFetchPlainAction(options: {
|
|
63
|
-
reader: UrlReader;
|
|
64
|
-
integrations: ScmIntegrations;
|
|
65
|
-
}): TemplateAction<any>;
|
|
66
|
-
|
|
67
|
-
declare function createFetchTemplateAction(options: {
|
|
68
|
-
reader: UrlReader;
|
|
69
|
-
integrations: ScmIntegrations;
|
|
70
|
-
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
71
|
-
}): TemplateAction<any>;
|
|
72
|
-
|
|
73
|
-
declare function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: {
|
|
74
|
-
reader: UrlReader;
|
|
75
|
-
integrations: ScmIntegrations;
|
|
76
|
-
baseUrl?: string;
|
|
77
|
-
fetchUrl?: JsonValue;
|
|
78
|
-
outputPath: string;
|
|
79
|
-
}): Promise<void>;
|
|
80
|
-
|
|
81
|
-
declare const createFilesystemDeleteAction: () => TemplateAction<any>;
|
|
82
|
-
|
|
83
|
-
declare const createFilesystemRenameAction: () => TemplateAction<any>;
|
|
84
|
-
|
|
85
|
-
declare function createPublishAzureAction(options: {
|
|
86
|
-
integrations: ScmIntegrationRegistry;
|
|
87
|
-
config: Config;
|
|
88
|
-
}): TemplateAction<any>;
|
|
89
|
-
|
|
90
|
-
declare function createPublishBitbucketAction(options: {
|
|
91
|
-
integrations: ScmIntegrationRegistry;
|
|
92
|
-
config: Config;
|
|
93
|
-
}): TemplateAction<any>;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* This task is useful for local development and testing of both the scaffolder
|
|
97
|
-
* and scaffolder templates.
|
|
98
|
-
*
|
|
99
|
-
* This action is not installed by default and should not be installed in
|
|
100
|
-
* production, as it writes the files to the local filesystem of the scaffolder.
|
|
101
|
-
*/
|
|
102
|
-
declare function createPublishFileAction(): TemplateAction<any>;
|
|
103
|
-
|
|
104
|
-
declare function createPublishGithubAction(options: {
|
|
105
|
-
integrations: ScmIntegrationRegistry;
|
|
106
|
-
config: Config;
|
|
107
|
-
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
108
|
-
}): TemplateAction<any>;
|
|
109
|
-
|
|
110
|
-
declare type CreatePullRequestResponse = {
|
|
111
|
-
data: {
|
|
112
|
-
html_url: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
interface PullRequestCreator {
|
|
116
|
-
createPullRequest(options: createPullRequest.Options): Promise<CreatePullRequestResponse | null>;
|
|
117
|
-
}
|
|
118
|
-
declare type ClientFactoryInput = {
|
|
119
|
-
integrations: ScmIntegrationRegistry;
|
|
120
|
-
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
121
|
-
host: string;
|
|
122
|
-
owner: string;
|
|
123
|
-
repo: string;
|
|
124
|
-
token?: string;
|
|
125
|
-
};
|
|
126
|
-
interface CreateGithubPullRequestActionOptions {
|
|
127
|
-
integrations: ScmIntegrationRegistry;
|
|
128
|
-
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
129
|
-
clientFactory?: (input: ClientFactoryInput) => Promise<PullRequestCreator>;
|
|
130
|
-
}
|
|
131
|
-
declare const createPublishGithubPullRequestAction: ({ integrations, githubCredentialsProvider, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<any>;
|
|
132
|
-
|
|
133
|
-
declare function createPublishGitlabAction(options: {
|
|
134
|
-
integrations: ScmIntegrationRegistry;
|
|
135
|
-
config: Config;
|
|
136
|
-
}): TemplateAction<any>;
|
|
137
|
-
|
|
138
|
-
declare const createPublishGitlabMergeRequestAction: (options: {
|
|
139
|
-
integrations: ScmIntegrationRegistry;
|
|
140
|
-
}) => TemplateAction<any>;
|
|
141
|
-
|
|
142
|
-
declare function createGithubActionsDispatchAction(options: {
|
|
143
|
-
integrations: ScmIntegrations;
|
|
144
|
-
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
145
|
-
}): TemplateAction<any>;
|
|
146
|
-
|
|
147
|
-
declare function createGithubWebhookAction(options: {
|
|
148
|
-
integrations: ScmIntegrationRegistry;
|
|
149
|
-
defaultWebhookSecret?: string;
|
|
150
|
-
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
151
|
-
}): TemplateAction<any>;
|
|
152
|
-
|
|
153
|
-
declare type OctokitIntegration = {
|
|
154
|
-
client: Octokit;
|
|
155
|
-
token: string;
|
|
156
|
-
owner: string;
|
|
157
|
-
repo: string;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* OctokitProvider provides Octokit client based on ScmIntegrationsRegistry configuration.
|
|
161
|
-
* OctokitProvider supports GitHub credentials caching out of the box.
|
|
162
|
-
*/
|
|
163
|
-
declare class OctokitProvider {
|
|
164
|
-
private readonly integrations;
|
|
165
|
-
private readonly githubCredentialsProvider;
|
|
166
|
-
constructor(integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider);
|
|
167
|
-
/**
|
|
168
|
-
* gets standard Octokit client based on repository URL.
|
|
169
|
-
*
|
|
170
|
-
* @param repoUrl - Repository URL
|
|
171
|
-
*/
|
|
172
|
-
getOctokit(repoUrl: string, options?: {
|
|
173
|
-
token?: string;
|
|
174
|
-
}): Promise<OctokitIntegration>;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
declare type RunCommandOptions = {
|
|
178
|
-
/** command to run */
|
|
179
|
-
command: string;
|
|
180
|
-
/** arguments to pass the command */
|
|
181
|
-
args: string[];
|
|
182
|
-
/** options to pass to spawn */
|
|
183
|
-
options?: SpawnOptionsWithoutStdio;
|
|
184
|
-
/** stream to capture stdout and stderr output */
|
|
185
|
-
logStream?: Writable;
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Run a command in a sub-process, normally a shell command.
|
|
189
|
-
*/
|
|
190
|
-
declare const runCommand: ({ command, args, logStream, options, }: RunCommandOptions) => Promise<void>;
|
|
191
|
-
|
|
192
40
|
/**
|
|
193
41
|
* Status
|
|
194
42
|
*
|
|
@@ -238,8 +86,6 @@ declare type SerializedTaskEvent = {
|
|
|
238
86
|
* @public
|
|
239
87
|
*/
|
|
240
88
|
declare type TaskSecrets = Record<string, string> & {
|
|
241
|
-
/** @deprecated Use `backstageToken` instead */
|
|
242
|
-
token?: string;
|
|
243
89
|
backstageToken?: string;
|
|
244
90
|
};
|
|
245
91
|
/**
|
|
@@ -332,23 +178,13 @@ interface TaskStore {
|
|
|
332
178
|
}>;
|
|
333
179
|
}
|
|
334
180
|
|
|
335
|
-
declare type
|
|
336
|
-
declare type PartialJsonValue = PartialJsonObject | JsonValue | undefined;
|
|
337
|
-
declare type InputBase = Partial<{
|
|
338
|
-
[name: string]: PartialJsonValue;
|
|
339
|
-
}>;
|
|
340
|
-
declare type ActionContext<Input extends InputBase> = {
|
|
181
|
+
declare type ActionContext<Input extends JsonObject> = {
|
|
341
182
|
/**
|
|
342
183
|
* Base URL for the location of the task spec, typically the url of the source entity file.
|
|
343
184
|
*/
|
|
344
185
|
baseUrl?: string;
|
|
345
186
|
logger: Logger;
|
|
346
187
|
logStream: Writable;
|
|
347
|
-
/**
|
|
348
|
-
* User token forwarded from initial request, for use in subsequent api requests
|
|
349
|
-
* @deprecated use `secrets.backstageToken` instead
|
|
350
|
-
*/
|
|
351
|
-
token?: string | undefined;
|
|
352
188
|
secrets?: TaskSecrets;
|
|
353
189
|
workspacePath: string;
|
|
354
190
|
input: Input;
|
|
@@ -359,7 +195,7 @@ declare type ActionContext<Input extends InputBase> = {
|
|
|
359
195
|
createTemporaryDirectory(): Promise<string>;
|
|
360
196
|
metadata?: TemplateMetadata;
|
|
361
197
|
};
|
|
362
|
-
declare type TemplateAction<Input extends
|
|
198
|
+
declare type TemplateAction<Input extends JsonObject> = {
|
|
363
199
|
id: string;
|
|
364
200
|
description?: string;
|
|
365
201
|
schema?: {
|
|
@@ -369,16 +205,249 @@ declare type TemplateAction<Input extends InputBase> = {
|
|
|
369
205
|
handler: (ctx: ActionContext<Input>) => Promise<void>;
|
|
370
206
|
};
|
|
371
207
|
|
|
208
|
+
declare const createBuiltinActions: (options: {
|
|
209
|
+
reader: UrlReader;
|
|
210
|
+
integrations: ScmIntegrations;
|
|
211
|
+
catalogClient: CatalogApi;
|
|
212
|
+
containerRunner?: ContainerRunner;
|
|
213
|
+
config: Config;
|
|
214
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
215
|
+
}) => TemplateAction<JsonObject>[];
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* This task is useful for local development and testing of both the scaffolder
|
|
219
|
+
* and scaffolder templates.
|
|
220
|
+
*/
|
|
221
|
+
declare function createDebugLogAction(): TemplateAction<{
|
|
222
|
+
message?: string | undefined;
|
|
223
|
+
listWorkspace?: boolean | undefined;
|
|
224
|
+
}>;
|
|
225
|
+
|
|
226
|
+
declare function createFetchPlainAction(options: {
|
|
227
|
+
reader: UrlReader;
|
|
228
|
+
integrations: ScmIntegrations;
|
|
229
|
+
}): TemplateAction<{
|
|
230
|
+
url: string;
|
|
231
|
+
targetPath?: string | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
|
|
234
|
+
declare function createFetchTemplateAction(options: {
|
|
235
|
+
reader: UrlReader;
|
|
236
|
+
integrations: ScmIntegrations;
|
|
237
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
238
|
+
}): TemplateAction<{
|
|
239
|
+
url: string;
|
|
240
|
+
targetPath?: string | undefined;
|
|
241
|
+
values: any;
|
|
242
|
+
templateFileExtension?: string | boolean | undefined;
|
|
243
|
+
copyWithoutRender?: string[] | undefined;
|
|
244
|
+
cookiecutterCompat?: boolean | undefined;
|
|
245
|
+
}>;
|
|
246
|
+
|
|
247
|
+
declare function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: {
|
|
248
|
+
reader: UrlReader;
|
|
249
|
+
integrations: ScmIntegrations;
|
|
250
|
+
baseUrl?: string;
|
|
251
|
+
fetchUrl?: JsonValue;
|
|
252
|
+
outputPath: string;
|
|
253
|
+
}): Promise<void>;
|
|
254
|
+
|
|
255
|
+
declare const createFilesystemDeleteAction: () => TemplateAction<{
|
|
256
|
+
files: string[];
|
|
257
|
+
}>;
|
|
258
|
+
|
|
259
|
+
declare const createFilesystemRenameAction: () => TemplateAction<{
|
|
260
|
+
files: Array<{
|
|
261
|
+
from: string;
|
|
262
|
+
to: string;
|
|
263
|
+
overwrite?: boolean;
|
|
264
|
+
}>;
|
|
265
|
+
}>;
|
|
266
|
+
|
|
267
|
+
declare function createPublishAzureAction(options: {
|
|
268
|
+
integrations: ScmIntegrationRegistry;
|
|
269
|
+
config: Config;
|
|
270
|
+
}): TemplateAction<{
|
|
271
|
+
repoUrl: string;
|
|
272
|
+
description?: string | undefined;
|
|
273
|
+
defaultBranch?: string | undefined;
|
|
274
|
+
sourcePath?: string | undefined;
|
|
275
|
+
token?: string | undefined;
|
|
276
|
+
}>;
|
|
277
|
+
|
|
278
|
+
declare function createPublishBitbucketAction(options: {
|
|
279
|
+
integrations: ScmIntegrationRegistry;
|
|
280
|
+
config: Config;
|
|
281
|
+
}): TemplateAction<{
|
|
282
|
+
repoUrl: string;
|
|
283
|
+
description?: string | undefined;
|
|
284
|
+
defaultBranch?: string | undefined;
|
|
285
|
+
repoVisibility?: "private" | "public" | undefined;
|
|
286
|
+
sourcePath?: string | undefined;
|
|
287
|
+
enableLFS?: boolean | undefined;
|
|
288
|
+
token?: string | undefined;
|
|
289
|
+
}>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* This task is useful for local development and testing of both the scaffolder
|
|
293
|
+
* and scaffolder templates.
|
|
294
|
+
*
|
|
295
|
+
* This action is not installed by default and should not be installed in
|
|
296
|
+
* production, as it writes the files to the local filesystem of the scaffolder.
|
|
297
|
+
*/
|
|
298
|
+
declare function createPublishFileAction(): TemplateAction<{
|
|
299
|
+
path: string;
|
|
300
|
+
}>;
|
|
301
|
+
|
|
302
|
+
declare function createPublishGithubAction(options: {
|
|
303
|
+
integrations: ScmIntegrationRegistry;
|
|
304
|
+
config: Config;
|
|
305
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
306
|
+
}): TemplateAction<{
|
|
307
|
+
repoUrl: string;
|
|
308
|
+
description?: string | undefined;
|
|
309
|
+
access?: string | undefined;
|
|
310
|
+
defaultBranch?: string | undefined;
|
|
311
|
+
sourcePath?: string | undefined;
|
|
312
|
+
requireCodeOwnerReviews?: boolean | undefined;
|
|
313
|
+
repoVisibility?: "internal" | "private" | "public" | undefined;
|
|
314
|
+
collaborators?: {
|
|
315
|
+
username: string;
|
|
316
|
+
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
token?: string | undefined;
|
|
319
|
+
topics?: string[] | undefined;
|
|
320
|
+
}>;
|
|
321
|
+
|
|
322
|
+
declare type CreatePullRequestResponse = {
|
|
323
|
+
data: {
|
|
324
|
+
html_url: string;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
interface PullRequestCreator {
|
|
328
|
+
createPullRequest(options: createPullRequest.Options): Promise<CreatePullRequestResponse | null>;
|
|
329
|
+
}
|
|
330
|
+
declare type ClientFactoryInput = {
|
|
331
|
+
integrations: ScmIntegrationRegistry;
|
|
332
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
333
|
+
host: string;
|
|
334
|
+
owner: string;
|
|
335
|
+
repo: string;
|
|
336
|
+
token?: string;
|
|
337
|
+
};
|
|
338
|
+
interface CreateGithubPullRequestActionOptions {
|
|
339
|
+
integrations: ScmIntegrationRegistry;
|
|
340
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
341
|
+
clientFactory?: (input: ClientFactoryInput) => Promise<PullRequestCreator>;
|
|
342
|
+
}
|
|
343
|
+
declare const createPublishGithubPullRequestAction: ({ integrations, githubCredentialsProvider, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<{
|
|
344
|
+
title: string;
|
|
345
|
+
branchName: string;
|
|
346
|
+
description: string;
|
|
347
|
+
repoUrl: string;
|
|
348
|
+
targetPath?: string | undefined;
|
|
349
|
+
sourcePath?: string | undefined;
|
|
350
|
+
token?: string | undefined;
|
|
351
|
+
}>;
|
|
352
|
+
|
|
353
|
+
declare function createPublishGitlabAction(options: {
|
|
354
|
+
integrations: ScmIntegrationRegistry;
|
|
355
|
+
config: Config;
|
|
356
|
+
}): TemplateAction<{
|
|
357
|
+
repoUrl: string;
|
|
358
|
+
defaultBranch?: string | undefined;
|
|
359
|
+
repoVisibility?: "internal" | "private" | "public" | undefined;
|
|
360
|
+
sourcePath?: string | undefined;
|
|
361
|
+
token?: string | undefined;
|
|
362
|
+
}>;
|
|
363
|
+
|
|
364
|
+
declare const createPublishGitlabMergeRequestAction: (options: {
|
|
365
|
+
integrations: ScmIntegrationRegistry;
|
|
366
|
+
}) => TemplateAction<{
|
|
367
|
+
projectid: string;
|
|
368
|
+
repoUrl: string;
|
|
369
|
+
title: string;
|
|
370
|
+
description: string;
|
|
371
|
+
branchName: string;
|
|
372
|
+
targetPath: string;
|
|
373
|
+
token?: string | undefined;
|
|
374
|
+
}>;
|
|
375
|
+
|
|
376
|
+
declare function createGithubActionsDispatchAction(options: {
|
|
377
|
+
integrations: ScmIntegrations;
|
|
378
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
379
|
+
}): TemplateAction<{
|
|
380
|
+
repoUrl: string;
|
|
381
|
+
workflowId: string;
|
|
382
|
+
branchOrTagName: string;
|
|
383
|
+
workflowInputs?: {
|
|
384
|
+
[key: string]: string;
|
|
385
|
+
} | undefined;
|
|
386
|
+
token?: string | undefined;
|
|
387
|
+
}>;
|
|
388
|
+
|
|
389
|
+
declare function createGithubWebhookAction(options: {
|
|
390
|
+
integrations: ScmIntegrationRegistry;
|
|
391
|
+
defaultWebhookSecret?: string;
|
|
392
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
393
|
+
}): TemplateAction<{
|
|
394
|
+
repoUrl: string;
|
|
395
|
+
webhookUrl: string;
|
|
396
|
+
webhookSecret?: string | undefined;
|
|
397
|
+
events?: string[] | undefined;
|
|
398
|
+
active?: boolean | undefined;
|
|
399
|
+
contentType?: "form" | "json" | undefined;
|
|
400
|
+
insecureSsl?: boolean | undefined;
|
|
401
|
+
token?: string | undefined;
|
|
402
|
+
}>;
|
|
403
|
+
|
|
404
|
+
declare type OctokitIntegration = {
|
|
405
|
+
client: Octokit;
|
|
406
|
+
token: string;
|
|
407
|
+
owner: string;
|
|
408
|
+
repo: string;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* OctokitProvider provides Octokit client based on ScmIntegrationsRegistry configuration.
|
|
412
|
+
* OctokitProvider supports GitHub credentials caching out of the box.
|
|
413
|
+
*/
|
|
414
|
+
declare class OctokitProvider {
|
|
415
|
+
private readonly integrations;
|
|
416
|
+
private readonly githubCredentialsProvider;
|
|
417
|
+
constructor(integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider);
|
|
418
|
+
/**
|
|
419
|
+
* gets standard Octokit client based on repository URL.
|
|
420
|
+
*
|
|
421
|
+
* @param repoUrl - Repository URL
|
|
422
|
+
*/
|
|
423
|
+
getOctokit(repoUrl: string, options?: {
|
|
424
|
+
token?: string;
|
|
425
|
+
}): Promise<OctokitIntegration>;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
declare type RunCommandOptions = {
|
|
429
|
+
/** command to run */
|
|
430
|
+
command: string;
|
|
431
|
+
/** arguments to pass the command */
|
|
432
|
+
args: string[];
|
|
433
|
+
/** options to pass to spawn */
|
|
434
|
+
options?: SpawnOptionsWithoutStdio;
|
|
435
|
+
/** stream to capture stdout and stderr output */
|
|
436
|
+
logStream?: Writable;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Run a command in a sub-process, normally a shell command.
|
|
440
|
+
*/
|
|
441
|
+
declare const runCommand: ({ command, args, logStream, options, }: RunCommandOptions) => Promise<void>;
|
|
442
|
+
|
|
372
443
|
declare class TemplateActionRegistry {
|
|
373
444
|
private readonly actions;
|
|
374
|
-
register<
|
|
375
|
-
get(actionId: string): TemplateAction<
|
|
376
|
-
list(): TemplateAction<
|
|
445
|
+
register<TInput extends JsonObject>(action: TemplateAction<TInput>): void;
|
|
446
|
+
get(actionId: string): TemplateAction<JsonObject>;
|
|
447
|
+
list(): TemplateAction<JsonObject>[];
|
|
377
448
|
}
|
|
378
449
|
|
|
379
|
-
declare const createTemplateAction: <
|
|
380
|
-
[name: string]: _backstage_types.JsonValue | Partial<_backstage_types.JsonObject> | undefined;
|
|
381
|
-
}>>(templateAction: TemplateAction<Input>) => TemplateAction<any>;
|
|
450
|
+
declare const createTemplateAction: <TInput extends JsonObject>(templateAction: TemplateAction<TInput>) => TemplateAction<TInput>;
|
|
382
451
|
|
|
383
452
|
/**
|
|
384
453
|
* DatabaseTaskStore
|
|
@@ -505,4 +574,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
505
574
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
506
575
|
}
|
|
507
576
|
|
|
508
|
-
export { ActionContext,
|
|
577
|
+
export { ActionContext, CompletedTaskState, CreateWorkerOptions, DatabaseTaskStore, DispatchResult, OctokitProvider, RouterOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, Status, TaskBroker, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskState, TaskStore, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishFileAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, fetchContents, runCommand };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend",
|
|
3
3
|
"description": "The Backstage backend plugin that helps you create new things",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"main": "dist/index.cjs.js",
|
|
12
12
|
"types": "dist/index.d.ts"
|
|
13
13
|
},
|
|
14
|
+
"backstage": {
|
|
15
|
+
"role": "backend-plugin"
|
|
16
|
+
},
|
|
14
17
|
"homepage": "https://backstage.io",
|
|
15
18
|
"repository": {
|
|
16
19
|
"type": "git",
|
|
@@ -21,26 +24,26 @@
|
|
|
21
24
|
"backstage"
|
|
22
25
|
],
|
|
23
26
|
"scripts": {
|
|
24
|
-
"start": "backstage-cli
|
|
25
|
-
"build": "backstage-cli
|
|
26
|
-
"lint": "backstage-cli lint",
|
|
27
|
-
"test": "backstage-cli test",
|
|
28
|
-
"prepack": "backstage-cli prepack",
|
|
29
|
-
"postpack": "backstage-cli postpack",
|
|
30
|
-
"clean": "backstage-cli clean",
|
|
27
|
+
"start": "backstage-cli package start",
|
|
28
|
+
"build": "backstage-cli package build",
|
|
29
|
+
"lint": "backstage-cli package lint",
|
|
30
|
+
"test": "backstage-cli package test",
|
|
31
|
+
"prepack": "backstage-cli package prepack",
|
|
32
|
+
"postpack": "backstage-cli package postpack",
|
|
33
|
+
"clean": "backstage-cli package clean",
|
|
31
34
|
"build:assets": "node scripts/build-nunjucks.js"
|
|
32
35
|
},
|
|
33
36
|
"dependencies": {
|
|
34
|
-
"@backstage/backend-common": "^0.10.
|
|
35
|
-
"@backstage/catalog-client": "^0.
|
|
36
|
-
"@backstage/catalog-model": "^0.
|
|
37
|
-
"@backstage/config": "^0.1.
|
|
38
|
-
"@backstage/errors": "^0.2.
|
|
39
|
-
"@backstage/integration": "^0.7.
|
|
40
|
-
"@backstage/plugin-catalog-backend": "^0.21.
|
|
41
|
-
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1
|
|
42
|
-
"@backstage/plugin-scaffolder-common": "^0.1
|
|
43
|
-
"@backstage/types": "^0.1.
|
|
37
|
+
"@backstage/backend-common": "^0.10.9",
|
|
38
|
+
"@backstage/catalog-client": "^0.7.1",
|
|
39
|
+
"@backstage/catalog-model": "^0.10.1",
|
|
40
|
+
"@backstage/config": "^0.1.15",
|
|
41
|
+
"@backstage/errors": "^0.2.2",
|
|
42
|
+
"@backstage/integration": "^0.7.4",
|
|
43
|
+
"@backstage/plugin-catalog-backend": "^0.21.5",
|
|
44
|
+
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.2.1",
|
|
45
|
+
"@backstage/plugin-scaffolder-common": "^0.2.1",
|
|
46
|
+
"@backstage/types": "^0.1.3",
|
|
44
47
|
"@gitbeaker/core": "^34.6.0",
|
|
45
48
|
"@gitbeaker/node": "^35.1.0",
|
|
46
49
|
"@octokit/webhooks": "^9.14.1",
|
|
@@ -55,26 +58,25 @@
|
|
|
55
58
|
"git-url-parse": "^11.6.0",
|
|
56
59
|
"globby": "^11.0.0",
|
|
57
60
|
"handlebars": "^4.7.6",
|
|
58
|
-
"helmet": "^4.0.0",
|
|
59
61
|
"isbinaryfile": "^4.0.8",
|
|
60
62
|
"isomorphic-git": "^1.8.0",
|
|
61
63
|
"jsonschema": "^1.2.6",
|
|
62
|
-
"knex": "^0.
|
|
64
|
+
"knex": "^1.0.2",
|
|
63
65
|
"lodash": "^4.17.21",
|
|
64
66
|
"luxon": "^2.0.2",
|
|
65
67
|
"morgan": "^1.10.0",
|
|
66
|
-
"node-fetch": "^2.6.
|
|
68
|
+
"node-fetch": "^2.6.7",
|
|
67
69
|
"nunjucks": "^3.2.3",
|
|
68
70
|
"octokit": "^1.7.1",
|
|
69
71
|
"octokit-plugin-create-pull-request": "^3.10.0",
|
|
70
72
|
"uuid": "^8.2.0",
|
|
71
|
-
"vm2": "^3.9.
|
|
73
|
+
"vm2": "^3.9.6",
|
|
72
74
|
"winston": "^3.2.1",
|
|
73
75
|
"yaml": "^1.10.0"
|
|
74
76
|
},
|
|
75
77
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
77
|
-
"@backstage/test-utils": "^0.2.
|
|
78
|
+
"@backstage/cli": "^0.14.0",
|
|
79
|
+
"@backstage/test-utils": "^0.2.5",
|
|
78
80
|
"@types/command-exists": "^1.2.0",
|
|
79
81
|
"@types/fs-extra": "^9.0.1",
|
|
80
82
|
"@types/git-url-parse": "^9.0.0",
|
|
@@ -95,5 +97,5 @@
|
|
|
95
97
|
"assets"
|
|
96
98
|
],
|
|
97
99
|
"configSchema": "config.d.ts",
|
|
98
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e244b348c473700e7d5e5fbcef38bd9f9fd1d0ba"
|
|
99
101
|
}
|