@backstage/plugin-scaffolder-backend 1.22.5 → 1.22.6

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/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var router = require('./cjs/router-CDFi_apW.cjs.js');
3
+ var router = require('./cjs/router-BKGs_U4O.cjs.js');
4
4
  var github = require('@backstage/plugin-scaffolder-backend-module-github');
5
5
  var gitlab = require('@backstage/plugin-scaffolder-backend-module-gitlab');
6
6
  var azure = require('@backstage/plugin-scaffolder-backend-module-azure');
@@ -23,6 +23,7 @@ require('jsonschema');
23
23
  require('zod');
24
24
  require('yaml');
25
25
  require('fs-extra');
26
+ require('@backstage/backend-plugin-api');
26
27
  require('path');
27
28
  require('luxon');
28
29
  require('globby');
@@ -31,12 +32,15 @@ require('isolated-vm');
31
32
  require('lodash/get');
32
33
  require('@backstage/plugin-scaffolder-backend-module-gitea');
33
34
  require('uuid');
35
+ require('tar');
36
+ require('concat-stream');
37
+ require('util');
38
+ require('stream');
34
39
  require('zen-observable');
35
40
  require('lodash');
36
41
  require('p-queue');
37
42
  require('winston');
38
43
  require('nunjucks');
39
- require('stream');
40
44
  require('@backstage/plugin-permission-node');
41
45
  require('prom-client');
