@backstage/plugin-scaffolder-backend 0.15.18 → 0.15.21
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 +66 -0
- package/dist/index.cjs.js +58 -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';
|
|
@@ -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,15 +97,17 @@ 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;
|
|
@@ -114,12 +119,14 @@ declare const createPublishGitlabMergeRequestAction: (options: {
|
|
|
114
119
|
}) => TemplateAction<any>;
|
|
115
120
|
|
|
116
121
|
declare function createGithubActionsDispatchAction(options: {
|
|
117
|
-
integrations:
|
|
122
|
+
integrations: ScmIntegrations;
|
|
123
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
118
124
|
}): TemplateAction<any>;
|
|
119
125
|
|
|
120
126
|
declare function createGithubWebhookAction(options: {
|
|
121
127
|
integrations: ScmIntegrationRegistry;
|
|
122
128
|
defaultWebhookSecret?: string;
|
|
129
|
+
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
123
130
|
}): TemplateAction<any>;
|
|
124
131
|
|
|
125
132
|
declare type OctokitIntegration = {
|
|
@@ -134,12 +141,12 @@ declare type OctokitIntegration = {
|
|
|
134
141
|
*/
|
|
135
142
|
declare class OctokitProvider {
|
|
136
143
|
private readonly integrations;
|
|
137
|
-
private readonly
|
|
138
|
-
constructor(integrations: ScmIntegrationRegistry);
|
|
144
|
+
private readonly githubCredentialsProvider;
|
|
145
|
+
constructor(integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider);
|
|
139
146
|
/**
|
|
140
147
|
* gets standard Octokit client based on repository URL.
|
|
141
148
|
*
|
|
142
|
-
* @param repoUrl Repository URL
|
|
149
|
+
* @param repoUrl - Repository URL
|
|
143
150
|
*/
|
|
144
151
|
getOctokit(repoUrl: string): Promise<OctokitIntegration>;
|
|
145
152
|
}
|
|
@@ -202,70 +209,15 @@ declare type SerializedTaskEvent = {
|
|
|
202
209
|
type: TaskEventType;
|
|
203
210
|
createdAt: string;
|
|
204
211
|
};
|
|
205
|
-
/**
|
|
206
|
-
* TemplateMetadata
|
|
207
|
-
*
|
|
208
|
-
* @public
|
|
209
|
-
*/
|
|
210
|
-
declare type TemplateMetadata = {
|
|
211
|
-
name: string;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* TaskSpecV1beta2
|
|
215
|
-
*
|
|
216
|
-
* @public
|
|
217
|
-
*/
|
|
218
|
-
interface TaskSpecV1beta2 {
|
|
219
|
-
apiVersion: 'backstage.io/v1beta2';
|
|
220
|
-
baseUrl?: string;
|
|
221
|
-
values: JsonObject;
|
|
222
|
-
steps: Array<{
|
|
223
|
-
id: string;
|
|
224
|
-
name: string;
|
|
225
|
-
action: string;
|
|
226
|
-
input?: JsonObject;
|
|
227
|
-
if?: string | boolean;
|
|
228
|
-
}>;
|
|
229
|
-
output: {
|
|
230
|
-
[name: string]: string;
|
|
231
|
-
};
|
|
232
|
-
metadata?: TemplateMetadata;
|
|
233
|
-
}
|
|
234
|
-
interface TaskStep {
|
|
235
|
-
id: string;
|
|
236
|
-
name: string;
|
|
237
|
-
action: string;
|
|
238
|
-
input?: JsonObject;
|
|
239
|
-
if?: string | boolean;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* TaskSpecV1beta3
|
|
243
|
-
*
|
|
244
|
-
* @public
|
|
245
|
-
*/
|
|
246
|
-
interface TaskSpecV1beta3 {
|
|
247
|
-
apiVersion: 'scaffolder.backstage.io/v1beta3';
|
|
248
|
-
baseUrl?: string;
|
|
249
|
-
parameters: JsonObject;
|
|
250
|
-
steps: TaskStep[];
|
|
251
|
-
output: {
|
|
252
|
-
[name: string]: JsonValue;
|
|
253
|
-
};
|
|
254
|
-
metadata?: TemplateMetadata;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* TaskSpec
|
|
258
|
-
*
|
|
259
|
-
* @public
|
|
260
|
-
*/
|
|
261
|
-
declare type TaskSpec = TaskSpecV1beta2 | TaskSpecV1beta3;
|
|
262
212
|
/**
|
|
263
213
|
* TaskSecrets
|
|
264
214
|
*
|
|
265
215
|
* @public
|
|
266
216
|
*/
|
|
267
|
-
declare type TaskSecrets = {
|
|
268
|
-
|
|
217
|
+
declare type TaskSecrets = Record<string, string> & {
|
|
218
|
+
/** @deprecated Use `backstageToken` instead */
|
|
219
|
+
token?: string;
|
|
220
|
+
backstageToken?: string;
|
|
269
221
|
};
|
|
270
222
|
/**
|
|
271
223
|
* DispatchResult
|
|
@@ -371,8 +323,10 @@ declare type ActionContext<Input extends InputBase> = {
|
|
|
371
323
|
logStream: Writable;
|
|
372
324
|
/**
|
|
373
325
|
* User token forwarded from initial request, for use in subsequent api requests
|
|
326
|
+
* @deprecated use `secrets.backstageToken` instead
|
|
374
327
|
*/
|
|
375
328
|
token?: string | undefined;
|
|
329
|
+
secrets?: TaskSecrets;
|
|
376
330
|
workspacePath: string;
|
|
377
331
|
input: Input;
|
|
378
332
|
output(name: string, value: JsonValue): void;
|
|
@@ -542,4 +496,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
542
496
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
543
497
|
}
|
|
544
498
|
|
|
545
|
-
export { ActionContext, CatalogEntityClient, CompletedTaskState, CreateWorkerOptions, DatabaseTaskStore, DispatchResult, OctokitProvider, RouterOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, Status, TaskBroker, TaskContext, TaskEventType, TaskManager, TaskSecrets,
|
|
499
|
+
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.21",
|
|
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.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.
|
|
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.4",
|
|
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.0",
|
|
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
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.2.
|
|
76
|
+
"@backstage/cli": "^0.12.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": "600d6e3c854bbfb12a0078ca6f726d1c0d1fea0b"
|
|
99
99
|
}
|