@backstage/plugin-scaffolder-backend 1.2.0-next.0 → 1.3.0-next.0
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 +69 -0
- package/dist/index.cjs.js +182 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +27 -1
- package/migrations/20220129100000_created_by.js +38 -0
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ declare type SerializedTask = {
|
|
|
67
67
|
status: TaskStatus;
|
|
68
68
|
createdAt: string;
|
|
69
69
|
lastHeartbeatAt?: string;
|
|
70
|
+
createdBy?: string;
|
|
70
71
|
secrets?: TaskSecrets;
|
|
71
72
|
};
|
|
72
73
|
/**
|
|
@@ -112,6 +113,7 @@ declare type TaskBrokerDispatchResult = {
|
|
|
112
113
|
declare type TaskBrokerDispatchOptions = {
|
|
113
114
|
spec: TaskSpec;
|
|
114
115
|
secrets?: TaskSecrets;
|
|
116
|
+
createdBy?: string;
|
|
115
117
|
};
|
|
116
118
|
/**
|
|
117
119
|
* Task
|
|
@@ -121,6 +123,7 @@ declare type TaskBrokerDispatchOptions = {
|
|
|
121
123
|
interface TaskContext {
|
|
122
124
|
spec: TaskSpec;
|
|
123
125
|
secrets?: TaskSecrets;
|
|
126
|
+
createdBy?: string;
|
|
124
127
|
done: boolean;
|
|
125
128
|
emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
|
|
126
129
|
complete(result: TaskCompletionState, metadata?: JsonObject): Promise<void>;
|
|
@@ -169,6 +172,7 @@ declare type TaskStoreListEventsOptions = {
|
|
|
169
172
|
*/
|
|
170
173
|
declare type TaskStoreCreateTaskOptions = {
|
|
171
174
|
spec: TaskSpec;
|
|
175
|
+
createdBy?: string;
|
|
172
176
|
secrets?: TaskSecrets;
|
|
173
177
|
};
|
|
174
178
|
/**
|
|
@@ -443,6 +447,23 @@ declare function createPublishFileAction(): TemplateAction<{
|
|
|
443
447
|
path: string;
|
|
444
448
|
}>;
|
|
445
449
|
|
|
450
|
+
/**
|
|
451
|
+
* Creates a new action that initializes a git repository of the content in the workspace
|
|
452
|
+
* and publishes it to a Gerrit instance.
|
|
453
|
+
* @public
|
|
454
|
+
*/
|
|
455
|
+
declare function createPublishGerritAction(options: {
|
|
456
|
+
integrations: ScmIntegrationRegistry;
|
|
457
|
+
config: Config;
|
|
458
|
+
}): TemplateAction<{
|
|
459
|
+
repoUrl: string;
|
|
460
|
+
description: string;
|
|
461
|
+
defaultBranch?: string | undefined;
|
|
462
|
+
gitCommitMessage?: string | undefined;
|
|
463
|
+
gitAuthorName?: string | undefined;
|
|
464
|
+
gitAuthorEmail?: string | undefined;
|
|
465
|
+
}>;
|
|
466
|
+
|
|
446
467
|
/**
|
|
447
468
|
* Creates a new action that initializes a git repository of the content in the workspace
|
|
448
469
|
* and publishes it to GitHub.
|
|
@@ -709,6 +730,7 @@ declare class TaskManager implements TaskContext {
|
|
|
709
730
|
private constructor();
|
|
710
731
|
get spec(): _backstage_plugin_scaffolder_common.TaskSpecV1beta3;
|
|
711
732
|
get secrets(): TaskSecrets | undefined;
|
|
733
|
+
get createdBy(): string | undefined;
|
|
712
734
|
getWorkspaceName(): Promise<string>;
|
|
713
735
|
get done(): boolean;
|
|
714
736
|
emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
|
|
@@ -733,6 +755,10 @@ interface CurrentClaimedTask {
|
|
|
733
755
|
* The secrets that are stored with the task.
|
|
734
756
|
*/
|
|
735
757
|
secrets?: TaskSecrets;
|
|
758
|
+
/**
|
|
759
|
+
* The creator of the task.
|
|
760
|
+
*/
|
|
761
|
+
createdBy?: string;
|
|
736
762
|
}
|
|
737
763
|
|
|
738
764
|
/**
|
|
@@ -791,4 +817,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
791
817
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
792
818
|
}
|
|
793
819
|
|
|
794
|
-
export { ActionContext, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateGithubPullRequestClientFactoryInput, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, OctokitWithPullRequestPluginClient, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubIssuesLabelAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishBitbucketCloudAction, createPublishBitbucketServerAction, createPublishFileAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, executeShellCommand, fetchContents };
|
|
820
|
+
export { ActionContext, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateGithubPullRequestClientFactoryInput, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, OctokitWithPullRequestPluginClient, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubIssuesLabelAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishBitbucketCloudAction, createPublishBitbucketServerAction, createPublishFileAction, createPublishGerritAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, executeShellCommand, fetchContents };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 The Backstage Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// @ts-check
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {import('knex').Knex} knex
|
|
21
|
+
*/
|
|
22
|
+
exports.up = async function up(knex) {
|
|
23
|
+
await knex.schema.alterTable('tasks', table => {
|
|
24
|
+
table
|
|
25
|
+
.text('created_by')
|
|
26
|
+
.nullable()
|
|
27
|
+
.comment('An entityRef of the user who created the task');
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {import('knex').Knex} knex
|
|
33
|
+
*/
|
|
34
|
+
exports.down = async function down(knex) {
|
|
35
|
+
await knex.schema.alterTable('tasks', table => {
|
|
36
|
+
table.dropColumn('created_by');
|
|
37
|
+
});
|
|
38
|
+
};
|
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": "1.
|
|
4
|
+
"version": "1.3.0-next.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"build:assets": "node scripts/build-nunjucks.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@backstage/backend-common": "^0.13.
|
|
38
|
-
"@backstage/catalog-client": "^1.0.
|
|
39
|
-
"@backstage/catalog-model": "^1.0.
|
|
40
|
-
"@backstage/config": "^1.0.
|
|
37
|
+
"@backstage/backend-common": "^0.13.6-next.0",
|
|
38
|
+
"@backstage/catalog-client": "^1.0.2",
|
|
39
|
+
"@backstage/catalog-model": "^1.0.2",
|
|
40
|
+
"@backstage/config": "^1.0.1",
|
|
41
41
|
"@backstage/errors": "^1.0.0",
|
|
42
|
-
"@backstage/integration": "^1.2.
|
|
43
|
-
"@backstage/plugin-catalog-backend": "^1.
|
|
44
|
-
"@backstage/plugin-scaffolder-common": "^1.0
|
|
42
|
+
"@backstage/integration": "^1.2.1-next.0",
|
|
43
|
+
"@backstage/plugin-catalog-backend": "^1.2.0-next.0",
|
|
44
|
+
"@backstage/plugin-scaffolder-common": "^1.1.0",
|
|
45
45
|
"@backstage/types": "^1.0.0",
|
|
46
46
|
"@gitbeaker/core": "^35.6.0",
|
|
47
47
|
"@gitbeaker/node": "^35.1.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"zen-observable": "^0.8.15"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@backstage/backend-test-utils": "^0.1.
|
|
78
|
-
"@backstage/cli": "^0.17.
|
|
77
|
+
"@backstage/backend-test-utils": "^0.1.25-next.0",
|
|
78
|
+
"@backstage/cli": "^0.17.2-next.0",
|
|
79
79
|
"@types/command-exists": "^1.2.0",
|
|
80
80
|
"@types/fs-extra": "^9.0.1",
|
|
81
81
|
"@types/git-url-parse": "^9.0.0",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"assets"
|
|
98
98
|
],
|
|
99
99
|
"configSchema": "config.d.ts",
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "c1511c99a532aeb003a97510a5638bd939ee65ca"
|
|
101
101
|
}
|