@backstage/plugin-scaffolder-backend 1.19.3-next.2 → 1.21.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 +76 -0
- package/alpha/package.json +1 -1
- package/config.d.ts +16 -0
- package/dist/alpha.cjs.js +41 -21
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/cjs/{router-03a1f408.cjs.js → router-842a762b.cjs.js} +203 -71
- package/dist/cjs/router-842a762b.cjs.js.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +25 -2
- package/package.json +19 -19
- package/dist/cjs/router-03a1f408.cjs.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var router = require('./cjs/router-
|
|
5
|
+
var router = require('./cjs/router-842a762b.cjs.js');
|
|
6
6
|
var github = require('@backstage/plugin-scaffolder-backend-module-github');
|
|
7
7
|
var gitlab = require('@backstage/plugin-scaffolder-backend-module-gitlab');
|
|
8
8
|
var azure = require('@backstage/plugin-scaffolder-backend-module-azure');
|
|
@@ -31,11 +31,11 @@ require('isolated-vm');
|
|
|
31
31
|
require('lodash/get');
|
|
32
32
|
require('uuid');
|
|
33
33
|
require('zen-observable');
|
|
34
|
+
require('lodash');
|
|
34
35
|
require('p-queue');
|
|
35
36
|
require('winston');
|
|
36
37
|
require('nunjucks');
|
|
37
38
|
require('stream');
|
|
38
|
-
require('lodash');
|
|
39
39
|
require('@backstage/plugin-permission-node');
|
|
40
40
|
require('prom-client');
|
|
41
41
|
require('@backstage/plugin-permission-common');
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import * as bitbucket from '@backstage/plugin-scaffolder-backend-module-bitbucke
|
|
|
15
15
|
import * as gerrit from '@backstage/plugin-scaffolder-backend-module-gerrit';
|
|
16
16
|
import { Knex } from 'knex';
|
|
17
17
|
import * as _backstage_plugin_scaffolder_common from '@backstage/plugin-scaffolder-common';
|
|
18
|
-
import { TaskSpec, TemplateEntityStepV1beta3, TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
18
|
+
import { TaskSpec, TaskRecovery, TemplateEntityStepV1beta3, TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
19
19
|
import { Logger } from 'winston';
|
|
20
20
|
import { PermissionEvaluator, PermissionRuleParams } from '@backstage/plugin-permission-common';
|
|
21
21
|
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
|
@@ -23,6 +23,7 @@ import { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, RESOURCE_TYPE_SCAFFOLDER_ACTION } fr
|
|
|
23
23
|
import express from 'express';
|
|
24
24
|
import { IdentityApi } from '@backstage/plugin-auth-node';
|
|
25
25
|
import { PermissionRule } from '@backstage/plugin-permission-node';
|
|
26
|
+
import { LifecycleService } from '@backstage/backend-plugin-api';
|
|
26
27
|
import * as jsonschema from 'jsonschema';
|
|
27
28
|
import * as zod from 'zod';
|
|
28
29
|
import { ScaffolderEntitiesProcessor as ScaffolderEntitiesProcessor$1 } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';
|
|
@@ -438,6 +439,13 @@ type TaskStoreCreateTaskOptions = {
|
|
|
438
439
|
createdBy?: string;
|
|
439
440
|
secrets?: TaskSecrets$1;
|
|
440
441
|
};
|
|
442
|
+
/**
|
|
443
|
+
* The options passed to {@link TaskStore.recoverTasks}
|
|
444
|
+
* @public
|
|
445
|
+
*/
|
|
446
|
+
type TaskStoreRecoverTaskOptions = {
|
|
447
|
+
timeout: HumanDuration;
|
|
448
|
+
};
|
|
441
449
|
/**
|
|
442
450
|
* The response from {@link TaskStore.createTask}
|
|
443
451
|
* @public
|
|
@@ -453,6 +461,9 @@ type TaskStoreCreateTaskResult = {
|
|
|
453
461
|
interface TaskStore {
|
|
454
462
|
cancelTask?(options: TaskStoreEmitOptions): Promise<void>;
|
|
455
463
|
createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
|
|
464
|
+
recoverTasks?(options: TaskStoreRecoverTaskOptions): Promise<{
|
|
465
|
+
ids: string[];
|
|
466
|
+
}>;
|
|
456
467
|
getTask(taskId: string): Promise<SerializedTask>;
|
|
457
468
|
claimTask(): Promise<SerializedTask | undefined>;
|
|
458
469
|
completeTask(options: {
|
|
@@ -496,6 +507,9 @@ type DatabaseTaskStoreOptions = {
|
|
|
496
507
|
declare class DatabaseTaskStore implements TaskStore {
|
|
497
508
|
private readonly db;
|
|
498
509
|
static create(options: DatabaseTaskStoreOptions): Promise<DatabaseTaskStore>;
|
|
510
|
+
private isRecoverableTask;
|
|
511
|
+
private parseSpec;
|
|
512
|
+
private parseTaskSecrets;
|
|
499
513
|
private static getClient;
|
|
500
514
|
private static runMigrations;
|
|
501
515
|
private constructor();
|
|
@@ -513,6 +527,7 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
513
527
|
}): Promise<{
|
|
514
528
|
tasks: {
|
|
515
529
|
taskId: string;
|
|
530
|
+
recovery?: TaskRecovery;
|
|
516
531
|
}[];
|
|
517
532
|
}>;
|
|
518
533
|
completeTask(options: {
|
|
@@ -530,6 +545,9 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
530
545
|
cancelTask(options: TaskStoreEmitOptions<{
|
|
531
546
|
message: string;
|
|
532
547
|
} & JsonObject>): Promise<void>;
|
|
548
|
+
recoverTasks(options: TaskStoreRecoverTaskOptions): Promise<{
|
|
549
|
+
ids: string[];
|
|
550
|
+
}>;
|
|
533
551
|
}
|
|
534
552
|
|
|
535
553
|
/**
|
|
@@ -616,9 +634,13 @@ type CreateWorkerOptions = {
|
|
|
616
634
|
declare class TaskWorker {
|
|
617
635
|
private readonly options;
|
|
618
636
|
private taskQueue;
|
|
637
|
+
private logger;
|
|
638
|
+
private stopWorkers;
|
|
619
639
|
private constructor();
|
|
620
640
|
static create(options: CreateWorkerOptions): Promise<TaskWorker>;
|
|
641
|
+
recoverTasks(): Promise<void>;
|
|
621
642
|
start(): void;
|
|
643
|
+
stop(): void;
|
|
622
644
|
protected onReadyToClaimTask(): Promise<void>;
|
|
623
645
|
runOneTask(task: TaskContext): Promise<void>;
|
|
624
646
|
}
|
|
@@ -642,6 +664,7 @@ interface RouterOptions {
|
|
|
642
664
|
logger: Logger;
|
|
643
665
|
config: Config;
|
|
644
666
|
reader: UrlReader;
|
|
667
|
+
lifecycle?: LifecycleService;
|
|
645
668
|
database: PluginDatabaseManager;
|
|
646
669
|
catalogClient: CatalogApi;
|
|
647
670
|
scheduler?: PluginTaskScheduler;
|
|
@@ -719,4 +742,4 @@ declare const fetchContents: typeof fetchContents$1;
|
|
|
719
742
|
*/
|
|
720
743
|
declare const ScaffolderEntitiesProcessor: typeof ScaffolderEntitiesProcessor$1;
|
|
721
744
|
|
|
722
|
-
export { ActionContext, ActionPermissionRuleInput, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskStoreShutDownTaskOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, TemplateGlobal, TemplatePermissionRuleInput, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchCatalogEntityAction, createFetchPlainAction, createFetchPlainFileAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubDeployKeyAction, createGithubEnvironmentAction, createGithubIssuesLabelAction, createGithubRepoCreateAction, createGithubRepoPushAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishBitbucketCloudAction, createPublishBitbucketServerAction, createPublishBitbucketServerPullRequestAction, createPublishGerritAction, createPublishGerritReviewAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, createWaitAction, executeShellCommand, fetchContents };
|
|
745
|
+
export { ActionContext, ActionPermissionRuleInput, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskStoreRecoverTaskOptions, TaskStoreShutDownTaskOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, TemplateGlobal, TemplatePermissionRuleInput, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchCatalogEntityAction, createFetchPlainAction, createFetchPlainFileAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubDeployKeyAction, createGithubEnvironmentAction, createGithubIssuesLabelAction, createGithubRepoCreateAction, createGithubRepoPushAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishBitbucketCloudAction, createPublishBitbucketServerAction, createPublishBitbucketServerPullRequestAction, createPublishGerritAction, createPublishGerritReviewAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, createWaitAction, 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.21.0-next.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -44,26 +44,26 @@
|
|
|
44
44
|
"build:assets": "node scripts/build-nunjucks.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@backstage/backend-common": "^0.
|
|
48
|
-
"@backstage/backend-plugin-api": "^0.6.
|
|
49
|
-
"@backstage/backend-tasks": "^0.5.
|
|
50
|
-
"@backstage/catalog-client": "^1.
|
|
47
|
+
"@backstage/backend-common": "^0.21.0-next.0",
|
|
48
|
+
"@backstage/backend-plugin-api": "^0.6.10-next.0",
|
|
49
|
+
"@backstage/backend-tasks": "^0.5.15-next.0",
|
|
50
|
+
"@backstage/catalog-client": "^1.6.0-next.0",
|
|
51
51
|
"@backstage/catalog-model": "^1.4.3",
|
|
52
52
|
"@backstage/config": "^1.1.1",
|
|
53
53
|
"@backstage/errors": "^1.2.3",
|
|
54
54
|
"@backstage/integration": "^1.8.0",
|
|
55
|
-
"@backstage/plugin-auth-node": "^0.4.
|
|
56
|
-
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.
|
|
57
|
-
"@backstage/plugin-catalog-node": "^1.6.
|
|
58
|
-
"@backstage/plugin-permission-common": "^0.7.
|
|
59
|
-
"@backstage/plugin-permission-node": "^0.7.
|
|
60
|
-
"@backstage/plugin-scaffolder-backend-module-azure": "^0.1.
|
|
61
|
-
"@backstage/plugin-scaffolder-backend-module-bitbucket": "^0.1.
|
|
62
|
-
"@backstage/plugin-scaffolder-backend-module-gerrit": "^0.1.
|
|
63
|
-
"@backstage/plugin-scaffolder-backend-module-github": "^0.1.
|
|
64
|
-
"@backstage/plugin-scaffolder-backend-module-gitlab": "^0.2.
|
|
65
|
-
"@backstage/plugin-scaffolder-common": "^1.
|
|
66
|
-
"@backstage/plugin-scaffolder-node": "^0.
|
|
55
|
+
"@backstage/plugin-auth-node": "^0.4.4-next.0",
|
|
56
|
+
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.7-next.0",
|
|
57
|
+
"@backstage/plugin-catalog-node": "^1.6.2-next.0",
|
|
58
|
+
"@backstage/plugin-permission-common": "^0.7.12",
|
|
59
|
+
"@backstage/plugin-permission-node": "^0.7.21-next.0",
|
|
60
|
+
"@backstage/plugin-scaffolder-backend-module-azure": "^0.1.2-next.0",
|
|
61
|
+
"@backstage/plugin-scaffolder-backend-module-bitbucket": "^0.1.2-next.0",
|
|
62
|
+
"@backstage/plugin-scaffolder-backend-module-gerrit": "^0.1.2-next.0",
|
|
63
|
+
"@backstage/plugin-scaffolder-backend-module-github": "^0.1.2-next.0",
|
|
64
|
+
"@backstage/plugin-scaffolder-backend-module-gitlab": "^0.2.13-next.0",
|
|
65
|
+
"@backstage/plugin-scaffolder-common": "^1.5.0-next.0",
|
|
66
|
+
"@backstage/plugin-scaffolder-node": "^0.3.0-next.0",
|
|
67
67
|
"@backstage/types": "^1.1.1",
|
|
68
68
|
"@types/express": "^4.17.6",
|
|
69
69
|
"@types/luxon": "^3.0.0",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"zod": "^3.22.4"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@backstage/backend-test-utils": "^0.
|
|
92
|
-
"@backstage/cli": "^0.25.
|
|
91
|
+
"@backstage/backend-test-utils": "^0.3.0-next.0",
|
|
92
|
+
"@backstage/cli": "^0.25.2-next.0",
|
|
93
93
|
"@types/fs-extra": "^9.0.1",
|
|
94
94
|
"@types/nunjucks": "^3.1.4",
|
|
95
95
|
"@types/supertest": "^2.0.8",
|