42
46
  require('@backstage/plugin-permission-common');
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/scaffolder/actions/deprecated.ts","../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as github from '@backstage/plugin-scaffolder-backend-module-github';\nimport * as gitlab from '@backstage/plugin-scaffolder-backend-module-gitlab';\nimport * as azure from '@backstage/plugin-scaffolder-backend-module-azure';\nimport * as bitbucket from '@backstage/plugin-scaffolder-backend-module-bitbucket';\nimport * as bitbucketCloud from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud';\nimport * as bitbucketServer from '@backstage/plugin-scaffolder-backend-module-bitbucket-server';\nimport * as gerrit from '@backstage/plugin-scaffolder-backend-module-gerrit';\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubActionsDispatchAction =\n github.createGithubActionsDispatchAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubDeployKeyAction = github.createGithubDeployKeyAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubEnvironmentAction =\n github.createGithubEnvironmentAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubIssuesLabelAction =\n github.createGithubIssuesLabelAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport type CreateGithubPullRequestActionOptions =\n github.CreateGithubPullRequestActionOptions;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubRepoCreateAction = github.createGithubRepoCreateAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubRepoPushAction = github.createGithubRepoPushAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubWebhookAction = github.createGithubWebhookAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createPublishGithubAction = github.createPublishGithubAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createPublishGithubPullRequestAction =\n github.createPublishGithubPullRequestAction;\n\n/**\n * @public @deprecated use \"createPublishBitbucketCloudAction\" from \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or \"createPublishBitbucketServerAction\" from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketAction =\n bitbucket.createPublishBitbucketAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud instead\n */\nexport const createPublishBitbucketCloudAction =\n bitbucketCloud.createPublishBitbucketCloudAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketServerAction =\n bitbucketServer.createPublishBitbucketServerAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketServerPullRequestAction =\n bitbucketServer.createPublishBitbucketServerPullRequestAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-azure instead\n */\nexport const createPublishAzureAction = azure.createPublishAzureAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gerrit instead\n */\nexport const createPublishGerritAction = gerrit.createPublishGerritAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gerrit instead\n */\nexport const createPublishGerritReviewAction =\n gerrit.createPublishGerritReviewAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gitlab instead\n */\nexport const createPublishGitlabAction = gitlab.createPublishGitlabAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gitlab instead\n */\nexport const createPublishGitlabMergeRequestAction =\n gitlab.createPublishGitlabMergeRequestAction;\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ActionContext as ActionContextNode,\n createTemplateAction as createTemplateActionNode,\n TaskSecrets as TaskSecretsNode,\n TemplateAction as TemplateActionNode,\n executeShellCommand as executeShellCommandNode,\n ExecuteShellCommandOptions as ExecuteShellCommandOptionsNode,\n fetchContents as fetchContentsNode,\n} from '@backstage/plugin-scaffolder-node';\nimport { JsonObject } from '@backstage/types';\nimport { ScaffolderEntitiesProcessor as ScaffolderEntitiesProcessorModule } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';\n\n/**\n * @public\n * @deprecated Import from {@link @backstage/plugin-scaffolder-node#ActionContext} instead\n */\nexport type ActionContext<TInput extends JsonObject> =\n ActionContextNode<TInput>;\n\n/**\n * @public\n * @deprecated Use `createTemplateAction` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const createTemplateAction = createTemplateActionNode;\n\n/**\n * @public\n * @deprecated Use `TaskSecrets` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type TaskSecrets = TaskSecretsNode;\n\n/**\n * @public\n * @deprecated Use `TemplateAction` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type TemplateAction<TInput extends JsonObject> =\n TemplateActionNode<TInput>;\n\n/**\n * Options for {@link executeShellCommand}.\n *\n * @public\n * @deprecated Use `ExecuteShellCommandOptions` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type RunCommandOptions = ExecuteShellCommandOptionsNode;\n\n/**\n * Run a command in a sub-process, normally a shell command.\n *\n * @public\n * @deprecated Use `executeShellCommand` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const executeShellCommand = executeShellCommandNode;\n\n/**\n * A helper function that reads the contents of a directory from the given URL.\n * Can be used in your own actions, and also used behind fetch:template and fetch:plain\n *\n * @public\n * @deprecated Use `fetchContents` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const fetchContents = fetchContentsNode;\n\n/**\n * Adds support for scaffolder specific entity kinds to the catalog.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-catalog-backend-module-scaffolder-entity-model` instead\n */\nexport const ScaffolderEntitiesProcessor = ScaffolderEntitiesProcessorModule;\n"],"names":["github","bitbucket","bitbucketCloud","bitbucketServer","azure","gerrit","gitlab","createTemplateActionNode","executeShellCommandNode","fetchContentsNode","ScaffolderEntitiesProcessorModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,oCACXA,iBAAO,CAAA,kCAAA;AAKF,MAAM,8BAA8BA,iBAAO,CAAA,4BAAA;AAK3C,MAAM,gCACXA,iBAAO,CAAA,8BAAA;AAKF,MAAM,gCACXA,iBAAO,CAAA,8BAAA;AAWF,MAAM,+BAA+BA,iBAAO,CAAA,6BAAA;AAK5C,MAAM,6BAA6BA,iBAAO,CAAA,2BAAA;AAK1C,MAAM,4BAA4BA,iBAAO,CAAA,0BAAA;AAKzC,MAAM,4BAA4BA,iBAAO,CAAA,0BAAA;AAKzC,MAAM,uCACXA,iBAAO,CAAA,qCAAA;AAKF,MAAM,+BACXC,oBAAU,CAAA,6BAAA;AAKL,MAAM,oCACXC,yBAAe,CAAA,kCAAA;AAKV,MAAM,qCACXC,0BAAgB,CAAA,mCAAA;AAKX,MAAM,gDACXA,0BAAgB,CAAA,8CAAA;AAKX,MAAM,2BAA2BC,gBAAM,CAAA,yBAAA;AAKvC,MAAM,4BAA4BC,iBAAO,CAAA,0BAAA;AAKzC,MAAM,kCACXA,iBAAO,CAAA,gCAAA;AAKF,MAAM,4BAA4BC,iBAAO,CAAA,0BAAA;AAKzC,MAAM,wCACXA,iBAAO,CAAA;;ACxFF,MAAM,oBAAuB,GAAAC,0CAAA;AA6B7B,MAAM,mBAAsB,GAAAC,yCAAA;AAS5B,MAAM,aAAgB,GAAAC,mCAAA;AAQtB,MAAM,2BAA8B,GAAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/scaffolder/actions/deprecated.ts","../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as github from '@backstage/plugin-scaffolder-backend-module-github';\nimport * as gitlab from '@backstage/plugin-scaffolder-backend-module-gitlab';\nimport * as azure from '@backstage/plugin-scaffolder-backend-module-azure';\nimport * as bitbucket from '@backstage/plugin-scaffolder-backend-module-bitbucket';\nimport * as bitbucketCloud from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud';\nimport * as bitbucketServer from '@backstage/plugin-scaffolder-backend-module-bitbucket-server';\nimport * as gerrit from '@backstage/plugin-scaffolder-backend-module-gerrit';\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubActionsDispatchAction =\n github.createGithubActionsDispatchAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubDeployKeyAction = github.createGithubDeployKeyAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubEnvironmentAction =\n github.createGithubEnvironmentAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubIssuesLabelAction =\n github.createGithubIssuesLabelAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport type CreateGithubPullRequestActionOptions =\n github.CreateGithubPullRequestActionOptions;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubRepoCreateAction = github.createGithubRepoCreateAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubRepoPushAction = github.createGithubRepoPushAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createGithubWebhookAction = github.createGithubWebhookAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createPublishGithubAction = github.createPublishGithubAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-github instead\n */\nexport const createPublishGithubPullRequestAction =\n github.createPublishGithubPullRequestAction;\n\n/**\n * @public @deprecated use \"createPublishBitbucketCloudAction\" from \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or \"createPublishBitbucketServerAction\" from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketAction =\n bitbucket.createPublishBitbucketAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud instead\n */\nexport const createPublishBitbucketCloudAction =\n bitbucketCloud.createPublishBitbucketCloudAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketServerAction =\n bitbucketServer.createPublishBitbucketServerAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const createPublishBitbucketServerPullRequestAction =\n bitbucketServer.createPublishBitbucketServerPullRequestAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-azure instead\n */\nexport const createPublishAzureAction = azure.createPublishAzureAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gerrit instead\n */\nexport const createPublishGerritAction = gerrit.createPublishGerritAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gerrit instead\n */\nexport const createPublishGerritReviewAction =\n gerrit.createPublishGerritReviewAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gitlab instead\n */\nexport const createPublishGitlabAction = gitlab.createPublishGitlabAction;\n\n/**\n * @public @deprecated use import from \\@backstage/plugin-scaffolder-backend-module-gitlab instead\n */\nexport const createPublishGitlabMergeRequestAction =\n gitlab.createPublishGitlabMergeRequestAction;\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ActionContext as ActionContextNode,\n createTemplateAction as createTemplateActionNode,\n TaskSecrets as TaskSecretsNode,\n TemplateAction as TemplateActionNode,\n executeShellCommand as executeShellCommandNode,\n ExecuteShellCommandOptions as ExecuteShellCommandOptionsNode,\n fetchContents as fetchContentsNode,\n} from '@backstage/plugin-scaffolder-node';\nimport { JsonObject } from '@backstage/types';\nimport { ScaffolderEntitiesProcessor as ScaffolderEntitiesProcessorModule } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';\n\n/**\n * @public\n * @deprecated Import from {@link @backstage/plugin-scaffolder-node#ActionContext} instead\n */\nexport type ActionContext<TInput extends JsonObject> =\n ActionContextNode<TInput>;\n\n/**\n * @public\n * @deprecated Use `createTemplateAction` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const createTemplateAction = createTemplateActionNode;\n\n/**\n * @public\n * @deprecated Use `TaskSecrets` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type TaskSecrets = TaskSecretsNode;\n\n/**\n * @public\n * @deprecated Use `TemplateAction` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type TemplateAction<TInput extends JsonObject> =\n TemplateActionNode<TInput>;\n\n/**\n * Options for {@link executeShellCommand}.\n *\n * @public\n * @deprecated Use `ExecuteShellCommandOptions` from `@backstage/plugin-scaffolder-node` instead\n */\nexport type RunCommandOptions = ExecuteShellCommandOptionsNode;\n\n/**\n * Run a command in a sub-process, normally a shell command.\n *\n * @public\n * @deprecated Use `executeShellCommand` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const executeShellCommand = executeShellCommandNode;\n\n/**\n * A helper function that reads the contents of a directory from the given URL.\n * Can be used in your own actions, and also used behind fetch:template and fetch:plain\n *\n * @public\n * @deprecated Use `fetchContents` from `@backstage/plugin-scaffolder-node` instead\n */\nexport const fetchContents = fetchContentsNode;\n\n/**\n * Adds support for scaffolder specific entity kinds to the catalog.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-catalog-backend-module-scaffolder-entity-model` instead\n */\nexport const ScaffolderEntitiesProcessor = ScaffolderEntitiesProcessorModule;\n"],"names":["github","bitbucket","bitbucketCloud","bitbucketServer","azure","gerrit","gitlab","createTemplateActionNode","executeShellCommandNode","fetchContentsNode","ScaffolderEntitiesProcessorModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,oCACXA,iBAAO,CAAA,kCAAA;AAKF,MAAM,8BAA8BA,iBAAO,CAAA,4BAAA;AAK3C,MAAM,gCACXA,iBAAO,CAAA,8BAAA;AAKF,MAAM,gCACXA,iBAAO,CAAA,8BAAA;AAWF,MAAM,+BAA+BA,iBAAO,CAAA,6BAAA;AAK5C,MAAM,6BAA6BA,iBAAO,CAAA,2BAAA;AAK1C,MAAM,4BAA4BA,iBAAO,CAAA,0BAAA;AAKzC,MAAM,4BAA4BA,iBAAO,CAAA,0BAAA;AAKzC,MAAM,uCACXA,iBAAO,CAAA,qCAAA;AAKF,MAAM,+BACXC,oBAAU,CAAA,6BAAA;AAKL,MAAM,oCACXC,yBAAe,CAAA,kCAAA;AAKV,MAAM,qCACXC,0BAAgB,CAAA,mCAAA;AAKX,MAAM,gDACXA,0BAAgB,CAAA,8CAAA;AAKX,MAAM,2BAA2BC,gBAAM,CAAA,yBAAA;AAKvC,MAAM,4BAA4BC,iBAAO,CAAA,0BAAA;AAKzC,MAAM,kCACXA,iBAAO,CAAA,gCAAA;AAKF,MAAM,4BAA4BC,iBAAO,CAAA,0BAAA;AAKzC,MAAM,wCACXA,iBAAO,CAAA;;ACxFF,MAAM,oBAAuB,GAAAC,0CAAA;AA6B7B,MAAM,mBAAsB,GAAAC,yCAAA;AAS5B,MAAM,aAAgB,GAAAC,mCAAA;AAQtB,MAAM,2BAA8B,GAAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
3
  import { TemplateFilter as TemplateFilter$1, TemplateGlobal as TemplateGlobal$1, TemplateAction as TemplateAction$1, TaskStatus as TaskStatus$1, TaskCompletionState as TaskCompletionState$1, SerializedTask as SerializedTask$1, TaskEventType as TaskEventType$1, SerializedTaskEvent as SerializedTaskEvent$1, TaskBrokerDispatchResult as TaskBrokerDispatchResult$1, TaskBrokerDispatchOptions as TaskBrokerDispatchOptions$1, TaskContext as TaskContext$1, TaskBroker as TaskBroker$1, TaskSecrets as TaskSecrets$1, ActionContext as ActionContext$1, ExecuteShellCommandOptions, executeShellCommand as executeShellCommand$1, fetchContents as fetchContents$1 } from '@backstage/plugin-scaffolder-node';
