@backstage/plugin-scaffolder-backend 1.16.6-next.1 → 1.17.0-next.3

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.
@@ -41,7 +41,6 @@ var promClient = require('prom-client');
41
41
  var pluginPermissionCommon = require('@backstage/plugin-permission-common');
42
42
  var url = require('url');
43
43
  var os = require('os');
44
- var pluginCatalogNode = require('@backstage/plugin-catalog-node');
45
44
 
46
45
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
47
46
 
@@ -81,7 +80,7 @@ var winston__namespace = /*#__PURE__*/_interopNamespace(winston);
81
80
  var nunjucks__default = /*#__PURE__*/_interopDefaultLegacy(nunjucks);
82
81
  var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
83
82
 
84
- const examples$e = [
83
+ const examples$f = [
85
84
  {
86
85
  description: "Register with the catalog",
87
86
  example: yaml__default["default"].stringify({
@@ -105,7 +104,7 @@ function createCatalogRegisterAction(options) {
105
104
  return pluginScaffolderNode.createTemplateAction({
106
105
  id: id$4,
107
106
  description: "Registers entities from a catalog descriptor file in the workspace into the software catalog.",
108
- examples: examples$e,
107
+ examples: examples$f,
109
108
  schema: {
110
109
  input: {
111
110
  oneOf: [
@@ -229,7 +228,7 @@ function createCatalogRegisterAction(options) {
229
228
  });
230
229
  }
231
230
 
232
- const examples$d = [
231
+ const examples$e = [
233
232
  {
234
233
  description: "Write a catalog yaml file",
235
234
  example: yaml__namespace.stringify({
@@ -273,7 +272,7 @@ function createCatalogWriteAction() {
273
272
  )
274
273
  })
275
274
  },
276
- examples: examples$d,
275
+ examples: examples$e,
277
276
  supportsDryRun: true,
278
277
  async handler(ctx) {
279
278
  ctx.logStream.write(`Writing catalog-info.yaml`);
@@ -287,7 +286,7 @@ function createCatalogWriteAction() {
287
286
  });
288
287
  }
289
288
 
290
- const examples$c = [
289
+ const examples$d = [
291
290
  {
292
291
  description: "Fetch entity by reference",
293
292
  example: yaml__default["default"].stringify({
@@ -326,7 +325,7 @@ function createFetchCatalogEntityAction(options) {
326
325
  return pluginScaffolderNode.createTemplateAction({
327
326
  id: id$2,
328
327
  description: "Returns entity or entities from the catalog by entity reference(s)",
329
- examples: examples$c,
328
+ examples: examples$d,
330
329
  supportsDryRun: true,
331
330
  schema: {
332
331
  input: zod.z.object({
@@ -401,7 +400,7 @@ function createFetchCatalogEntityAction(options) {
401
400
  });
402
401
  }
403
402
 
404
- const examples$b = [
403
+ const examples$c = [
405
404
  {
406
405
  description: "Write a debug message",
407
406
  example: yaml__default["default"].stringify({
@@ -439,7 +438,7 @@ function createDebugLogAction() {
439
438
  return pluginScaffolderNode.createTemplateAction({
440
439
  id: id$1,
441
440
  description: "Writes a message into the log or lists all files in the workspace.",
442
- examples: examples$b,
441
+ examples: examples$c,
443
442
  schema: {
444
443
  input: {
445
444
  type: "object",
@@ -486,7 +485,7 @@ async function recursiveReadDir(dir) {
486
485
  return files.reduce((a, f) => a.concat(f), []);
487
486
  }
488
487
 
489
- const examples$a = [
488
+ const examples$b = [
490
489
  {
491
490
  description: "Waiting for 50 milliseconds",
492
491
  example: yaml__default["default"].stringify({
@@ -549,7 +548,7 @@ function createWaitAction(options) {
549
548
  return pluginScaffolderNode.createTemplateAction({
550
549
  id,
551
550
  description: "Waits for a certain period of time.",
552
- examples: examples$a,
551
+ examples: examples$b,
553
552
  schema: {
554
553
  input: {
555
554
  type: "object",
@@ -594,7 +593,7 @@ function createWaitAction(options) {
594
593
  });
595
594
  }
596
595
 
597
- const examples$9 = [
596
+ const examples$a = [
598
597
  {
599
598
  description: "Downloads content and places it in the workspace.",
600
599
  example: yaml__default["default"].stringify({
@@ -633,7 +632,7 @@ function createFetchPlainAction(options) {
633
632
  const { reader, integrations } = options;
634
633
  return pluginScaffolderNode.createTemplateAction({
635
634
  id: ACTION_ID,
636
- examples: examples$9,
635
+ examples: examples$a,
637
636
  description: "Downloads content and places it in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
638
637
  schema: {
639
638
  input: {
@@ -670,7 +669,7 @@ function createFetchPlainAction(options) {
670
669
  });
671
670
  }
672
671
 
673
- const examples$8 = [
672
+ const examples$9 = [
674
673
  {
675
674
  description: "Downloads a file and places it in the workspace.",
676
675
  example: yaml__default["default"].stringify({
@@ -694,7 +693,7 @@ function createFetchPlainFileAction(options) {
694
693
  return pluginScaffolderNode.createTemplateAction({
695
694
  id: "fetch:plain:file",
696
695
  description: "Downloads single file and places it in the workspace.",
697
- examples: examples$8,
696
+ examples: examples$9,
698
697
  schema: {
699
698
  input: {
700
699
  type: "object",
@@ -953,7 +952,7 @@ const createDefaultFilters = ({
953
952
  }) => {
954
953
  return {
955
954
  parseRepoUrl: (url) => parseRepoUrl(url, integrations),
956
- parseEntityRef: (ref) => catalogModel.parseEntityRef(ref),
955
+ parseEntityRef: (ref, context) => catalogModel.parseEntityRef(ref, context),
957
956
  pick: (obj, key) => get__default["default"](obj, key),
958
957
  projectSlug: (repoUrl) => {
959
958
  const { owner, repo } = parseRepoUrl(repoUrl, integrations);
@@ -962,7 +961,7 @@ const createDefaultFilters = ({
962
961
  };
963
962
  };
964
963
 
965
- const examples$7 = [
964
+ const examples$8 = [
966
965
  {
967
966
  description: "Downloads a skelaton directory that lives alongside the template file and fill it out with values.",
968
967
  example: yaml__default["default"].stringify({
@@ -998,7 +997,7 @@ function createFetchTemplateAction(options) {
998
997
  return pluginScaffolderNode.createTemplateAction({
999
998
  id: "fetch:template",
1000
999
  description: "Downloads a skeleton, templates variables into file and directory names and content, and places the result in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
1001
- examples: examples$7,
1000
+ examples: examples$8,
1002
1001
  schema: {
1003
1002
  input: {
1004
1003
  type: "object",
@@ -1203,7 +1202,7 @@ function containsSkippedContent(localOutputPath) {
1203
1202
  return localOutputPath === "" || localOutputPath.startsWith("/") || localOutputPath.includes("//");
1204
1203
  }
1205
1204
 
1206
- const examples$6 = [
1205
+ const examples$7 = [
1207
1206
  {
1208
1207
  description: "Delete specified files",
1209
1208
  example: yaml__namespace.stringify({
@@ -1225,7 +1224,7 @@ const createFilesystemDeleteAction = () => {
1225
1224
  return pluginScaffolderNode.createTemplateAction({
1226
1225
  id: "fs:delete",
1227
1226
  description: "Deletes files and directories from the workspace",
1228
- examples: examples$6,
1227
+ examples: examples$7,
1229
1228
  schema: {
1230
1229
  input: {
1231
1230
  required: ["files"],
@@ -1262,7 +1261,7 @@ const createFilesystemDeleteAction = () => {
1262
1261
  });
1263
1262
  };
1264
1263
 
1265
- const examples$5 = [
1264
+ const examples$6 = [
1266
1265
  {
1267
1266
  description: "Rename specified files ",
1268
1267
  example: yaml__namespace.stringify({
@@ -1288,7 +1287,7 @@ const createFilesystemRenameAction = () => {
1288
1287
  return pluginScaffolderNode.createTemplateAction({
1289
1288
  id: "fs:rename",
1290
1289
  description: "Renames files and directories within the workspace",
1291
- examples: examples$5,
1290
+ examples: examples$6,
1292
1291
  schema: {
1293
1292
  input: {
1294
1293
  required: ["files"],
@@ -1770,7 +1769,7 @@ async function validateAccessTeam(client, access) {
1770
1769
  }
1771
1770
  }
1772
1771
 
1773
- const examples$4 = [
1772
+ const examples$5 = [
1774
1773
  {
1775
1774
  description: "GitHub Action Workflow Without Inputs.",
1776
1775
  example: yaml__default["default"].stringify({
@@ -1831,7 +1830,7 @@ function createGithubActionsDispatchAction(options) {
1831
1830
  return pluginScaffolderNode.createTemplateAction({
1832
1831
  id: "github:actions:dispatch",
1833
1832
  description: "Dispatches a GitHub Action workflow for a given branch or tag",
1834
- examples: examples$4,
1833
+ examples: examples$5,
1835
1834
  schema: {
1836
1835
  input: {
1837
1836
  type: "object",
@@ -2227,7 +2226,7 @@ const commitHash = {
2227
2226
  type: "string"
2228
2227
  };
2229
2228
 
2230
- const examples$3 = [
2229
+ const examples$4 = [
2231
2230
  {
2232
2231
  description: "Creates a GitHub repository with default configuration.",
2233
2232
  example: yaml__default["default"].stringify({
@@ -2280,7 +2279,7 @@ function createGithubRepoCreateAction(options) {
2280
2279
  return pluginScaffolderNode.createTemplateAction({
2281
2280
  id: "github:repo:create",
2282
2281
  description: "Creates a GitHub repository.",
2283
- examples: examples$3,
2282
+ examples: examples$4,
2284
2283
  schema: {
2285
2284
  input: {
2286
2285
  type: "object",
@@ -2387,7 +2386,7 @@ function createGithubRepoCreateAction(options) {
2387
2386
  });
2388
2387
  }
2389
2388
 
2390
- const examples$2 = [
2389
+ const examples$3 = [
2391
2390
  {
2392
2391
  description: "Setup repo with no modifications to branch protection rules",
2393
2392
  example: yaml__default["default"].stringify({
@@ -2439,7 +2438,7 @@ function createGithubRepoPushAction(options) {
2439
2438
  return pluginScaffolderNode.createTemplateAction({
2440
2439
  id: "github:repo:push",
2441
2440
  description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
2442
- examples: examples$2,
2441
+ examples: examples$3,
2443
2442
  schema: {
2444
2443
  input: {
2445
2444
  type: "object",
@@ -3058,6 +3057,175 @@ function createPublishAzureAction(options) {
3058
3057
  });
3059
3058
  }
3060
3059
 
3060
+ const examples$2 = [
3061
+ {
3062
+ description: "Initializes a git repository of contents in workspace and publish it to Bitbucket with default configuration.",
3063
+ example: yaml__default["default"].stringify({
3064
+ steps: [
3065
+ {
3066
+ id: "publish",
3067
+ action: "publish:bitbucket",
3068
+ name: "Publish to Bitbucket",
3069
+ input: {
3070
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project"
3071
+ }
3072
+ }
3073
+ ]
3074
+ })
3075
+ },
3076
+ {
3077
+ description: "Add a description.",
3078
+ example: yaml__default["default"].stringify({
3079
+ steps: [
3080
+ {
3081
+ id: "publish",
3082
+ action: "publish:bitbucket",
3083
+ name: "Publish to Bitbucket",
3084
+ input: {
3085
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3086
+ description: "Initialize a git repository"
3087
+ }
3088
+ }
3089
+ ]
3090
+ })
3091
+ },
3092
+ {
3093
+ description: "Change visibility of the repository.",
3094
+ example: yaml__default["default"].stringify({
3095
+ steps: [
3096
+ {
3097
+ id: "publish",
3098
+ action: "publish:bitbucket",
3099
+ name: "Publish to Bitbucket",
3100
+ input: {
3101
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3102
+ description: "Initialize a git repository",
3103
+ repoVisibility: "public"
3104
+ }
3105
+ }
3106
+ ]
3107
+ })
3108
+ },
3109
+ {
3110
+ description: "Set the default branch.",
3111
+ example: yaml__default["default"].stringify({
3112
+ steps: [
3113
+ {
3114
+ id: "publish",
3115
+ action: "publish:bitbucket",
3116
+ name: "Publish to Bitbucket",
3117
+ input: {
3118
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3119
+ description: "Initialize a git repository",
3120
+ repoVisibility: "public",
3121
+ defaultBranch: "main"
3122
+ }
3123
+ }
3124
+ ]
3125
+ })
3126
+ },
3127
+ {
3128
+ description: "Specify a source path within the workspace.",
3129
+ example: yaml__default["default"].stringify({
3130
+ steps: [
3131
+ {
3132
+ id: "publish",
3133
+ action: "publish:bitbucket",
3134
+ name: "Publish to Bitbucket",
3135
+ input: {
3136
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3137
+ description: "Initialize a git repository",
3138
+ repoVisibility: "public",
3139
+ defaultBranch: "main",
3140
+ sourcePath: "./repoRoot"
3141
+ }
3142
+ }
3143
+ ]
3144
+ })
3145
+ },
3146
+ {
3147
+ description: "Enable LFS for the repository.",
3148
+ example: yaml__default["default"].stringify({
3149
+ steps: [
3150
+ {
3151
+ id: "publish",
3152
+ action: "publish:bitbucket",
3153
+ name: "Publish to Bitbucket",
3154
+ input: {
3155
+ repoUrl: "hosted.bitbucket.com?project=project&repo=repo",
3156
+ description: "Initialize a git repository",
3157
+ repoVisibility: "public",
3158
+ defaultBranch: "main",
3159
+ sourcePath: "./repoRoot",
3160
+ enableLFS: true
3161
+ }
3162
+ }
3163
+ ]
3164
+ })
3165
+ },
3166
+ {
3167
+ description: "Provide an authentication token for Bitbucket.",
3168
+ example: yaml__default["default"].stringify({
3169
+ steps: [
3170
+ {
3171
+ id: "publish",
3172
+ action: "publish:bitbucket",
3173
+ name: "Publish to Bitbucket",
3174
+ input: {
3175
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3176
+ description: "Initialize a git repository",
3177
+ repoVisibility: "public",
3178
+ defaultBranch: "main",
3179
+ token: "your-auth-token"
3180
+ }
3181
+ }
3182
+ ]
3183
+ })
3184
+ },
3185
+ {
3186
+ description: "Set a custom commit message.",
3187
+ example: yaml__default["default"].stringify({
3188
+ steps: [
3189
+ {
3190
+ id: "publish",
3191
+ action: "publish:bitbucket",
3192
+ name: "Publish to Bitbucket",
3193
+ input: {
3194
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3195
+ description: "Initialize a git repository",
3196
+ repoVisibility: "public",
3197
+ defaultBranch: "main",
3198
+ token: "your-auth-token",
3199
+ gitCommitMessage: "Initial commit with custom message"
3200
+ }
3201
+ }
3202
+ ]
3203
+ })
3204
+ },
3205
+ {
3206
+ description: "Set a custom author name and email for the commit.",
3207
+ example: yaml__default["default"].stringify({
3208
+ steps: [
3209
+ {
3210
+ id: "publish",
3211
+ action: "publish:bitbucket",
3212
+ name: "Publish to Bitbucket",
3213
+ input: {
3214
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3215
+ description: "Initialize a git repository",
3216
+ repoVisibility: "public",
3217
+ defaultBranch: "main",
3218
+ token: "your-auth-token",
3219
+ gitCommitMessage: "Initial commit with custom message",
3220
+ gitAuthorName: "Your Name",
3221
+ gitAuthorEmail: "your.email@example.com"
3222
+ }
3223
+ }
3224
+ ]
3225
+ })
3226
+ }
3227
+ ];
3228
+
3061
3229
  const createBitbucketCloudRepository = async (opts) => {
3062
3230
  const {
3063
3231
  workspace,
@@ -3185,6 +3353,7 @@ function createPublishBitbucketAction(options) {
3185
3353
  return pluginScaffolderNode.createTemplateAction({
3186
3354
  id: "publish:bitbucket",
3187
3355
  description: "Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.",
3356
+ examples: examples$2,
3188
3357
  schema: {
3189
3358
  input: {
3190
3359
  type: "object",
@@ -5284,15 +5453,15 @@ const createBuiltinActions = (options) => {
5284
5453
  return actions;
5285
5454
  };
5286
5455
 
5287
- var __defProp$5 = Object.defineProperty;
5288
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5289
- var __publicField$5 = (obj, key, value) => {
5290
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
5456
+ var __defProp$4 = Object.defineProperty;
5457
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5458
+ var __publicField$4 = (obj, key, value) => {
5459
+ __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
5291
5460
  return value;
5292
5461
  };
5293
5462
  class TemplateActionRegistry {
5294
5463
  constructor() {
5295
- __publicField$5(this, "actions", /* @__PURE__ */ new Map());
5464
+ __publicField$4(this, "actions", /* @__PURE__ */ new Map());
5296
5465
  }
5297
5466
  register(action) {
5298
5467
  if (this.actions.has(action.id)) {
@@ -5316,10 +5485,10 @@ class TemplateActionRegistry {
5316
5485
  }
5317
5486
  }
5318
5487
 
5319
- var __defProp$4 = Object.defineProperty;
5320
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5321
- var __publicField$4 = (obj, key, value) => {
5322
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
5488
+ var __defProp$3 = Object.defineProperty;
5489
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5490
+ var __publicField$3 = (obj, key, value) => {
5491
+ __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
5323
5492
  return value;
5324
5493
  };
5325
5494
  const migrationsDir = backendCommon.resolvePackagePath(
@@ -5331,13 +5500,19 @@ function isPluginDatabaseManager(opt) {
5331
5500
  }
5332
5501
  const parseSqlDateToIsoString = (input) => {
5333
5502
  if (typeof input === "string") {
5334
- return luxon.DateTime.fromSQL(input, { zone: "UTC" }).toISO();
5503
+ const parsed = luxon.DateTime.fromSQL(input, { zone: "UTC" });
5504
+ if (!parsed.isValid) {
5505
+ throw new Error(
5506
+ `Failed to parse database timestamp '${input}', ${parsed.invalidReason}: ${parsed.invalidExplanation}`
5507
+ );
5508
+ }
5509
+ return parsed.toISO();
5335
5510
  }
5336
5511
  return input;
5337
5512
  };
5338
5513
  class DatabaseTaskStore {
5339
5514
  constructor(client) {
5340
- __publicField$4(this, "db");
5515
+ __publicField$3(this, "db");
5341
5516
  this.db = client;
5342
5517
  }
5343
5518
  static async create(options) {
@@ -5611,10 +5786,10 @@ class DatabaseTaskStore {
5611
5786
  }
5612
5787
  }
5613
5788
 
5614
- var __defProp$3 = Object.defineProperty;
5615
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5616
- var __publicField$3 = (obj, key, value) => {
5617
- __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
5789
+ var __defProp$2 = Object.defineProperty;
5790
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5791
+ var __publicField$2 = (obj, key, value) => {
5792
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
5618
5793
  return value;
5619
5794
  };
5620
5795
  class TaskManager {
@@ -5624,8 +5799,8 @@ class TaskManager {
5624
5799
  this.storage = storage;
5625
5800
  this.signal = signal;
5626
5801
  this.logger = logger;
5627
- __publicField$3(this, "isDone", false);
5628
- __publicField$3(this, "heartbeatTimeoutId");
5802
+ __publicField$2(this, "isDone", false);
5803
+ __publicField$2(this, "heartbeatTimeoutId");
5629
5804
  }
5630
5805
  static create(task, storage, abortSignal, logger) {
5631
5806
  const agent = new TaskManager(task, storage, abortSignal, logger);
@@ -5697,7 +5872,7 @@ class StorageTaskBroker {
5697
5872
  constructor(storage, logger) {
5698
5873
  this.storage = storage;
5699
5874
  this.logger = logger;
5700
- __publicField$3(this, "deferredDispatch", defer());
5875
+ __publicField$2(this, "deferredDispatch", defer());
5701
5876
  }
5702
5877
  async list(options) {
5703
5878
  if (!this.storage.list) {
@@ -5966,10 +6141,10 @@ const scaffolderActionRules = {
5966
6141
  hasStringProperty
5967
6142
  };
5968
6143
 
5969
- var __defProp$2 = Object.defineProperty;
5970
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5971
- var __publicField$2 = (obj, key, value) => {
5972
- __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
6144
+ var __defProp$1 = Object.defineProperty;
6145
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6146
+ var __publicField$1 = (obj, key, value) => {
6147
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
5973
6148
  return value;
5974
6149
  };
5975
6150
  const isValidTaskSpec = (taskSpec) => {
@@ -6004,8 +6179,8 @@ const isActionAuthorized = pluginPermissionNode.createConditionAuthorizer(
6004
6179
  class NunjucksWorkflowRunner {
6005
6180
  constructor(options) {
6006
6181
  this.options = options;
6007
- __publicField$2(this, "defaultTemplateFilters");
6008
- __publicField$2(this, "tracker", scaffoldingTracker());
6182
+ __publicField$1(this, "defaultTemplateFilters");
6183
+ __publicField$1(this, "tracker", scaffoldingTracker());
6009
6184
  this.defaultTemplateFilters = createDefaultFilters({
6010
6185
  integrations: this.options.integrations
6011
6186
  });
@@ -6386,16 +6561,16 @@ function scaffoldingTracker() {
6386
6561
  };
6387
6562
  }
6388
6563
 
6389
- var __defProp$1 = Object.defineProperty;
6390
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6391
- var __publicField$1 = (obj, key, value) => {
6392
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
6564
+ var __defProp = Object.defineProperty;
6565
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6566
+ var __publicField = (obj, key, value) => {
6567
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6393
6568
  return value;
6394
6569
  };
6395
6570
  class TaskWorker {
6396
6571
  constructor(options) {
6397
6572
  this.options = options;
6398
- __publicField$1(this, "taskQueue");
6573
+ __publicField(this, "taskQueue");
6399
6574
  this.taskQueue = new PQueue__default["default"]({
6400
6575
  concurrency: options.concurrentTasksLimit
6401
6576
  });
@@ -7065,67 +7240,7 @@ data: ${JSON.stringify(event)}
7065
7240
  return app;
7066
7241
  }
7067
7242
 
7068
- var __defProp = Object.defineProperty;
7069
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7070
- var __publicField = (obj, key, value) => {
7071
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7072
- return value;
7073
- };
7074
- class ScaffolderEntitiesProcessor {
7075
- constructor() {
7076
- __publicField(this, "validators", [pluginScaffolderCommon.templateEntityV1beta3Validator]);
7077
- }
7078
- getProcessorName() {
7079
- return "ScaffolderEntitiesProcessor";
7080
- }
7081
- async validateEntityKind(entity) {
7082
- for (const validator of this.validators) {
7083
- if (await validator.check(entity)) {
7084
- return true;
7085
- }
7086
- }
7087
- return false;
7088
- }
7089
- async postProcessEntity(entity, _location, emit) {
7090
- const selfRef = catalogModel.getCompoundEntityRef(entity);
7091
- if (entity.apiVersion === "scaffolder.backstage.io/v1beta3" && entity.kind === "Template") {
7092
- const template = entity;
7093
- const target = template.spec.owner;
7094
- if (target) {
7095
- const targetRef = catalogModel.parseEntityRef(target, {
7096
- defaultKind: "Group",
7097
- defaultNamespace: selfRef.namespace
7098
- });
7099
- emit(
7100
- pluginCatalogNode.processingResult.relation({
7101
- source: selfRef,
7102
- type: catalogModel.RELATION_OWNED_BY,
7103
- target: {
7104
- kind: targetRef.kind,
7105
- namespace: targetRef.namespace,
7106
- name: targetRef.name
7107
- }
7108
- })
7109
- );
7110
- emit(
7111
- pluginCatalogNode.processingResult.relation({
7112
- source: {
7113
- kind: targetRef.kind,
7114
- namespace: targetRef.namespace,
7115
- name: targetRef.name
7116
- },
7117
- type: catalogModel.RELATION_OWNER_OF,
7118
- target: selfRef
7119
- })
7120
- );
7121
- }
7122
- }
7123
- return entity;
7124
- }
7125
- }
7126
-
7127
7243
  exports.DatabaseTaskStore = DatabaseTaskStore;
7128
- exports.ScaffolderEntitiesProcessor = ScaffolderEntitiesProcessor;
7129
7244
  exports.TaskManager = TaskManager;
7130
7245
  exports.TaskWorker = TaskWorker;
7131
7246
  exports.TemplateActionRegistry = TemplateActionRegistry;
@@ -7161,4 +7276,4 @@ exports.createRouter = createRouter;
7161
7276
  exports.createWaitAction = createWaitAction;
7162
7277
  exports.scaffolderActionRules = scaffolderActionRules;
7163
7278
  exports.scaffolderTemplateRules = scaffolderTemplateRules;
7164
- //# sourceMappingURL=ScaffolderEntitiesProcessor-96675669.cjs.js.map
7279
+ //# sourceMappingURL=router-129b368d.cjs.js.map