@backstage/plugin-scaffolder-backend 1.2.0 → 1.3.0-next.2
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 +555 -87
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +50 -3
- package/package.json +14 -12
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ interface TaskContext {
|
|
|
125
125
|
secrets?: TaskSecrets;
|
|
126
126
|
createdBy?: string;
|
|
127
127
|
done: boolean;
|
|
128
|
+
isDryRun?: boolean;
|
|
128
129
|
emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
|
|
129
130
|
complete(result: TaskCompletionState, metadata?: JsonObject): Promise<void>;
|
|
130
131
|
getWorkspaceName(): Promise<string>;
|
|
@@ -147,6 +148,11 @@ interface TaskBroker {
|
|
|
147
148
|
events: SerializedTaskEvent[];
|
|
148
149
|
}>;
|
|
149
150
|
get(taskId: string): Promise<SerializedTask>;
|
|
151
|
+
list?(options?: {
|
|
152
|
+
createdBy?: string;
|
|
153
|
+
}): Promise<{
|
|
154
|
+
tasks: SerializedTask[];
|
|
155
|
+
}>;
|
|
150
156
|
}
|
|
151
157
|
/**
|
|
152
158
|
* TaskStoreEmitOptions
|
|
@@ -204,6 +210,11 @@ interface TaskStore {
|
|
|
204
210
|
taskId: string;
|
|
205
211
|
}[];
|
|
206
212
|
}>;
|
|
213
|
+
list?(options: {
|
|
214
|
+
createdBy?: string;
|
|
215
|
+
}): Promise<{
|
|
216
|
+
tasks: SerializedTask[];
|
|
217
|
+
}>;
|
|
207
218
|
emitLogEvent({ taskId, body }: TaskStoreEmitOptions): Promise<void>;
|
|
208
219
|
listEvents({ taskId, after, }: TaskStoreListEventsOptions): Promise<{
|
|
209
220
|
events: SerializedTaskEvent[];
|
|
@@ -226,11 +237,17 @@ declare type ActionContext<Input extends JsonObject> = {
|
|
|
226
237
|
*/
|
|
227
238
|
createTemporaryDirectory(): Promise<string>;
|
|
228
239
|
templateInfo?: TemplateInfo;
|
|
240
|
+
/**
|
|
241
|
+
* Whether this action invocation is a dry-run or not.
|
|
242
|
+
* This will only ever be true if the actions as marked as supporting dry-runs.
|
|
243
|
+
*/
|
|
244
|
+
isDryRun?: boolean;
|
|
229
245
|
};
|
|
230
246
|
/** @public */
|
|
231
247
|
declare type TemplateAction<Input extends JsonObject> = {
|
|
232
248
|
id: string;
|
|
233
249
|
description?: string;
|
|
250
|
+
supportsDryRun?: boolean;
|
|
234
251
|
schema?: {
|
|
235
252
|
input?: Schema;
|
|
236
253
|
output?: Schema;
|
|
@@ -447,6 +464,23 @@ declare function createPublishFileAction(): TemplateAction<{
|
|
|
447
464
|
path: string;
|
|
448
465
|
}>;
|
|
449
466
|
|
|
467
|
+
/**
|
|
468
|
+
* Creates a new action that initializes a git repository of the content in the workspace
|
|
469
|
+
* and publishes it to a Gerrit instance.
|
|
470
|
+
* @public
|
|
471
|
+
*/
|
|
472
|
+
declare function createPublishGerritAction(options: {
|
|
473
|
+
integrations: ScmIntegrationRegistry;
|
|
474
|
+
config: Config;
|
|
475
|
+
}): TemplateAction<{
|
|
476
|
+
repoUrl: string;
|
|
477
|
+
description: string;
|
|
478
|
+
defaultBranch?: string | undefined;
|
|
479
|
+
gitCommitMessage?: string | undefined;
|
|
480
|
+
gitAuthorName?: string | undefined;
|
|
481
|
+
gitAuthorEmail?: string | undefined;
|
|
482
|
+
}>;
|
|
483
|
+
|
|
450
484
|
/**
|
|
451
485
|
* Creates a new action that initializes a git repository of the content in the workspace
|
|
452
486
|
* and publishes it to GitHub.
|
|
@@ -462,6 +496,7 @@ declare function createPublishGithubAction(options: {
|
|
|
462
496
|
description?: string | undefined;
|
|
463
497
|
access?: string | undefined;
|
|
464
498
|
defaultBranch?: string | undefined;
|
|
499
|
+
protectDefaultBranch?: boolean | undefined;
|
|
465
500
|
deleteBranchOnMerge?: boolean | undefined;
|
|
466
501
|
gitCommitMessage?: string | undefined;
|
|
467
502
|
gitAuthorName?: string | undefined;
|
|
@@ -473,10 +508,17 @@ declare function createPublishGithubAction(options: {
|
|
|
473
508
|
requireCodeOwnerReviews?: boolean | undefined;
|
|
474
509
|
requiredStatusCheckContexts?: string[] | undefined;
|
|
475
510
|
repoVisibility?: "internal" | "private" | "public" | undefined;
|
|
476
|
-
collaborators?: {
|
|
511
|
+
collaborators?: ({
|
|
512
|
+
user: string;
|
|
513
|
+
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
|
514
|
+
} | {
|
|
515
|
+
team: string;
|
|
516
|
+
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
|
517
|
+
} | {
|
|
518
|
+
/** @deprecated This field is deprecated in favor of team */
|
|
477
519
|
username: string;
|
|
478
520
|
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
|
479
|
-
}[] | undefined;
|
|
521
|
+
})[] | undefined;
|
|
480
522
|
token?: string | undefined;
|
|
481
523
|
topics?: string[] | undefined;
|
|
482
524
|
}>;
|
|
@@ -674,6 +716,11 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
674
716
|
private readonly db;
|
|
675
717
|
static create(options: DatabaseTaskStoreOptions): Promise<DatabaseTaskStore>;
|
|
676
718
|
private constructor();
|
|
719
|
+
list(options: {
|
|
720
|
+
createdBy?: string;
|
|
721
|
+
}): Promise<{
|
|
722
|
+
tasks: SerializedTask[];
|
|
723
|
+
}>;
|
|
677
724
|
getTask(taskId: string): Promise<SerializedTask>;
|
|
678
725
|
createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
|
|
679
726
|
claimTask(): Promise<SerializedTask | undefined>;
|
|
@@ -800,4 +847,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
|
|
|
800
847
|
postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
|
|
801
848
|
}
|
|
802
849
|
|
|
803
|
-
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 };
|
|
850
|
+
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 };
|
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.2",
|
|
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.
|
|
38
|
-
"@backstage/catalog-client": "^1.0.
|
|
39
|
-
"@backstage/catalog-model": "^1.0.
|
|
37
|
+
"@backstage/backend-common": "^0.14.0-next.2",
|
|
38
|
+
"@backstage/catalog-client": "^1.0.3-next.0",
|
|
39
|
+
"@backstage/catalog-model": "^1.0.3-next.0",
|
|
40
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.1.0",
|
|
42
|
+
"@backstage/integration": "^1.2.1-next.2",
|
|
43
|
+
"@backstage/plugin-catalog-backend": "^1.2.0-next.2",
|
|
44
|
+
"@backstage/plugin-scaffolder-common": "^1.1.1-next.0",
|
|
45
45
|
"@backstage/types": "^1.0.0",
|
|
46
46
|
"@gitbeaker/core": "^35.6.0",
|
|
47
47
|
"@gitbeaker/node": "^35.1.0",
|
|
@@ -67,15 +67,17 @@
|
|
|
67
67
|
"nunjucks": "^3.2.3",
|
|
68
68
|
"octokit": "^1.7.1",
|
|
69
69
|
"octokit-plugin-create-pull-request": "^3.10.0",
|
|
70
|
+
"p-limit": "^3.1.0",
|
|
70
71
|
"uuid": "^8.2.0",
|
|
71
72
|
"vm2": "^3.9.6",
|
|
72
73
|
"winston": "^3.2.1",
|
|
73
74
|
"yaml": "^1.10.0",
|
|
74
|
-
"zen-observable": "^0.8.15"
|
|
75
|
+
"zen-observable": "^0.8.15",
|
|
76
|
+
"zod": "^3.11.6"
|
|
75
77
|
},
|
|
76
78
|
"devDependencies": {
|
|
77
|
-
"@backstage/backend-test-utils": "^0.1.
|
|
78
|
-
"@backstage/cli": "^0.17.
|
|
79
|
+
"@backstage/backend-test-utils": "^0.1.25-next.2",
|
|
80
|
+
"@backstage/cli": "^0.17.2-next.2",
|
|
79
81
|
"@types/command-exists": "^1.2.0",
|
|
80
82
|
"@types/fs-extra": "^9.0.1",
|
|
81
83
|
"@types/git-url-parse": "^9.0.0",
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
"esbuild": "^0.14.1",
|
|
87
89
|
"jest-when": "^3.1.0",
|
|
88
90
|
"mock-fs": "^5.1.0",
|
|
89
|
-
"msw": "^0.
|
|
91
|
+
"msw": "^0.42.0",
|
|
90
92
|
"supertest": "^6.1.3",
|
|
91
93
|
"yaml": "^1.10.0"
|
|
92
94
|
},
|
|
@@ -97,5 +99,5 @@
|
|
|
97
99
|
"assets"
|
|
98
100
|
],
|
|
99
101
|
"configSchema": "config.d.ts",
|
|
100
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "afc672d59763a835574e6c47819107d22cfd1ad7"
|
|
101
103
|
}
|