3
4
  import * as _backstage_types from '@backstage/types';
@@ -65,14 +66,14 @@ declare function createFetchCatalogEntityAction(options: {
65
66
  catalogClient: CatalogApi;
66
67
  auth?: AuthService;
67
68
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
68
- entityRef?: string | undefined;
69
- entityRefs?: string[] | undefined;
70
69
  optional?: boolean | undefined;
71
70
  defaultKind?: string | undefined;
72
71
  defaultNamespace?: string | undefined;
72
+ entityRef?: string | undefined;
73
+ entityRefs?: string[] | undefined;
73
74
  }, {
74
- entity?: any;
75
75
  entities?: any[] | undefined;
76
+ entity?: any;
76
77
  }>;
77
78
 
78
79
  /**
@@ -279,6 +280,8 @@ declare const createPublishGithubPullRequestAction: (options: github.CreateGithu
279
280
  commitMessage?: string | undefined;
280
281
  update?: boolean | undefined;
281
282
  forceFork?: boolean | undefined;
283
+ gitAuthorName?: string | undefined;
284
+ gitAuthorEmail?: string | undefined;
282
285
  }, _backstage_types.JsonObject>;
283
286
  /**
284
287
  * @public @deprecated use "createPublishBitbucketCloudAction" from \@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or "createPublishBitbucketServerAction" from \@backstage/plugin-scaffolder-backend-module-bitbucket-server instead
@@ -501,6 +504,17 @@ interface TaskStore {
501
504
  events: SerializedTaskEvent[];
502
505
  }>;
503
506
  shutdownTask?(options: TaskStoreShutDownTaskOptions): Promise<void>;
507
+ rehydrateWorkspace?(options: {
508
+ taskId: string;
509
+ targetPath: string;
510
+ }): Promise<void>;
511
+ cleanWorkspace?({ taskId }: {
512
+ taskId: string;
513
+ }): Promise<void>;
514
+ serializeWorkspace?({ path, taskId, }: {
515
+ path: string;
516
+ taskId: string;
517
+ }): Promise<void>;
504
518
  }
505
519
 
506
520
  /**
@@ -563,6 +577,17 @@ declare class DatabaseTaskStore implements TaskStore {
563
577
  events: SerializedTaskEvent$1[];
564
578
  }>;
565
579
  shutdownTask(options: TaskStoreShutDownTaskOptions): Promise<void>;
580
+ rehydrateWorkspace(options: {
581
+ taskId: string;
582
+ targetPath: string;
583
+ }): Promise<void>;
584
+ cleanWorkspace({ taskId }: {
585
+ taskId: string;
586
+ }): Promise<void>;
587
+ serializeWorkspace(options: {
588
+ path: string;
589
+ taskId: string;
590
+ }): Promise<void>;
566
591
  cancelTask(options: TaskStoreEmitOptions<{
567
592
  message: string;
568
593
  } & JsonObject>): Promise<void>;
@@ -582,15 +607,20 @@ declare class TaskManager implements TaskContext$1 {
582
607
  private readonly signal;
583
608
  private readonly logger;
584
609
  private readonly auth?;
610
+ private readonly config?;
585
611
  private isDone;
586
612
  private heartbeatTimeoutId?;
587
- static create(task: CurrentClaimedTask, storage: TaskStore, abortSignal: AbortSignal, logger: Logger, auth?: AuthService): TaskManager;
613
+ static create(task: CurrentClaimedTask, storage: TaskStore, abortSignal: AbortSignal, logger: Logger, auth?: AuthService, config?: Config): TaskManager;
588
614
  private constructor();
589
615
  get spec(): _backstage_plugin_scaffolder_common.TaskSpecV1beta3;
590
616
  get cancelSignal(): AbortSignal;
591
617
  get secrets(): TaskSecrets$1 | undefined;
592
618
  get createdBy(): string | undefined;
593
619
  getWorkspaceName(): Promise<string>;
620
+ rehydrateWorkspace?(options: {
621
+ taskId: string;
622
+ targetPath: string;
623
+ }): Promise<void>;
594
624
  get done(): boolean;
595
625
  emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
596
626
  getTaskState?(): Promise<{
@@ -605,8 +635,13 @@ declare class TaskManager implements TaskContext$1 {
605
635
  status: 'failed';
606
636
  reason: string;
607
637
  }): Promise<void>;
638
+ serializeWorkspace?(options: {
639
+ path: string;
640
+ }): Promise<void>;
641
+ cleanWorkspace?(): Promise<void>;
608
642
  complete(result: TaskCompletionState$1, metadata?: JsonObject): Promise<void>;
609
643
  private startTimeout;
644
+ private isWorkspaceSerializationEnabled;
610
645
  getInitiatorCredentials(): Promise<BackstageCredentials>;
611
646
  }
612
647
  /**
@@ -635,6 +670,7 @@ interface CurrentClaimedTask {
635
670
  * The creator of the task.
636
671
  */
637
672
  createdBy?: string;
673
+ workspace?: Promise<Buffer>;
638
674
  }
