@backstage/plugin-scaffolder-backend 0.15.16 → 0.15.20
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 +53 -0
- package/dist/index.cjs.js +174 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +20 -66
- package/package.json +13 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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';
|
|
6
6
|
import * as _backstage_types from '@backstage/types';
|
|
7
7
|
import { JsonValue, JsonObject } from '@backstage/types';
|
|
8
8
|
import { Schema } from 'jsonschema';
|
|
9
|
+
import { TaskSpec, TemplateMetadata } from '@backstage/plugin-scaffolder-common';
|
|
10
|
+
export { TaskSpec, TaskSpecV1beta2, TaskSpecV1beta3, TemplateMetadata } from '@backstage/plugin-scaffolder-common';
|
|
9
11
|
import { UrlReader, ContainerRunner, PluginDatabaseManager } from '@backstage/backend-common';
|
|
10
12
|
import { Config } from '@backstage/config';
|
|
11
13
|
import { createPullRequest } from 'octokit-plugin-create-pull-request';
|
|
@@ -28,7 +30,7 @@ declare const createBuiltinActions: (options: {
|
|
|
28
30
|
reader: UrlReader;
|
|
29
31
|
integrations: ScmIntegrations;
|
|
30
32
|
catalogClient: CatalogApi;
|
|
31
|
-
containerRunner
|
|
33
|
+
containerRunner?: ContainerRunner;
|
|
32
34
|
config: Config;
|
|
33
35
|
}) => TemplateAction<any>[];
|
|
34
36
|
|
|
@@ -82,6 +84,7 @@ declare function createPublishFileAction(): TemplateAction<any>;
|
|
|
82
84
|
declare function createPublishGithubAction(options: {
|
|
83
85
|
integrations: ScmIntegrationRegistry;
|
|
84
86
|
config: Config;
|
|
87
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
85
88
|
}): TemplateAction<any>;
|
|
86
89
|
|
|
87
90
|
declare type CreatePullRequestResponse = {
|
|
@@ -94,28 +97,36 @@ interface PullRequestCreator {
|
|
|
94
97
|
}
|
|
95
98
|
declare type ClientFactoryInput = {
|
|
96
99
|
integrations: ScmIntegrationRegistry;
|
|
100
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
97
101
|
host: string;
|
|
98
102
|
owner: string;
|
|
99
103
|
repo: string;
|
|
100
104
|
};
|
|
101
105
|
interface CreateGithubPullRequestActionOptions {
|
|
102
106
|
integrations: ScmIntegrationRegistry;
|
|
107
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
103
108
|
clientFactory?: (input: ClientFactoryInput) => Promise<PullRequestCreator>;
|
|
104
109
|
}
|
|
105
|
-
declare const createPublishGithubPullRequestAction: ({ integrations, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<any>;
|
|
110
|
+
declare const createPublishGithubPullRequestAction: ({ integrations, githubCredentialsProvider, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction<any>;
|
|
106
111
|
|
|
107
112
|
declare function createPublishGitlabAction(options: {
|
|
108
113
|
integrations: ScmIntegrationRegistry;
|
|
109
114
|
config: Config;
|
|
110
115
|
}): TemplateAction<any>;
|
|
111
116
|
|
|
112
|
-
declare
|
|
117
|
+
declare const createPublishGitlabMergeRequestAction: (options: {
|
|
113
118
|
integrations: ScmIntegrationRegistry;
|
|
119
|
+
}) => TemplateAction<any>;
|
|
120
|
+
|
|
121
|
+
declare function createGithubActionsDispatchAction(options: {
|
|
122
|
+
integrations: ScmIntegrations;
|
|
123
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
114
124
|
}): TemplateAction<any>;
|
|
115
125
|
|
|
116
126
|
declare function createGithubWebhookAction(options: {
|
|
117
127
|
integrations: ScmIntegrationRegistry;
|
|
118
128
|
defaultWebhookSecret?: string;
|
|
129
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
119
130
|
}): TemplateAction<any>;
|
|
120
131
|
|
|
121
132
|
declare type OctokitIntegration = {
|
|
@@ -130,12 +141,12 @@ declare type OctokitIntegration = {
|
|
|
130
141
|
*/
|
|
131
142
|
declare class OctokitProvider {
|
|
132
143
|
private readonly integrations;
|
|
133
|
-
private readonly
|
|
134
|
-
constructor(integrations: ScmIntegrationRegistry);
|
|
144
|
+
private readonly githubCredentialsProvider;
|
|
145
|
+
constructor(integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider);
|
|
135
146
|
/**
|
|
136
147
|
* gets standard Octokit client based on repository URL.
|
|
137
148
|
*
|
|
138
|
-
* @param repoUrl Repository URL
|
|
149
|
+
* @param repoUrl - Repository URL
|
|
139
150
|
*/
|
|
140
151
|
getOctokit(repoUrl: string): Promise<OctokitIntegration>;
|
|
141
152
|
}
|
|
@@ -198,63 +209,6 @@ declare type SerializedTaskEvent = {
|
|
|
198
209
|
type: TaskEventType;
|
|
199
210
|
createdAt: string;
|
|
200
211
|
};
|
|
201
|
-
/**
|
|
202
|
-
* TemplateMetadata
|
|
203
|
-
*
|
|
204
|
-
* @public
|
|
205
|
-
*/
|
|
206
|
-
declare type TemplateMetadata = {
|
|
207
|
-
name: string;
|
|
208
|
-
};
|
|
209
|
-
/**
|
|
210
|
-
* TaskSpecV1beta2
|
|
211
|
-
*
|
|
212
|
-
* @public
|
|
213
|
-
*/
|
|
214
|
-
interface TaskSpecV1beta2 {
|
|
215
|
-
apiVersion: 'backstage.io/v1beta2';
|
|
216
|
-
baseUrl?: string;
|
|
217
|
-
values: JsonObject;
|
|
218
|
-
steps: Array<{
|
|
219
|
-
id: string;
|
|
220
|
-
name: string;
|
|
221
|
-
action: string;
|
|
222
|
-
input?: JsonObject;
|
|
223
|
-
if?: string | boolean;
|
|
224
|
-
}>;
|
|
225
|
-
output: {
|
|
226
|
-
[name: string]: string;
|
|
227
|
-
};
|
|
228
|
-
metadata?: TemplateMetadata;
|
|
229
|
-
}
|
|
230
|
-
interface TaskStep {
|
|
231
|
-
id: string;
|
|
232
|
-
name: string;
|
|
233
|
-
action: string;
|
|
234
|
-
input?: JsonObject;
|
|
235
|
-
if?: string | boolean;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* TaskSpecV1beta3
|
|
239
|
-
*
|
|
240
|
-
* @public
|
|
241
|
-
*/
|
|
242
|
-
interface TaskSpecV1beta3 {
|
|
243
|
-
apiVersion: 'scaffolder.backstage.io/v1beta3';
|
|
244
|
-
baseUrl?: string;
|
|
245
|
-
parameters: JsonObject;
|
|
246
|
-
steps: TaskStep[];
|
|
247
|
-
output: {
|
|
248
|
-
[name: string]: JsonValue;
|
|
249
|
-
};
|
|
250
|
-
metadata?: TemplateMetadata;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* TaskSpec
|
|
254
|
-
*
|
|
255
|
-
* @public
|
|
256
|
-
*/
|
|
257
|
-
declare type TaskSpec = TaskSpecV1beta2 | TaskSpecV1beta3;
|
|
258
212
|
/**
|
|
259
213
|
* TaskSecrets
|
|
260
214
|
*
|
|
@@ -510,7 +464,7 @@ interface RouterOptions {
|
|
|
510
464
|
catalogClient: CatalogApi;
|
|
511
465
|
actions?: TemplateAction<any>[];
|
|
512
466
|
taskWorkers?: number;
|
|
513
|
-
containerRunner
|
|
467
|
+
containerRunner?: ContainerRunner;
|
|
514
468
|
taskBroker?: TaskBroker;
|
|
515
469
|
}
|
|
516
470
|
declare function createRouter(options: RouterOptions): Promise<express.Router>;
|
|
@@ -538,4 +492,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
538
492
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
539
493
|
}
|
|
540
494
|
|
|
541
|
-
export { ActionContext, CatalogEntityClient, CompletedTaskState, CreateWorkerOptions, DatabaseTaskStore, DispatchResult, OctokitProvider, RouterOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, Status, TaskBroker, TaskContext, TaskEventType, TaskManager, TaskSecrets,
|
|
495
|
+
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 };
|
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.20",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"build:assets": "node scripts/build-nunjucks.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@backstage/backend-common": "^0.
|
|
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.
|
|
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.3",
|
|
35
|
+
"@backstage/catalog-client": "^0.5.4",
|
|
36
|
+
"@backstage/catalog-model": "^0.9.9",
|
|
37
|
+
"@backstage/config": "^0.1.12",
|
|
38
|
+
"@backstage/errors": "^0.2.0",
|
|
39
|
+
"@backstage/integration": "^0.7.1",
|
|
40
|
+
"@backstage/plugin-catalog-backend": "^0.20.0",
|
|
41
|
+
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.8",
|
|
42
|
+
"@backstage/plugin-scaffolder-common": "^0.1.2",
|
|
43
43
|
"@backstage/types": "^0.1.1",
|
|
44
44
|
"@gitbeaker/core": "^34.6.0",
|
|
45
45
|
"@gitbeaker/node": "^34.6.0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"yaml": "^1.10.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
77
|
-
"@backstage/test-utils": "^0.
|
|
76
|
+
"@backstage/cli": "^0.11.0",
|
|
77
|
+
"@backstage/test-utils": "^0.2.2",
|
|
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": "da66c61bdd63cdb3f0f0cd2e26dc9e6454d93c7b"
|
|
99
99
|
}
|