@backstage/plugin-scaffolder-backend 1.23.1-next.0 → 1.23.1-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 CHANGED
@@ -1,5 +1,69 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.23.1-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - c544f81: Add support for status filtering in scaffolder tasks endpoint
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@0.8.0-next.2
10
+ - @backstage/plugin-scaffolder-node@0.4.9-next.2
11
+ - @backstage/plugin-permission-common@0.8.1-next.1
12
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.13-next.2
13
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.13-next.2
14
+ - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.13-next.2
15
+ - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.15-next.2
16
+ - @backstage/plugin-scaffolder-backend-module-gitea@0.1.13-next.2
17
+ - @backstage/backend-common@0.23.4-next.2
18
+ - @backstage/plugin-auth-node@0.5.0-next.2
19
+ - @backstage/plugin-permission-node@0.8.1-next.2
20
+ - @backstage/backend-tasks@0.5.28-next.2
21
+ - @backstage/plugin-catalog-node@1.12.5-next.2
22
+ - @backstage/plugin-bitbucket-cloud-common@0.2.22-next.1
23
+ - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.21-next.2
24
+ - @backstage/plugin-scaffolder-backend-module-azure@0.1.15-next.2
25
+ - @backstage/plugin-scaffolder-backend-module-github@0.4.1-next.2
26
+ - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.5-next.2
27
+ - @backstage/plugin-scaffolder-common@1.5.5-next.1
28
+ - @backstage/integration@1.14.0-next.0
29
+ - @backstage/catalog-client@1.6.5
30
+ - @backstage/catalog-model@1.5.0
31
+ - @backstage/config@1.2.0
32
+ - @backstage/errors@1.2.4
33
+ - @backstage/types@1.1.1
34
+
35
+ ## 1.23.1-next.1
36
+
37
+ ### Patch Changes
38
+
39
+ - ef87e06: Fix scaffolder action `catalog:write` to write to directories that don't already exist
40
+ - Updated dependencies
41
+ - @backstage/plugin-scaffolder-backend-module-github@0.4.1-next.1
42
+ - @backstage/plugin-scaffolder-backend-module-gitea@0.1.13-next.1
43
+ - @backstage/plugin-permission-common@0.8.1-next.0
44
+ - @backstage/plugin-permission-node@0.8.1-next.1
45
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.13-next.1
46
+ - @backstage/backend-plugin-api@0.7.1-next.1
47
+ - @backstage/backend-common@0.23.4-next.1
48
+ - @backstage/integration@1.14.0-next.0
49
+ - @backstage/plugin-catalog-node@1.12.5-next.1
50
+ - @backstage/plugin-scaffolder-common@1.5.5-next.0
51
+ - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.13-next.1
52
+ - @backstage/backend-tasks@0.5.28-next.1
53
+ - @backstage/catalog-client@1.6.5
54
+ - @backstage/catalog-model@1.5.0
55
+ - @backstage/config@1.2.0
56
+ - @backstage/errors@1.2.4
57
+ - @backstage/types@1.1.1
58
+ - @backstage/plugin-auth-node@0.4.18-next.1
59
+ - @backstage/plugin-bitbucket-cloud-common@0.2.22-next.0
60
+ - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.21-next.1
61
+ - @backstage/plugin-scaffolder-backend-module-azure@0.1.15-next.1
62
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.13-next.1
63
+ - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.15-next.1
64
+ - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.5-next.1
65
+ - @backstage/plugin-scaffolder-node@0.4.9-next.1
66
+
3
67
  ## 1.23.1-next.0
4
68
 
5
69
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend__alpha",
3
- "version": "1.23.1-next.0",
3
+ "version": "1.23.1-next.2",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var alpha = require('@backstage/plugin-scaffolder-common/alpha');
6
6
  var pluginPermissionNode = require('@backstage/plugin-permission-node');
7
- var router = require('./cjs/router-O4Kmvgd-.cjs.js');
7
+ var router = require('./cjs/router-aU_OCgqT.cjs.js');
8
8
  var backendPluginApi = require('@backstage/backend-plugin-api');
9
9
  var backendCommon = require('@backstage/backend-common');
10
10
  var integration = require('@backstage/integration');
@@ -281,7 +281,7 @@ function createCatalogWriteAction() {
281
281
  const entityRef = ctx.templateInfo?.entityRef;
282
282
  const path = filePath ?? "catalog-info.yaml";
283
283
  ctx.logger.info(`Writing ${path}`);
284
- await fs__default.default.writeFile(
284
+ await fs__default.default.outputFile(
285
285
  backendPluginApi.resolveSafeChildPath(ctx.workspacePath, path),
286
286
  yaml__namespace.stringify({
287
287
  ...entity,
@@ -1582,6 +1582,9 @@ class DatabaseTaskStore {
1582
1582
  created_by: options.createdBy
1583
1583
  });
1584
1584
  }
1585
+ if (options.status) {
1586
+ queryBuilder.where({ status: options.status });
1587
+ }
1585
1588
  const results = await queryBuilder.orderBy("created_at", "desc").select();
1586
1589
  const tasks = results.map((result) => ({
1587
1590
  id: result.id,
@@ -2104,7 +2107,10 @@ class StorageTaskBroker {
2104
2107
  "TaskStore does not implement the list method. Please implement the list method to be able to list tasks"
2105
2108
  );
2106
2109
  }
2107
- return await this.storage.list({ createdBy: options?.createdBy });
2110
+ return await this.storage.list({
2111
+ createdBy: options?.createdBy,
2112
+ status: options?.status
2113
+ });
2108
2114
  }
2109
2115
  deferredDispatch = defer();
2110
2116
  async registerCancellable(taskId, abortController) {
@@ -3531,8 +3537,13 @@ async function createRouter(options) {
3531
3537
  "TaskBroker does not support listing tasks, please implement the list method on the TaskBroker."
3532
3538
  );
3533
3539
  }
3540
+ const [statusQuery] = [req.query.status].flat();
3541
+ if (typeof statusQuery !== "string" && typeof statusQuery !== "undefined") {
3542
+ throw new errors.InputError("status query parameter must be a string");
3543
+ }
3534
3544
  const tasks = await taskBroker.list({
3535
- createdBy: userEntityRef
3545
+ createdBy: userEntityRef,
3546
+ status: statusQuery ? statusQuery : void 0
3536
3547
  });
3537
3548
  res.status(200).json(tasks);
3538
3549
  }).get("/v2/tasks/:taskId", async (req, res) => {
@@ -3774,4 +3785,4 @@ exports.createRouter = createRouter;
3774
3785
  exports.createWaitAction = createWaitAction;
3775
3786
  exports.scaffolderActionRules = scaffolderActionRules;
3776
3787
  exports.scaffolderTemplateRules = scaffolderTemplateRules;
3777
- //# sourceMappingURL=router-O4Kmvgd-.cjs.js.map
3788
+ //# sourceMappingURL=router-aU_OCgqT.cjs.js.map