639
675
 
640
676
  /**
@@ -0,0 +1,35 @@
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.binary('workspace').nullable().comment('A snapshot of the workspace');
25
+ });
26
+ };
27
+
28
+ /**
29
+ * @param {import('knex').Knex} knex
30
+ */
31
+ exports.down = async function down(knex) {
32
+ await knex.schema.alterTable('tasks', table => {
33
+ table.dropColumn('workspace');
34
+ });
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.22.5",
3
+ "version": "1.22.6",
4
4
  "description": "The Backstage backend plugin that helps you create new things",
5
5
  "backstage": {
6
6
  "role": "backend-plugin"
@@ -51,32 +51,33 @@
51
51
  "test": "backstage-cli package test"
52
52
  },
53
53
  "dependencies": {
54
- "@backstage/backend-common": "^0.21.7",
55
- "@backstage/backend-plugin-api": "^0.6.17",
56
- "@backstage/backend-tasks": "^0.5.22",
57
- "@backstage/catalog-client": "^1.6.4",
58
- "@backstage/catalog-model": "^1.4.5",
54
+ "@backstage/backend-common": "^0.22.0",
55
+ "@backstage/backend-plugin-api": "^0.6.18",
56
+ "@backstage/backend-tasks": "^0.5.23",
57
+ "@backstage/catalog-client": "^1.6.5",
58
+ "@backstage/catalog-model": "^1.5.0",
59
59
  "@backstage/config": "^1.2.0",
60
60
  "@backstage/errors": "^1.2.4",
61
- "@backstage/integration": "^1.10.0",
62
- "@backstage/plugin-auth-node": "^0.4.12",
63
- "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.15",
64
- "@backstage/plugin-catalog-node": "^1.11.1",
61
+ "@backstage/integration": "^1.11.0",
62
+ "@backstage/plugin-auth-node": "^0.4.13",
63
+ "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.16",
64
+ "@backstage/plugin-catalog-node": "^1.12.0",
65
65
  "@backstage/plugin-permission-common": "^0.7.13",
66
- "@backstage/plugin-permission-node": "^0.7.28",
67
- "@backstage/plugin-scaffolder-backend-module-azure": "^0.1.9",
68
- "@backstage/plugin-scaffolder-backend-module-bitbucket": "^0.2.7",
69
- "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "^0.1.7",
70
- "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "^0.1.7",
71
- "@backstage/plugin-scaffolder-backend-module-gerrit": "^0.1.9",
72
- "@backstage/plugin-scaffolder-backend-module-gitea": "^0.1.7",
73
- "@backstage/plugin-scaffolder-backend-module-github": "^0.2.7",
74
- "@backstage/plugin-scaffolder-backend-module-gitlab": "^0.3.3",
75
- "@backstage/plugin-scaffolder-common": "^1.5.1",
76
- "@backstage/plugin-scaffolder-node": "^0.4.3",
66
+ "@backstage/plugin-permission-node": "^0.7.29",
67
+ "@backstage/plugin-scaffolder-backend-module-azure": "^0.1.10",
68
+ "@backstage/plugin-scaffolder-backend-module-bitbucket": "^0.2.8",
69
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "^0.1.8",
70
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "^0.1.8",
71
+ "@backstage/plugin-scaffolder-backend-module-gerrit": "^0.1.10",
72
+ "@backstage/plugin-scaffolder-backend-module-gitea": "^0.1.8",
73
+ "@backstage/plugin-scaffolder-backend-module-github": "^0.2.8",
74
+ "@backstage/plugin-scaffolder-backend-module-gitlab": "^0.4.0",
75
+ "@backstage/plugin-scaffolder-common": "^1.5.2",
76
+ "@backstage/plugin-scaffolder-node": "^0.4.4",
77
77
  "@backstage/types": "^1.1.1",
78
78
  "@types/express": "^4.17.6",
79
79
  "@types/luxon": "^3.0.0",
80
+ "concat-stream": "^2.0.0",
80
81
  "express": "^4.17.1",
81
82
  "express-promise-router": "^4.1.0",
82
83
  "fs-extra": "^11.2.0",
@@ -92,6 +93,7 @@
92
93
  "p-limit": "^3.1.0",
93
94
  "p-queue": "^6.6.2",
94
95
  "prom-client": "^15.0.0",
96
+ "tar": "^6.1.12",
95
97
  "uuid": "^9.0.0",
96
98
  "winston": "^3.2.1",
97
99
  "winston-transport": "^4.7.0",
@@ -100,9 +102,9 @@
100
102
  "zod": "^3.22.4"
101
103
  },
102
104
  "devDependencies": {
103
- "@backstage/backend-test-utils": "^0.3.7",
104
- "@backstage/cli": "^0.26.4",
105
- "@backstage/plugin-scaffolder-node-test-utils": "^0.1.3",
105
+ "@backstage/backend-test-utils": "^0.3.8",
106
+ "@backstage/cli": "^0.26.5",
107
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.4",
106
108
  "@types/fs-extra": "^11.0.0",
107
109
  "@types/nunjucks": "^3.1.4",
108
110
  "@types/supertest": "^2.0.8",