@backstage/cli-module-actions 0.1.4-next.0 → 0.1.4

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,14 @@
1
1
  # @backstage/cli-module-actions
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - d73df15: The `actions list` command now returns partial results when some plugin sources fail, instead of failing entirely. Failed sources are reported as warnings.
8
+ - Updated dependencies
9
+ - @backstage/cli-node@0.3.5
10
+ - @backstage/errors@1.3.2
11
+
3
12
  ## 0.1.4-next.0
4
13
 
5
14
  ### Patch Changes
@@ -3,10 +3,15 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var cleye = require('cleye');
6
+ var chalk = require('chalk');
6
7
  var ActionsClient = require('../lib/ActionsClient.cjs.js');
7
8
  var resolveAuth = require('../lib/resolveAuth.cjs.js');
8
9
  var format = require('../lib/format.cjs.js');
9
10
 
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
13
+ var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
14
+
10
15
  var list = async ({ args, info }) => {
11
16
  const {
12
17
  flags: { instance: instanceFlag }
@@ -33,14 +38,33 @@ var list = async ({ args, info }) => {
33
38
  return;
34
39
  }
35
40
  const client = new ActionsClient.ActionsClient(baseUrl, accessToken);
36
- const grouped = await client.list(pluginSources);
41
+ const { grouped, failed } = await client.list(pluginSources);
37
42
  const hasActions = grouped.some((g) => g.actions.length > 0);
43
+ if (grouped.length === 0 && failed.length > 0) {
44
+ for (const { pluginId, message } of failed) {
45
+ process.stderr.write(
46
+ chalk__default.default.yellow(`Warning: source '${pluginId}' failed \u2014 ${message}
47
+ `)
48
+ );
49
+ }
50
+ process.exitCode = 1;
51
+ return;
52
+ }
38
53
  if (!hasActions) {
39
54
  process.stderr.write("No actions found.\n");
40
- return;
41
55
  }
42
- process.stdout.write(`${format.formatActionList(grouped)}
56
+ if (hasActions) {
57
+ process.stdout.write(`${format.formatActionList(grouped)}
43
58
  `);
59
+ }
60
+ for (const { pluginId, message } of failed) {
61
+ process.stderr.write(
62
+ chalk__default.default.yellow(
63
+ `Warning: source '${pluginId}' returned an error \u2014 skipped (${message})
64
+ `
65
+ )
66
+ );
67
+ }
44
68
  };
45
69
 
46
70
  exports.default = list;
@@ -1 +1 @@
1
- {"version":3,"file":"list.cjs.js","sources":["../../src/commands/list.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { cli } from 'cleye';\nimport type { CliCommandContext } from '@backstage/cli-node';\nimport { ActionsClient } from '../lib/ActionsClient';\nimport { resolveAuth } from '../lib/resolveAuth';\nimport { formatActionList } from '../lib/format';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { instance: instanceFlag },\n } = cli(\n {\n name: info.usage,\n flags: {\n instance: {\n type: String,\n description: 'Name of the instance to use',\n },\n },\n },\n undefined,\n args,\n );\n\n const { accessToken, pluginSources, baseUrl } = await resolveAuth(\n instanceFlag,\n );\n\n if (!pluginSources.length) {\n process.stderr.write(\n 'No plugin sources configured. Run \"actions sources add <plugin-id>\" to add one.\\n',\n );\n return;\n }\n\n const client = new ActionsClient(baseUrl, accessToken);\n const grouped = await client.list(pluginSources);\n\n const hasActions = grouped.some(g => g.actions.length > 0);\n if (!hasActions) {\n process.stderr.write('No actions found.\\n');\n return;\n }\n\n process.stdout.write(`${formatActionList(grouped)}\\n`);\n};\n"],"names":["cli","resolveAuth","ActionsClient","formatActionList"],"mappings":";;;;;;;;;AAsBA,WAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,EAAE,QAAA,EAAU,YAAA;AAAa,GAClC,GAAIA,SAAA;AAAA,IACF;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,KAAA,EAAO;AAAA,QACL,QAAA,EAAU;AAAA,UACR,IAAA,EAAM,MAAA;AAAA,UACN,WAAA,EAAa;AAAA;AACf;AACF,KACF;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,WAAA,EAAa,aAAA,EAAe,OAAA,KAAY,MAAMC,uBAAA;AAAA,IACpD;AAAA,GACF;AAEA,EAAA,IAAI,CAAC,cAAc,MAAA,EAAQ;AACzB,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb;AAAA,KACF;AACA,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,MAAA,GAAS,IAAIC,2BAAA,CAAc,OAAA,EAAS,WAAW,CAAA;AACrD,EAAA,MAAM,OAAA,GAAU,MAAM,MAAA,CAAO,IAAA,CAAK,aAAa,CAAA;AAE/C,EAAA,MAAM,aAAa,OAAA,CAAQ,IAAA,CAAK,OAAK,CAAA,CAAE,OAAA,CAAQ,SAAS,CAAC,CAAA;AACzD,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,qBAAqB,CAAA;AAC1C,IAAA;AAAA,EACF;AAEA,EAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,EAAGC,uBAAA,CAAiB,OAAO,CAAC;AAAA,CAAI,CAAA;AACvD,CAAA;;"}
1
+ {"version":3,"file":"list.cjs.js","sources":["../../src/commands/list.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { cli } from 'cleye';\nimport chalk from 'chalk';\nimport type { CliCommandContext } from '@backstage/cli-node';\nimport { ActionsClient } from '../lib/ActionsClient';\nimport { resolveAuth } from '../lib/resolveAuth';\nimport { formatActionList } from '../lib/format';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { instance: instanceFlag },\n } = cli(\n {\n name: info.usage,\n flags: {\n instance: {\n type: String,\n description: 'Name of the instance to use',\n },\n },\n },\n undefined,\n args,\n );\n\n const { accessToken, pluginSources, baseUrl } = await resolveAuth(\n instanceFlag,\n );\n\n if (!pluginSources.length) {\n process.stderr.write(\n 'No plugin sources configured. Run \"actions sources add <plugin-id>\" to add one.\\n',\n );\n return;\n }\n\n const client = new ActionsClient(baseUrl, accessToken);\n const { grouped, failed } = await client.list(pluginSources);\n\n const hasActions = grouped.some(g => g.actions.length > 0);\n\n if (grouped.length === 0 && failed.length > 0) {\n for (const { pluginId, message } of failed) {\n process.stderr.write(\n chalk.yellow(`Warning: source '${pluginId}' failed — ${message}\\n`),\n );\n }\n process.exitCode = 1;\n return;\n }\n\n if (!hasActions) {\n process.stderr.write('No actions found.\\n');\n }\n\n if (hasActions) {\n process.stdout.write(`${formatActionList(grouped)}\\n`);\n }\n\n for (const { pluginId, message } of failed) {\n process.stderr.write(\n chalk.yellow(\n `Warning: source '${pluginId}' returned an error — skipped (${message})\\n`,\n ),\n );\n }\n};\n"],"names":["cli","resolveAuth","ActionsClient","chalk","formatActionList"],"mappings":";;;;;;;;;;;;;;AAuBA,WAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM;AAAA,IACJ,KAAA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5C;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,EAAGC,uBAAA,CAAiB,OAAO,CAAC;AAAA,CAAI,CAAA;AAAA,EACvD;AAEA,EAAA,KAAA,MAAW,EAAE,QAAA,EAAU,OAAA,EAAQ,IAAK,MAAA,EAAQ;AAC1C,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACbD,sBAAA,CAAM,MAAA;AAAA,QACJ,CAAA,iBAAA,EAAoB,QAAQ,CAAA,oCAAA,EAAkC,OAAO,CAAA;AAAA;AAAA;AACvE,KACF;AAAA,EACF;AACF,CAAA;;"}
@@ -25,7 +25,7 @@ class ActionsClient {
25
25
  baseUrl;
26
26
  accessToken;
27
27
  async list(pluginSources) {
28
- return Promise.all(
28
+ const results = await Promise.allSettled(
29
29
  pluginSources.map(async (pluginId) => {
30
30
  const url = pluginActionsUrl(this.baseUrl, pluginId);
31
31
  const response = await httpJson.httpJson(url, {
@@ -35,10 +35,27 @@ class ActionsClient {
35
35
  return { pluginId, actions: response.actions };
36
36
  })
37
37
  );
38
+ const grouped = [];
39
+ const failed = [];
40
+ for (let i = 0; i < results.length; i++) {
41
+ const result = results[i];
42
+ if (result.status === "fulfilled") {
43
+ grouped.push(result.value);
44
+ } else {
45
+ failed.push({
46
+ pluginId: pluginSources[i],
47
+ message: result.reason?.message ?? String(result.reason)
48
+ });
49
+ }
50
+ }
51
+ return { grouped, failed };
38
52
  }
39
53
  async listForPlugin(actionId) {
40
54
  const pluginId = extractPluginId(actionId);
41
- const grouped = await this.list([pluginId]);
55
+ const { grouped, failed } = await this.list([pluginId]);
56
+ if (failed[0]) {
57
+ throw new Error(failed[0].message);
58
+ }
42
59
  return grouped.flatMap((g) => g.actions);
43
60
  }
44
61
  async execute(actionId, input) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsClient.cjs.js","sources":["../../src/lib/ActionsClient.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { httpJson } from './httpJson';\n\nexport type ActionDef = {\n id: string;\n name: string;\n title?: string;\n description?: string;\n schema: {\n input: object;\n output: object;\n };\n};\n\ntype ListActionsResponse = {\n actions: ActionDef[];\n};\n\ntype InvokeResponse = {\n output: unknown;\n};\n\nfunction extractPluginId(actionId: string): string {\n const colonIndex = actionId.indexOf(':');\n if (colonIndex === -1) {\n throw new Error(\n `Invalid action ID \"${actionId}\". Expected format \"pluginId:actionName\".`,\n );\n }\n return actionId.substring(0, colonIndex);\n}\n\nfunction pluginActionsUrl(baseUrl: string, pluginId: string): string {\n return new URL(\n `/api/${encodeURIComponent(pluginId)}/.backstage/actions/v1/actions`,\n baseUrl,\n ).toString();\n}\n\nexport type GroupedActions = { pluginId: string; actions: ActionDef[] }[];\n\nexport class ActionsClient {\n constructor(\n private readonly baseUrl: string,\n private readonly accessToken: string,\n ) {}\n\n async list(pluginSources: string[]): Promise<GroupedActions> {\n return Promise.all(\n pluginSources.map(async pluginId => {\n const url = pluginActionsUrl(this.baseUrl, pluginId);\n const response = await httpJson<ListActionsResponse>(url, {\n headers: { Authorization: `Bearer ${this.accessToken}` },\n signal: AbortSignal.timeout(30_000),\n });\n return { pluginId, actions: response.actions };\n }),\n );\n }\n\n async listForPlugin(actionId: string): Promise<ActionDef[]> {\n const pluginId = extractPluginId(actionId);\n const grouped = await this.list([pluginId]);\n return grouped.flatMap(g => g.actions);\n }\n\n async execute(actionId: string, input?: unknown): Promise<unknown> {\n const pluginId = extractPluginId(actionId);\n const url = `${pluginActionsUrl(\n this.baseUrl,\n pluginId,\n )}/${encodeURIComponent(actionId)}/invoke`;\n\n const response = await httpJson<InvokeResponse>(url, {\n method: 'POST',\n headers: { Authorization: `Bearer ${this.accessToken}` },\n body: input ?? {},\n signal: AbortSignal.timeout(30_000),\n });\n\n return response.output;\n }\n}\n"],"names":["httpJson"],"mappings":";;;;AAqCA,SAAS,gBAAgB,QAAA,EAA0B;AACjD,EAAA,MAAM,UAAA,GAAa,QAAA,CAAS,OAAA,CAAQ,GAAG,CAAA;AACvC,EAAA,IAAI,eAAe,EAAA,EAAI;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sBAAsB,QAAQ,CAAA,yCAAA;AAAA,KAChC;AAAA,EACF;AACA,EAAA,OAAO,QAAA,CAAS,SAAA,CAAU,CAAA,EAAG,UAAU,CAAA;AACzC;AAEA,SAAS,gBAAA,CAAiB,SAAiB,QAAA,EAA0B;AACnE,EAAA,OAAO,IAAI,GAAA;AAAA,IACT,CAAA,KAAA,EAAQ,kBAAA,CAAmB,QAAQ,CAAC,CAAA,8BAAA,CAAA;AAAA,IACpC;AAAA,IACA,QAAA,EAAS;AACb;AAIO,MAAM,aAAA,CAAc;AAAA,EACzB,WAAA,CACmB,SACA,WAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAAA,EAChB;AAAA,EAFgB,OAAA;AAAA,EACA,WAAA;AAAA,EAGnB,MAAM,KAAK,aAAA,EAAkD;AAC3D,IAAA,OAAO,OAAA,CAAQ,GAAA;AAAA,MACb,aAAA,CAAc,GAAA,CAAI,OAAM,QAAA,KAAY;AAClC,QAAA,MAAM,GAAA,GAAM,gBAAA,CAAiB,IAAA,CAAK,OAAA,EAAS,QAAQ,CAAA;AACnD,QAAA,MAAM,QAAA,GAAW,MAAMA,iBAAA,CAA8B,GAAA,EAAK;AAAA,UACxD,SAAS,EAAE,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,WAAW,CAAA,CAAA,EAAG;AAAA,UACvD,MAAA,EAAQ,WAAA,CAAY,OAAA,CAAQ,GAAM;AAAA,SACnC,CAAA;AACD,QAAA,OAAO,EAAE,QAAA,EAAU,OAAA,EAAS,QAAA,CAAS,OAAA,EAAQ;AAAA,MAC/C,CAAC;AAAA,KACH;AAAA,EACF;AAAA,EAEA,MAAM,cAAc,QAAA,EAAwC;AAC1D,IAAA,MAAM,QAAA,GAAW,gBAAgB,QAAQ,CAAA;AACzC,IAAA,MAAM,UAAU,MAAM,IAAA,CAAK,IAAA,CAAK,CAAC,QAAQ,CAAC,CAAA;AAC1C,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,CAAA;AAAA,EACvC;AAAA,EAEA,MAAM,OAAA,CAAQ,QAAA,EAAkB,KAAA,EAAmC;AACjE,IAAA,MAAM,QAAA,GAAW,gBAAgB,QAAQ,CAAA;AACzC,IAAA,MAAM,MAAM,CAAA,EAAG,gBAAA;AAAA,MACb,IAAA,CAAK,OAAA;AAAA,MACL;AAAA,KACD,CAAA,CAAA,EAAI,kBAAA,CAAmB,QAAQ,CAAC,CAAA,OAAA,CAAA;AAEjC,IAAA,MAAM,QAAA,GAAW,MAAMA,iBAAA,CAAyB,GAAA,EAAK;AAAA,MACnD,MAAA,EAAQ,MAAA;AAAA,MACR,SAAS,EAAE,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,WAAW,CAAA,CAAA,EAAG;AAAA,MACvD,IAAA,EAAM,SAAS,EAAC;AAAA,MAChB,MAAA,EAAQ,WAAA,CAAY,OAAA,CAAQ,GAAM;AAAA,KACnC,CAAA;AAED,IAAA,OAAO,QAAA,CAAS,MAAA;AAAA,EAClB;AACF;;"}
1
+ {"version":3,"file":"ActionsClient.cjs.js","sources":["../../src/lib/ActionsClient.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { httpJson } from './httpJson';\n\nexport type ActionDef = {\n id: string;\n name: string;\n title?: string;\n description?: string;\n schema: {\n input: object;\n output: object;\n };\n};\n\ntype ListActionsResponse = {\n actions: ActionDef[];\n};\n\ntype InvokeResponse = {\n output: unknown;\n};\n\nfunction extractPluginId(actionId: string): string {\n const colonIndex = actionId.indexOf(':');\n if (colonIndex === -1) {\n throw new Error(\n `Invalid action ID \"${actionId}\". Expected format \"pluginId:actionName\".`,\n );\n }\n return actionId.substring(0, colonIndex);\n}\n\nfunction pluginActionsUrl(baseUrl: string, pluginId: string): string {\n return new URL(\n `/api/${encodeURIComponent(pluginId)}/.backstage/actions/v1/actions`,\n baseUrl,\n ).toString();\n}\n\nexport type GroupedActions = { pluginId: string; actions: ActionDef[] }[];\n\nexport type FailedSource = { pluginId: string; message: string };\n\nexport type ListResult = {\n grouped: GroupedActions;\n failed: FailedSource[];\n};\n\nexport class ActionsClient {\n constructor(\n private readonly baseUrl: string,\n private readonly accessToken: string,\n ) {}\n\n async list(pluginSources: string[]): Promise<ListResult> {\n const results = await Promise.allSettled(\n pluginSources.map(async pluginId => {\n const url = pluginActionsUrl(this.baseUrl, pluginId);\n const response = await httpJson<ListActionsResponse>(url, {\n headers: { Authorization: `Bearer ${this.accessToken}` },\n signal: AbortSignal.timeout(30_000),\n });\n return { pluginId, actions: response.actions };\n }),\n );\n\n const grouped: GroupedActions = [];\n const failed: FailedSource[] = [];\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (result.status === 'fulfilled') {\n grouped.push(result.value);\n } else {\n failed.push({\n pluginId: pluginSources[i],\n message: result.reason?.message ?? String(result.reason),\n });\n }\n }\n\n return { grouped, failed };\n }\n\n async listForPlugin(actionId: string): Promise<ActionDef[]> {\n const pluginId = extractPluginId(actionId);\n const { grouped, failed } = await this.list([pluginId]);\n if (failed[0]) {\n throw new Error(failed[0].message);\n }\n return grouped.flatMap(g => g.actions);\n }\n\n async execute(actionId: string, input?: unknown): Promise<unknown> {\n const pluginId = extractPluginId(actionId);\n const url = `${pluginActionsUrl(\n this.baseUrl,\n pluginId,\n )}/${encodeURIComponent(actionId)}/invoke`;\n\n const response = await httpJson<InvokeResponse>(url, {\n method: 'POST',\n headers: { Authorization: `Bearer ${this.accessToken}` },\n body: input ?? {},\n signal: AbortSignal.timeout(30_000),\n });\n\n return response.output;\n }\n}\n"],"names":["httpJson"],"mappings":";;;;AAqCA,SAAS,gBAAgB,QAAA,EAA0B;AACjD,EAAA,MAAM,UAAA,GAAa,QAAA,CAAS,OAAA,CAAQ,GAAG,CAAA;AACvC,EAAA,IAAI,eAAe,EAAA,EAAI;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sBAAsB,QAAQ,CAAA,yCAAA;AAAA,KAChC;AAAA,EACF;AACA,EAAA,OAAO,QAAA,CAAS,SAAA,CAAU,CAAA,EAAG,UAAU,CAAA;AACzC;AAEA,SAAS,gBAAA,CAAiB,SAAiB,QAAA,EAA0B;AACnE,EAAA,OAAO,IAAI,GAAA;AAAA,IACT,CAAA,KAAA,EAAQ,kBAAA,CAAmB,QAAQ,CAAC,CAAA,8BAAA,CAAA;AAAA,IACpC;AAAA,IACA,QAAA,EAAS;AACb;AAWO,MAAM,aAAA,CAAc;AAAA,EACzB,WAAA,CACmB,SACA,WAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAAA,EAChB;AAAA,EAFgB,OAAA;AAAA,EACA,WAAA;AAAA,EAGnB,MAAM,KAAK,aAAA,EAA8C;AACvD,IAAA,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O,GAAI,MAAM,IAAA,CAAK,IAAA,CAAK,CAAC,QAAQ,CAAC,CAAA;AACtD,IAAA,IAAI,MAAA,CAAO,CAAC,CAAA,EAAG;AACb,MAAA,MAAM,IAAI,KAAA,CAAM,MAAA,CAAO,CAAC,EAAE,OAAO,CAAA;AAAA,IACnC;AACA,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,CAAA;AAAA,EACvC;AAAA,EAEA,MAAM,OAAA,CAAQ,QAAA,EAAkB,KAAA,EAAmC;AACjE,IAAA,MAAM,QAAA,GAAW,gBAAgB,QAAQ,CAAA;AACzC,IAAA,MAAM,MAAM,CAAA,EAAG,gBAAA;AAAA,MACb,IAAA,CAAK,OAAA;AAAA,MACL;AAAA,KACD,CAAA,CAAA,EAAI,kBAAA,CAAmB,QAAQ,CAAC,CAAA,OAAA,CAAA;AAEjC,IAAA,MAAM,QAAA,GAAW,MAAMA,iBAAA,CAAyB,GAAA,EAAK;AAAA,MACnD,MAAA,EAAQ,MAAA;AAAA,MACR,SAAS,EAAE,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,WAAW,CAAA,CAAA,EAAG;AAAA,MACvD,IAAA,EAAM,SAAS,EAAC;AAAA,MAChB,MAAA,EAAQ,WAAA,CAAY,OAAA,CAAQ,GAAM;AAAA,KACnC,CAAA;AAED,IAAA,OAAO,QAAA,CAAS,MAAA;AAAA,EAClB;AACF;;"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var name = "@backstage/cli-module-actions";
6
- var version = "0.1.4-next.0";
6
+ var version = "0.1.4";
7
7
  var description = "CLI module for executing distributed actions";
8
8
  var backstage = {
9
9
  role: "cli-module"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/cli-module-actions",
3
- "version": "0.1.4-next.0",
3
+ "version": "0.1.4",
4
4
  "description": "CLI module for executing distributed actions",
5
5
  "backstage": {
6
6
  "role": "cli-module"
@@ -33,8 +33,8 @@
33
33
  "test": "backstage-cli package test"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/cli-node": "0.3.5-next.0",
37
- "@backstage/errors": "1.3.2-next.0",
36
+ "@backstage/cli-node": "^0.3.5",
37
+ "@backstage/errors": "^1.3.2",
38
38
  "chalk": "^4.0.0",
39
39
  "cleye": "^2.6.0",
40
40
  "marked": "^15.0.12",
@@ -43,8 +43,8 @@
43
43
  "zod": "^3.25.76 || ^4.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/backend-test-utils": "1.11.8-next.0",
47
- "@backstage/cli": "0.36.7-next.0"
46
+ "@backstage/backend-test-utils": "^1.11.8",
47
+ "@backstage/cli": "^0.36.7"
48
48
  },
49
49
  "typesVersions": {
50
50
  "*": {