@backstage/plugin-scaffolder-backend 0.15.19 → 0.15.22
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 +63 -0
- package/dist/index.cjs.js +98 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +40 -25
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ScmIntegrations, ScmIntegrationRegistry } from '@backstage/integration';
|
|
2
|
+
import { ScmIntegrations, ScmIntegrationRegistry, GithubCredentialsProvider } from '@backstage/integration';
|
|
3
3
|
import { CatalogApi } from '@backstage/catalog-client';
|
|
4
4
|
import { Logger } from 'winston';
|
|
5
5
|
import { Writable } from 'stream';
|
|
@@ -26,12 +26,31 @@ declare function createCatalogRegisterAction(options: {
|
|
|
26
26
|
|
|
27
27
|
declare function createCatalogWriteAction(): TemplateAction<any>;
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* A catalog client tailored for reading out entity data from the catalog.
|
|
31
|
+
*/
|
|
32
|
+
declare class CatalogEntityClient {
|
|
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
|
+
}
|
|
44
|
+
|
|
45
|
+
declare type TemplateFilter = (...args: JsonValue[]) => JsonValue | undefined;
|
|
46
|
+
|
|
29
47
|
declare const createBuiltinActions: (options: {
|
|
30
48
|
reader: UrlReader;
|
|
31
49
|
integrations: ScmIntegrations;
|
|
32
50
|
catalogClient: CatalogApi;
|
|
33
51
|
containerRunner?: ContainerRunner;
|
|
34
52
|
config: Config;
|
|
53
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
35
54
|
}) => TemplateAction<any>[];
|
|
36
55
|
|
|
37
56
|
/**
|
|
@@ -48,6 +67,7 @@ declare function createFetchPlainAction(options: {
|
|
|
48
67
|
declare function createFetchTemplateAction(options: {
|
|
49
68
|
reader: UrlReader;
|
|
50
69
|
integrations: ScmIntegrations;
|
|
70
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
51
71
|
}): TemplateAction<any>;
|
|
52
72
|
|
|
53
73
|
declare function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: {
|
|
@@ -84,6 +104,7 @@ declare function createPublishFileAction(): TemplateAction<any>;
|
|
|
84
104
|
declare function createPublishGithubAction(options: {
|
|
85
105
|
integrations: ScmIntegrationRegistry;
|
|
86
106
|
config: Config;
|
|
107
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
87
108
|
}): TemplateAction<any>;
|
|
88
109
|
|
|
89
110
|
declare type CreatePullRequestResponse = {
|
|
@@ -96,15 +117,17 @@ interface PullRequestCreator {
|
|
|
96
117
|
}
|
|
97
118
|
declare type ClientFactoryInput = {
|
|
98
119
|
integrations: ScmIntegrationRegistry;
|
|
120
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
99
121
|
host: string;
|
|
100
122
|
owner: string;
|
|
101
123
|
repo: string;
|
|
102
124
|
};
|
|
103
125
|
interface CreateGithubPullRequestActionOptions {
|
|
104
126
|
integrations: ScmIntegrationRegistry;
|
|
127
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
105
128
|
clientFactory?: (input: ClientFactoryInput) => Promise<PullRequestCreator>;
|
|
106
129
|
}
|
|
107
|
-
declare const createPublishGithubPullRequestAction: ({ integrations, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<any>;
|
|
130
|
+
declare const createPublishGithubPullRequestAction: ({ integrations, githubCredentialsProvider, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<any>;
|
|
108
131
|
|
|
109
132
|
declare function createPublishGitlabAction(options: {
|
|
110
133
|
integrations: ScmIntegrationRegistry;
|
|
@@ -116,12 +139,14 @@ declare const createPublishGitlabMergeRequestAction: (options: {
|
|
|
116
139
|
}) => TemplateAction<any>;
|
|
117
140
|
|
|
118
141
|
declare function createGithubActionsDispatchAction(options: {
|
|
119
|
-
integrations:
|
|
142
|
+
integrations: ScmIntegrations;
|
|
143
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
120
144
|
}): TemplateAction<any>;
|
|
121
145
|
|
|
122
146
|
declare function createGithubWebhookAction(options: {
|
|
123
147
|
integrations: ScmIntegrationRegistry;
|
|
124
148
|
defaultWebhookSecret?: string;
|
|
149
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
125
150
|
}): TemplateAction<any>;
|
|
126
151
|
|
|
127
152
|
declare type OctokitIntegration = {
|
|
@@ -136,12 +161,12 @@ declare type OctokitIntegration = {
|
|
|
136
161
|
*/
|
|
137
162
|
declare class OctokitProvider {
|
|
138
163
|
private readonly integrations;
|
|
139
|
-
private readonly
|
|
140
|
-
constructor(integrations: ScmIntegrationRegistry);
|
|
164
|
+
private readonly githubCredentialsProvider;
|
|
165
|
+
constructor(integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider);
|
|
141
166
|
/**
|
|
142
167
|
* gets standard Octokit client based on repository URL.
|
|
143
168
|
*
|
|
144
|
-
* @param repoUrl Repository URL
|
|
169
|
+
* @param repoUrl - Repository URL
|
|
145
170
|
*/
|
|
146
171
|
getOctokit(repoUrl: string): Promise<OctokitIntegration>;
|
|
147
172
|
}
|
|
@@ -209,8 +234,10 @@ declare type SerializedTaskEvent = {
|
|
|
209
234
|
*
|
|
210
235
|
* @public
|
|
211
236
|
*/
|
|
212
|
-
declare type TaskSecrets = {
|
|
213
|
-
|
|
237
|
+
declare type TaskSecrets = Record<string, string> & {
|
|
238
|
+
/** @deprecated Use `backstageToken` instead */
|
|
239
|
+
token?: string;
|
|
240
|
+
backstageToken?: string;
|
|
214
241
|
};
|
|
215
242
|
/**
|
|
216
243
|
* DispatchResult
|
|
@@ -316,8 +343,10 @@ declare type ActionContext<Input extends InputBase> = {
|
|
|
316
343
|
logStream: Writable;
|
|
317
344
|
/**
|
|
318
345
|
* User token forwarded from initial request, for use in subsequent api requests
|
|
346
|
+
* @deprecated use `secrets.backstageToken` instead
|
|
319
347
|
*/
|
|
320
348
|
token?: string | undefined;
|
|
349
|
+
secrets?: TaskSecrets;
|
|
321
350
|
workspacePath: string;
|
|
322
351
|
input: Input;
|
|
323
352
|
output(name: string, value: JsonValue): void;
|
|
@@ -432,6 +461,7 @@ declare type CreateWorkerOptions = {
|
|
|
432
461
|
integrations: ScmIntegrations;
|
|
433
462
|
workingDirectory: string;
|
|
434
463
|
logger: Logger;
|
|
464
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
435
465
|
};
|
|
436
466
|
/**
|
|
437
467
|
* TaskWorker
|
|
@@ -461,25 +491,10 @@ interface RouterOptions {
|
|
|
461
491
|
taskWorkers?: number;
|
|
462
492
|
containerRunner?: ContainerRunner;
|
|
463
493
|
taskBroker?: TaskBroker;
|
|
494
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
464
495
|
}
|
|
465
496
|
declare function createRouter(options: RouterOptions): Promise<express.Router>;
|
|
466
497
|
|
|
467
|
-
/**
|
|
468
|
-
* A catalog client tailored for reading out entity data from the catalog.
|
|
469
|
-
*/
|
|
470
|
-
declare class CatalogEntityClient {
|
|
471
|
-
private readonly catalogClient;
|
|
472
|
-
constructor(catalogClient: CatalogApi);
|
|
473
|
-
/**
|
|
474
|
-
* Looks up a single template using a template name.
|
|
475
|
-
*
|
|
476
|
-
* Throws a NotFoundError or ConflictError if 0 or multiple templates are found.
|
|
477
|
-
*/
|
|
478
|
-
findTemplate(templateName: string, options?: {
|
|
479
|
-
token?: string;
|
|
480
|
-
}): Promise<TemplateEntityV1beta2>;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
498
|
/** @public */
|
|
484
499
|
declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
485
500
|
private readonly validators;
|
|
@@ -487,4 +502,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
487
502
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
488
503
|
}
|
|
489
504
|
|
|
490
|
-
export { ActionContext, CatalogEntityClient, CompletedTaskState, CreateWorkerOptions, DatabaseTaskStore, DispatchResult, OctokitProvider, RouterOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, Status, TaskBroker, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskState, TaskStore, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishFileAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, fetchContents, runCommand };
|
|
505
|
+
export { ActionContext, CatalogEntityClient, 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.15.
|
|
4
|
+
"version": "0.15.22",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"build:assets": "node scripts/build-nunjucks.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@backstage/backend-common": "^0.10.
|
|
35
|
-
"@backstage/catalog-client": "^0.5.
|
|
36
|
-
"@backstage/catalog-model": "^0.9.
|
|
37
|
-
"@backstage/config": "^0.1.
|
|
38
|
-
"@backstage/errors": "^0.
|
|
39
|
-
"@backstage/integration": "^0.7.
|
|
40
|
-
"@backstage/plugin-catalog-backend": "^0.
|
|
41
|
-
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.
|
|
42
|
-
"@backstage/plugin-scaffolder-common": "^0.1.
|
|
34
|
+
"@backstage/backend-common": "^0.10.5",
|
|
35
|
+
"@backstage/catalog-client": "^0.5.5",
|
|
36
|
+
"@backstage/catalog-model": "^0.9.10",
|
|
37
|
+
"@backstage/config": "^0.1.13",
|
|
38
|
+
"@backstage/errors": "^0.2.0",
|
|
39
|
+
"@backstage/integration": "^0.7.2",
|
|
40
|
+
"@backstage/plugin-catalog-backend": "^0.21.1",
|
|
41
|
+
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.9",
|
|
42
|
+
"@backstage/plugin-scaffolder-common": "^0.1.3",
|
|
43
43
|
"@backstage/types": "^0.1.1",
|
|
44
44
|
"@gitbeaker/core": "^34.6.0",
|
|
45
|
-
"@gitbeaker/node": "^
|
|
45
|
+
"@gitbeaker/node": "^35.1.0",
|
|
46
46
|
"@octokit/rest": "^18.5.3",
|
|
47
47
|
"@octokit/webhooks": "^9.14.1",
|
|
48
48
|
"@types/express": "^4.17.6",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"yaml": "^1.10.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
77
|
-
"@backstage/test-utils": "^0.2.
|
|
76
|
+
"@backstage/cli": "^0.13.0",
|
|
77
|
+
"@backstage/test-utils": "^0.2.3",
|
|
78
78
|
"@types/command-exists": "^1.2.0",
|
|
79
79
|
"@types/fs-extra": "^9.0.1",
|
|
80
80
|
"@types/git-url-parse": "^9.0.0",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"assets"
|
|
96
96
|
],
|
|
97
97
|
"configSchema": "config.d.ts",
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "493394603a2c47ea1d141159af9bc7bb84fac9e5"
|
|
99
99
|
}
|