@backstage/plugin-scaffolder-backend 1.22.5 → 1.22.6-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/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-DhoUgDz0.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');
@@ -31,12 +31,15 @@ require('isolated-vm');
31
31
  require('lodash/get');
32
32
  require('@backstage/plugin-scaffolder-backend-module-gitea');
33
33
  require('uuid');
34
+ require('tar');
35
+ require('concat-stream');
36
+ require('util');
37
+ require('stream');
34
38
  require('zen-observable');
35
39
  require('lodash');
36
40
  require('p-queue');
37
41
  require('winston');
38
42
  require('nunjucks');
39
- require('stream');
40
43
  require('@backstage/plugin-permission-node');
41
44
  require('prom-client');
42
45
  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
  /**
@@ -501,6 +502,17 @@ interface TaskStore {
501
502
  events: SerializedTaskEvent[];
502
503
  }>;
503
504
  shutdownTask?(options: TaskStoreShutDownTaskOptions): Promise<void>;
505
+ rehydrateWorkspace?(options: {
506
+ taskId: string;
507
+ targetPath: string;
508
+ }): Promise<void>;
509
+ cleanWorkspace?({ taskId }: {
510
+ taskId: string;
511
+ }): Promise<void>;
512
+ serializeWorkspace?({ path, taskId, }: {
513
+ path: string;
514
+ taskId: string;
515
+ }): Promise<void>;
504
516
  }
505
517
 
506
518
  /**
@@ -563,6 +575,17 @@ declare class DatabaseTaskStore implements TaskStore {
563
575
  events: SerializedTaskEvent$1[];
564
576
  }>;
565
577
  shutdownTask(options: TaskStoreShutDownTaskOptions): Promise<void>;
578
+ rehydrateWorkspace(options: {
579
+ taskId: string;
580
+ targetPath: string;
581
+ }): Promise<void>;
582
+ cleanWorkspace({ taskId }: {
583
+ taskId: string;
584
+ }): Promise<void>;
585
+ serializeWorkspace(options: {
586
+ path: string;
587
+ taskId: string;
588
+ }): Promise<void>;
566
589
  cancelTask(options: TaskStoreEmitOptions<{
567
590
  message: string;
568
591
  } & JsonObject>): Promise<void>;
@@ -582,15 +605,20 @@ declare class TaskManager implements TaskContext$1 {
582
605
  private readonly signal;
583
606
  private readonly logger;
584
607
  private readonly auth?;
608
+ private readonly config?;
585
609
  private isDone;
586
610
  private heartbeatTimeoutId?;
587
- static create(task: CurrentClaimedTask, storage: TaskStore, abortSignal: AbortSignal, logger: Logger, auth?: AuthService): TaskManager;
611
+ static create(task: CurrentClaimedTask, storage: TaskStore, abortSignal: AbortSignal, logger: Logger, auth?: AuthService, config?: Config): TaskManager;
588
612
  private constructor();
589
613
  get spec(): _backstage_plugin_scaffolder_common.TaskSpecV1beta3;
590
614
  get cancelSignal(): AbortSignal;
591
615
  get secrets(): TaskSecrets$1 | undefined;
592
616
  get createdBy(): string | undefined;
593
617
  getWorkspaceName(): Promise<string>;
618
+ rehydrateWorkspace?(options: {
619
+ taskId: string;
620
+ targetPath: string;
621
+ }): Promise<void>;
594
622
  get done(): boolean;
595
623
  emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
596
624
  getTaskState?(): Promise<{
@@ -605,8 +633,13 @@ declare class TaskManager implements TaskContext$1 {
605
633
  status: 'failed';
606
634
  reason: string;
607
635
  }): Promise<void>;
636
+ serializeWorkspace?(options: {
637
+ path: string;
638
+ }): Promise<void>;
639
+ cleanWorkspace?(): Promise<void>;
608
640
  complete(result: TaskCompletionState$1, metadata?: JsonObject): Promise<void>;
609
641
  private startTimeout;
642
+ private isWorkspaceSerializationEnabled;
610
643
  getInitiatorCredentials(): Promise<BackstageCredentials>;
611
644
  }
612
645
  /**
@@ -635,6 +668,7 @@ interface CurrentClaimedTask {
635
668
  * The creator of the task.
636
669
  */
637
670
  createdBy?: string;
671
+ workspace?: Promise<Buffer>;
638
672
  }
639
673
 
640
674
  /**
@@ -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-next.2",
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-next.2",
55
+ "@backstage/backend-plugin-api": "^0.6.18-next.1",
56
+ "@backstage/backend-tasks": "^0.5.23-next.1",
57
+ "@backstage/catalog-client": "^1.6.5-next.0",
58
+ "@backstage/catalog-model": "^1.5.0-next.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-next.0",
62
+ "@backstage/plugin-auth-node": "^0.4.13-next.1",
63
+ "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.16-next.2",
64
+ "@backstage/plugin-catalog-node": "^1.12.0-next.2",
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-next.1",
67
+ "@backstage/plugin-scaffolder-backend-module-azure": "^0.1.10-next.2",
68
+ "@backstage/plugin-scaffolder-backend-module-bitbucket": "^0.2.8-next.2",
69
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "^0.1.8-next.2",
70
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "^0.1.8-next.2",
71
+ "@backstage/plugin-scaffolder-backend-module-gerrit": "^0.1.10-next.2",
72
+ "@backstage/plugin-scaffolder-backend-module-gitea": "^0.1.8-next.2",
73
+ "@backstage/plugin-scaffolder-backend-module-github": "^0.2.8-next.2",
74
+ "@backstage/plugin-scaffolder-backend-module-gitlab": "^0.4.0-next.2",
75
+ "@backstage/plugin-scaffolder-common": "^1.5.2-next.1",
76
+ "@backstage/plugin-scaffolder-node": "^0.4.4-next.2",
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-next.2",
106
+ "@backstage/cli": "^0.26.5-next.1",
107
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.4-next.1",
106
108
  "@types/fs-extra": "^11.0.0",
107
109
  "@types/nunjucks": "^3.1.4",
108
110
  "@types/supertest": "^2.0.8",