@backstage/cli-module-actions 0.1.3 → 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 +17 -0
- package/dist/commands/execute.cjs.js.map +1 -1
- package/dist/commands/list.cjs.js +27 -3
- package/dist/commands/list.cjs.js.map +1 -1
- package/dist/commands/sourcesAdd.cjs.js.map +1 -1
- package/dist/commands/sourcesList.cjs.js.map +1 -1
- package/dist/commands/sourcesRemove.cjs.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/lib/ActionsClient.cjs.js +21 -2
- package/dist/lib/ActionsClient.cjs.js.map +1 -1
- package/dist/lib/format.cjs.js.map +1 -1
- package/dist/lib/httpJson.cjs.js.map +1 -1
- package/dist/lib/pluginSources.cjs.js.map +1 -1
- package/dist/lib/resolveAuth.cjs.js.map +1 -1
- package/dist/lib/schemaToFlags.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/dist/package.json.cjs.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
|
|
12
|
+
## 0.1.4-next.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/cli-node@0.3.5-next.0
|
|
18
|
+
- @backstage/errors@1.3.2-next.0
|
|
19
|
+
|
|
3
20
|
## 0.1.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.cjs.js","sources":["../../src/commands/execute.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 { schemaToFlags } from '../lib/schemaToFlags';\nimport { resolveAuth } from '../lib/resolveAuth';\nimport { formatActionHelp, flagDefsToFlagInfo } from '../lib/format';\n\nfunction parseArgs(args: string[]) {\n const instanceIdx = args.indexOf('--instance');\n const instanceFlag = instanceIdx !== -1 ? args[instanceIdx + 1] : undefined;\n\n const skipIndices = new Set<number>();\n if (instanceIdx !== -1) {\n skipIndices.add(instanceIdx);\n skipIndices.add(instanceIdx + 1);\n }\n\n let actionId: string | undefined;\n let actionIdIdx = -1;\n for (let i = 0; i < args.length; i++) {\n if (!skipIndices.has(i) && !args[i].startsWith('-')) {\n actionId = args[i];\n actionIdIdx = i;\n break;\n }\n }\n\n const wantsHelp = args.includes('--help') || args.includes('-h');\n\n return { instanceFlag, actionId, actionIdIdx, wantsHelp };\n}\n\nfunction showGenericHelp(\n info: CliCommandContext['info'],\n args: string[],\n): void {\n cli(\n {\n name: info.usage,\n parameters: ['<action-id>'],\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\nasync function showActionHelp(\n info: CliCommandContext['info'],\n actionId: string,\n instanceFlag: string | undefined,\n): Promise<boolean> {\n try {\n const { accessToken, baseUrl } = await resolveAuth(instanceFlag);\n const client = new ActionsClient(baseUrl, accessToken);\n const actions = await client.listForPlugin(actionId);\n const action = actions.find(a => a.id === actionId);\n\n if (!action) {\n return false;\n }\n\n const { flags: flagDefs } = schemaToFlags(action.schema.input as any);\n const flags = flagDefsToFlagInfo(flagDefs);\n flags.push({\n name: 'instance',\n type: 'string',\n description: 'Name of the instance to use',\n });\n\n process.stdout.write(\n await formatActionHelp({\n action,\n usage: `${info.usage ?? 'backstage actions execute'} ${actionId}`,\n flags,\n }),\n );\n return true;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n process.stderr.write(\n `Unable to retrieve action schema: ${msg}\\nShowing generic help.\\n`,\n );\n return false;\n }\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const { instanceFlag, actionId, actionIdIdx, wantsHelp } = parseArgs(args);\n\n if (wantsHelp) {\n if (!actionId || !(await showActionHelp(info, actionId, instanceFlag))) {\n showGenericHelp(info, args);\n }\n return;\n }\n\n if (!actionId) {\n // Inject --help so cleye renders its help output before we throw.\n showGenericHelp(info, ['--help', ...args]);\n throw new Error('Action ID is required');\n }\n\n const { accessToken, baseUrl } = await resolveAuth(instanceFlag);\n const client = new ActionsClient(baseUrl, accessToken);\n const actions = await client.listForPlugin(actionId);\n const action = actions.find(a => a.id === actionId);\n\n if (!action) {\n throw new Error(\n `Action \"${actionId}\" not found. Run \"actions list\" to see available actions.`,\n );\n }\n\n const inputSchema = action.schema.input as any;\n const { flags: schemaFlags, complexKeys } = schemaToFlags(inputSchema);\n\n const flagArgs = args.filter((_, i) => i !== actionIdIdx);\n\n const { flags } = cli(\n {\n name: info.usage,\n flags: {\n ...schemaFlags,\n instance: {\n type: String,\n description: 'Name of the instance to use',\n },\n },\n },\n undefined,\n flagArgs,\n );\n\n const allFlags = flags as Record<string, unknown>;\n const input: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(allFlags)) {\n if (key === 'instance' || value === undefined) {\n continue;\n }\n if (complexKeys.has(key) && typeof value === 'string') {\n try {\n input[key] = JSON.parse(value);\n } catch {\n throw new Error(`Invalid JSON for --${key}. Expected a JSON string.`);\n }\n } else {\n input[key] = value;\n }\n }\n\n const output = await client.execute(actionId, input);\n process.stdout.write(`${JSON.stringify(output, null, 2)}\\n`);\n};\n"],"names":["cli","resolveAuth","ActionsClient","schemaToFlags","flagDefsToFlagInfo","formatActionHelp"],"mappings":";;;;;;;;;;AAuBA,SAAS,UAAU,IAAA,EAAgB;AACjC,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC7C,EAAA,MAAM,eAAe,WAAA,KAAgB,EAAA,GAAK,IAAA,CAAK,WAAA,GAAc,CAAC,CAAA,GAAI,MAAA;AAElE,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAY;AACpC,EAAA,IAAI,gBAAgB,EAAA,EAAI;AACtB,IAAA,WAAA,CAAY,IAAI,WAAW,CAAA;AAC3B,IAAA,WAAA,CAAY,GAAA,CAAI,cAAc,CAAC,CAAA;AAAA,EACjC;AAEA,EAAA,IAAI,QAAA;AACJ,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,IAAI,CAAC,WAAA,CAAY,GAAA,CAAI,CAAC,CAAA,IAAK,CAAC,IAAA,CAAK,CAAC,CAAA,CAAE,UAAA,CAAW,GAAG,CAAA,EAAG;AACnD,MAAA,QAAA,GAAW,KAAK,CAAC,CAAA;AACjB,MAAA,WAAA,GAAc,CAAA;AACd,MAAA;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,YAAY,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,IAAK,IAAA,CAAK,SAAS,IAAI,CAAA;AAE/D,EAAA,OAAO,EAAE,YAAA,EAAc,QAAA,EAAU,WAAA,EAAa,SAAA,EAAU;AAC1D;AAEA,SAAS,eAAA,CACP,MACA,IAAA,EACM;AACN,EAA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Q,UAAU,KAAK,CAAA;AACnD,EAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA,EAAG,IAAA,CAAK,UAAU,MAAA,EAAQ,IAAA,EAAM,CAAC,CAAC;AAAA,CAAI,CAAA;AAC7D,CAAA
|
|
1
|
+
{"version":3,"file":"execute.cjs.js","sources":["../../src/commands/execute.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 { schemaToFlags } from '../lib/schemaToFlags';\nimport { resolveAuth } from '../lib/resolveAuth';\nimport { formatActionHelp, flagDefsToFlagInfo } from '../lib/format';\n\nfunction parseArgs(args: string[]) {\n const instanceIdx = args.indexOf('--instance');\n const instanceFlag = instanceIdx !== -1 ? args[instanceIdx + 1] : undefined;\n\n const skipIndices = new Set<number>();\n if (instanceIdx !== -1) {\n skipIndices.add(instanceIdx);\n skipIndices.add(instanceIdx + 1);\n }\n\n let actionId: string | undefined;\n let actionIdIdx = -1;\n for (let i = 0; i < args.length; i++) {\n if (!skipIndices.has(i) && !args[i].startsWith('-')) {\n actionId = args[i];\n actionIdIdx = i;\n break;\n }\n }\n\n const wantsHelp = args.includes('--help') || args.includes('-h');\n\n return { instanceFlag, actionId, actionIdIdx, wantsHelp };\n}\n\nfunction showGenericHelp(\n info: CliCommandContext['info'],\n args: string[],\n): void {\n cli(\n {\n name: info.usage,\n parameters: ['<action-id>'],\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\nasync function showActionHelp(\n info: CliCommandContext['info'],\n actionId: string,\n instanceFlag: string | undefined,\n): Promise<boolean> {\n try {\n const { accessToken, baseUrl } = await resolveAuth(instanceFlag);\n const client = new ActionsClient(baseUrl, accessToken);\n const actions = await client.listForPlugin(actionId);\n const action = actions.find(a => a.id === actionId);\n\n if (!action) {\n return false;\n }\n\n const { flags: flagDefs } = schemaToFlags(action.schema.input as any);\n const flags = flagDefsToFlagInfo(flagDefs);\n flags.push({\n name: 'instance',\n type: 'string',\n description: 'Name of the instance to use',\n });\n\n process.stdout.write(\n await formatActionHelp({\n action,\n usage: `${info.usage ?? 'backstage actions execute'} ${actionId}`,\n flags,\n }),\n );\n return true;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n process.stderr.write(\n `Unable to retrieve action schema: ${msg}\\nShowing generic help.\\n`,\n );\n return false;\n }\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const { instanceFlag, actionId, actionIdIdx, wantsHelp } = parseArgs(args);\n\n if (wantsHelp) {\n if (!actionId || !(await showActionHelp(info, actionId, instanceFlag))) {\n showGenericHelp(info, args);\n }\n return;\n }\n\n if (!actionId) {\n // Inject --help so cleye renders its help output before we throw.\n showGenericHelp(info, ['--help', ...args]);\n throw new Error('Action ID is required');\n }\n\n const { accessToken, baseUrl } = await resolveAuth(instanceFlag);\n const client = new ActionsClient(baseUrl, accessToken);\n const actions = await client.listForPlugin(actionId);\n const action = actions.find(a => a.id === actionId);\n\n if (!action) {\n throw new Error(\n `Action \"${actionId}\" not found. Run \"actions list\" to see available actions.`,\n );\n }\n\n const inputSchema = action.schema.input as any;\n const { flags: schemaFlags, complexKeys } = schemaToFlags(inputSchema);\n\n const flagArgs = args.filter((_, i) => i !== actionIdIdx);\n\n const { flags } = cli(\n {\n name: info.usage,\n flags: {\n ...schemaFlags,\n instance: {\n type: String,\n description: 'Name of the instance to use',\n },\n },\n },\n undefined,\n flagArgs,\n );\n\n const allFlags = flags as Record<string, unknown>;\n const input: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(allFlags)) {\n if (key === 'instance' || value === undefined) {\n continue;\n }\n if (complexKeys.has(key) && typeof value === 'string') {\n try {\n input[key] = JSON.parse(value);\n } catch {\n throw new Error(`Invalid JSON for --${key}. Expected a JSON string.`);\n }\n } else {\n input[key] = value;\n }\n }\n\n const output = await client.execute(actionId, input);\n process.stdout.write(`${JSON.stringify(output, null, 2)}\\n`);\n};\n"],"names":["cli","resolveAuth","ActionsClient","schemaToFlags","flagDefsToFlagInfo","formatActionHelp"],"mappings":";;;;;;;;;;AAuBA,SAAS,UAAU,IAAA,EAAgB;AACjC,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC7C,EAAA,MAAM,eAAe,WAAA,KAAgB,EAAA,GAAK,IAAA,CAAK,WAAA,GAAc,CAAC,CAAA,GAAI,MAAA;AAElE,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAY;AACpC,EAAA,IAAI,gBAAgB,EAAA,EAAI;AACtB,IAAA,WAAA,CAAY,IAAI,WAAW,CAAA;AAC3B,IAAA,WAAA,CAAY,GAAA,CAAI,cAAc,CAAC,CAAA;AAAA,EACjC;AAEA,EAAA,IAAI,QAAA;AACJ,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,IAAI,CAAC,WAAA,CAAY,GAAA,CAAI,CAAC,CAAA,IAAK,CAAC,IAAA,CAAK,CAAC,CAAA,CAAE,UAAA,CAAW,GAAG,CAAA,EAAG;AACnD,MAAA,QAAA,GAAW,KAAK,CAAC,CAAA;AACjB,MAAA,WAAA,GAAc,CAAA;AACd,MAAA;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,YAAY,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,IAAK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AA,MACtE;AAAA,IACF,CAAA,MAAO;AACL,MAAA,KAAA,CAAM,GAAG,CAAA,GAAI,KAAA;AAAA,IACf;AAAA,EACF;AAEA,EAAA,MAAM,MAAA,GAAS,MAAM,MAAA,CAAO,OAAA,CAAQ,UAAU,KAAK,CAAA;AACnD,EAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA,EAAG,IAAA,CAAK,UAAU,MAAA,EAAQ,IAAA,EAAM,CAAC,CAAC;AAAA,CAAI,CAAA;AAC7D,CAAA;;"}
|
|
@@ -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
|
-
|
|
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
|
|
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,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,EAAE,OAAA,EAAS,MAAA,KAAW,MAAM,MAAA,CAAO,KAAK,aAAa,CAAA;AAE3D,EAAA,MAAM,aAAa,OAAA,CAAQ,IAAA,CAAK,OAAK,CAAA,CAAE,OAAA,CAAQ,SAAS,CAAC,CAAA;AAEzD,EAAA,IAAI,OAAA,CAAQ,MAAA,KAAW,CAAA,IAAK,MAAA,CAAO,SAAS,CAAA,EAAG;AAC7C,IAAA,KAAA,MAAW,EAAE,QAAA,EAAU,OAAA,EAAQ,IAAK,MAAA,EAAQ;AAC1C,MAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,QACbC,sBAAA,CAAM,MAAA,CAAO,CAAA,iBAAA,EAAoB,QAAQ,mBAAc,OAAO;AAAA,CAAI;AAAA,OACpE;AAAA,IACF;AACA,IAAA,OAAA,CAAQ,QAAA,GAAW,CAAA;AACnB,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,qBAAqB,CAAA;AAAA,EAC5C;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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcesAdd.cjs.js","sources":["../../src/commands/sourcesAdd.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n name: info.usage,\n parameters: ['<plugin-ids...>'],\n },\n undefined,\n args,\n );\n\n const pluginIds: string[] = parsed._.pluginIds;\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n const added: string[] = [];\n const skipped: string[] = [];\n\n for (const pluginId of pluginIds) {\n if (existing.includes(pluginId)) {\n skipped.push(pluginId);\n } else {\n added.push(pluginId);\n }\n }\n\n if (added.length > 0) {\n await auth.setMetadata('pluginSources', [...existing, ...added]);\n process.stdout.write(\n `Added plugin source${added.length > 1 ? 's' : ''}: ${added.join(\n ', ',\n )}\\n`,\n );\n }\n\n for (const id of skipped) {\n process.stderr.write(`Plugin source \"${id}\" is already configured.\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,iBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASA,SAAA;AAAA,IACb;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAA,EAAY,CAAC,iBAAiB;AAAA,KAChC;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,SAAA,GAAsB,OAAO,CAAA,CAAE,SAAA;AAErC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAWC,iCAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,MAAM,QAAkB,EAAC;AACzB,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,YAAY,SAAA,EAAW;AAChC,IAAA,IAAI,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAC/B,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB,CAAA,MAAO;AACL,MAAA,KAAA,CAAM,KAAK,QAAQ,CAAA;AAAA,IACrB;AAAA,EACF;AAEA,EAAA,IAAI,KAAA,CAAM,SAAS,CAAA,EAAG;AACpB,IAAA,MAAM,IAAA,CAAK,YAAY,eAAA,EAAiB,CAAC,GAAG,QAAA,EAAU,GAAG,KAAK,CAAC,CAAA;AAC/D,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb,sBAAsB,KAAA,CAAM,MAAA,GAAS,IAAI,GAAA,GAAM,EAAE,KAAK,KAAA,CAAM,IAAA;AAAA,QAC1D;AAAA,OACD;AAAA;AAAA,KACH;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,MAAM,OAAA,EAAS;AACxB,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,eAAA,EAAkB,EAAE,CAAA;AAAA,CAA4B,CAAA;AAAA,EACvE;AACF,CAAA
|
|
1
|
+
{"version":3,"file":"sourcesAdd.cjs.js","sources":["../../src/commands/sourcesAdd.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n name: info.usage,\n parameters: ['<plugin-ids...>'],\n },\n undefined,\n args,\n );\n\n const pluginIds: string[] = parsed._.pluginIds;\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n const added: string[] = [];\n const skipped: string[] = [];\n\n for (const pluginId of pluginIds) {\n if (existing.includes(pluginId)) {\n skipped.push(pluginId);\n } else {\n added.push(pluginId);\n }\n }\n\n if (added.length > 0) {\n await auth.setMetadata('pluginSources', [...existing, ...added]);\n process.stdout.write(\n `Added plugin source${added.length > 1 ? 's' : ''}: ${added.join(\n ', ',\n )}\\n`,\n );\n }\n\n for (const id of skipped) {\n process.stderr.write(`Plugin source \"${id}\" is already configured.\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,iBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASA,SAAA;AAAA,IACb;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAA,EAAY,CAAC,iBAAiB;AAAA,KAChC;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,SAAA,GAAsB,OAAO,CAAA,CAAE,SAAA;AAErC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAWC,iCAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,MAAM,QAAkB,EAAC;AACzB,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,YAAY,SAAA,EAAW;AAChC,IAAA,IAAI,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAC/B,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB,CAAA,MAAO;AACL,MAAA,KAAA,CAAM,KAAK,QAAQ,CAAA;AAAA,IACrB;AAAA,EACF;AAEA,EAAA,IAAI,KAAA,CAAM,SAAS,CAAA,EAAG;AACpB,IAAA,MAAM,IAAA,CAAK,YAAY,eAAA,EAAiB,CAAC,GAAG,QAAA,EAAU,GAAG,KAAK,CAAC,CAAA;AAC/D,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb,sBAAsB,KAAA,CAAM,MAAA,GAAS,IAAI,GAAA,GAAM,EAAE,KAAK,KAAA,CAAM,IAAA;AAAA,QAC1D;AAAA,OACD;AAAA;AAAA,KACH;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,MAAM,OAAA,EAAS;AACxB,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,eAAA,EAAkB,EAAE,CAAA;AAAA,CAA4B,CAAA;AAAA,EACvE;AACF,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcesList.cjs.js","sources":["../../src/commands/sourcesList.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n cli({ name: info.usage }, undefined, args);\n\n const auth = await CliAuth.create();\n const sources = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n if (!sources.length) {\n process.stderr.write('No plugin sources configured.\\n');\n return;\n }\n\n for (const source of sources) {\n process.stdout.write(`${source}\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,kBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAAA,SAAA,CAAI,EAAE,IAAA,EAAM,IAAA,CAAK,KAAA,EAAM,EAAG,QAAW,IAAI,CAAA;AAEzC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,UAAUC,iCAAA,CAAoB,KAAA;AAAA,IAClC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AACnB,IAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,iCAAiC,CAAA;AACtD,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,EAAG,MAAM;AAAA,CAAI,CAAA;AAAA,EACpC;AACF,CAAA
|
|
1
|
+
{"version":3,"file":"sourcesList.cjs.js","sources":["../../src/commands/sourcesList.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n cli({ name: info.usage }, undefined, args);\n\n const auth = await CliAuth.create();\n const sources = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n if (!sources.length) {\n process.stderr.write('No plugin sources configured.\\n');\n return;\n }\n\n for (const source of sources) {\n process.stdout.write(`${source}\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,kBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAAA,SAAA,CAAI,EAAE,IAAA,EAAM,IAAA,CAAK,KAAA,EAAM,EAAG,QAAW,IAAI,CAAA;AAEzC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,UAAUC,iCAAA,CAAoB,KAAA;AAAA,IAClC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AACnB,IAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,iCAAiC,CAAA;AACtD,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,EAAG,MAAM;AAAA,CAAI,CAAA;AAAA,EACpC;AACF,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcesRemove.cjs.js","sources":["../../src/commands/sourcesRemove.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n name: info.usage,\n parameters: ['<plugin-ids...>'],\n },\n undefined,\n args,\n );\n\n const pluginIds: string[] = parsed._.pluginIds;\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n const removed: string[] = [];\n const skipped: string[] = [];\n\n for (const pluginId of pluginIds) {\n if (existing.includes(pluginId)) {\n removed.push(pluginId);\n } else {\n skipped.push(pluginId);\n }\n }\n\n if (removed.length > 0) {\n await auth.setMetadata(\n 'pluginSources',\n existing.filter(s => !removed.includes(s)),\n );\n process.stdout.write(\n `Removed plugin source${removed.length > 1 ? 's' : ''}: ${removed.join(\n ', ',\n )}\\n`,\n );\n }\n\n for (const id of skipped) {\n process.stderr.write(`Plugin source \"${id}\" is not configured.\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,oBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASA,SAAA;AAAA,IACb;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAA,EAAY,CAAC,iBAAiB;AAAA,KAChC;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,SAAA,GAAsB,OAAO,CAAA,CAAE,SAAA;AAErC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAWC,iCAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,MAAM,UAAoB,EAAC;AAC3B,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,YAAY,SAAA,EAAW;AAChC,IAAA,IAAI,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAC/B,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB;AAAA,EACF;AAEA,EAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACtB,IAAA,MAAM,IAAA,CAAK,WAAA;AAAA,MACT,eAAA;AAAA,MACA,SAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,OAAA,CAAQ,QAAA,CAAS,CAAC,CAAC;AAAA,KAC3C;AACA,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb,wBAAwB,OAAA,CAAQ,MAAA,GAAS,IAAI,GAAA,GAAM,EAAE,KAAK,OAAA,CAAQ,IAAA;AAAA,QAChE;AAAA,OACD;AAAA;AAAA,KACH;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,MAAM,OAAA,EAAS;AACxB,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,eAAA,EAAkB,EAAE,CAAA;AAAA,CAAwB,CAAA;AAAA,EACnE;AACF,CAAA
|
|
1
|
+
{"version":3,"file":"sourcesRemove.cjs.js","sources":["../../src/commands/sourcesRemove.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 { CliAuth, type CliCommandContext } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from '../lib/pluginSources';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n name: info.usage,\n parameters: ['<plugin-ids...>'],\n },\n undefined,\n args,\n );\n\n const pluginIds: string[] = parsed._.pluginIds;\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n const removed: string[] = [];\n const skipped: string[] = [];\n\n for (const pluginId of pluginIds) {\n if (existing.includes(pluginId)) {\n removed.push(pluginId);\n } else {\n skipped.push(pluginId);\n }\n }\n\n if (removed.length > 0) {\n await auth.setMetadata(\n 'pluginSources',\n existing.filter(s => !removed.includes(s)),\n );\n process.stdout.write(\n `Removed plugin source${removed.length > 1 ? 's' : ''}: ${removed.join(\n ', ',\n )}\\n`,\n );\n }\n\n for (const id of skipped) {\n process.stderr.write(`Plugin source \"${id}\" is not configured.\\n`);\n }\n};\n"],"names":["cli","CliAuth","pluginSourcesSchema"],"mappings":";;;;;;;;AAoBA,oBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASA,SAAA;AAAA,IACb;AAAA,MACE,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAA,EAAY,CAAC,iBAAiB;AAAA,KAChC;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,SAAA,GAAsB,OAAO,CAAA,CAAE,SAAA;AAErC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAWC,iCAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,MAAM,UAAoB,EAAC;AAC3B,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,YAAY,SAAA,EAAW;AAChC,IAAA,IAAI,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAC/B,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,IACvB;AAAA,EACF;AAEA,EAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACtB,IAAA,MAAM,IAAA,CAAK,WAAA;AAAA,MACT,eAAA;AAAA,MACA,SAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,OAAA,CAAQ,QAAA,CAAS,CAAC,CAAC;AAAA,KAC3C;AACA,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb,wBAAwB,OAAA,CAAQ,MAAA,GAAS,IAAI,GAAA,GAAM,EAAE,KAAK,OAAA,CAAQ,IAAA;AAAA,QAChE;AAAA,OACD;AAAA;AAAA,KACH;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,MAAM,OAAA,EAAS;AACxB,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,eAAA,EAAkB,EAAE,CAAA;AAAA,CAAwB,CAAA;AAAA,EACnE;AACF,CAAA;;"}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/index.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 { createCliModule } from '@backstage/cli-node';\nimport packageJson from '../package.json';\n\nexport default createCliModule({\n packageJson,\n init: async reg => {\n reg.addCommand({\n path: ['actions', 'list'],\n description: 'List available actions from configured plugin sources',\n execute: { loader: () => import('./commands/list') },\n });\n reg.addCommand({\n path: ['actions', 'execute'],\n description: 'Execute an action',\n execute: { loader: () => import('./commands/execute') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'add'],\n description: 'Add a plugin source for action discovery',\n execute: { loader: () => import('./commands/sourcesAdd') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'list'],\n description: 'List configured plugin sources',\n execute: { loader: () => import('./commands/sourcesList') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'remove'],\n description: 'Remove a plugin source',\n execute: { loader: () => import('./commands/sourcesRemove') },\n });\n },\n});\n"],"names":["createCliModule","packageJson"],"mappings":";;;;;;;AAmBA,YAAeA,uBAAA,CAAgB;AAAA,eAC7BC,gBAAA;AAAA,EACA,IAAA,EAAM,OAAM,GAAA,KAAO;AACjB,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,MACxB,WAAA,EAAa,uDAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,wBAAiB,CAAA;AAAE,KACpD,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAS,CAAA;AAAA,MAC3B,WAAA,EAAa,mBAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,2BAAoB,CAAA;AAAE,KACvD,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,KAAK,CAAA;AAAA,MAClC,WAAA,EAAa,0CAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,8BAAuB,CAAA;AAAE,KAC1D,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,MAAM,CAAA;AAAA,MACnC,WAAA,EAAa,gCAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,+BAAwB,CAAA;AAAE,KAC3D,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,QAAQ,CAAA;AAAA,MACrC,WAAA,EAAa,wBAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,iCAA0B,CAAA;AAAE,KAC7D,CAAA;AAAA,EACH;AACF,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/index.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 { createCliModule } from '@backstage/cli-node';\nimport packageJson from '../package.json';\n\nexport default createCliModule({\n packageJson,\n init: async reg => {\n reg.addCommand({\n path: ['actions', 'list'],\n description: 'List available actions from configured plugin sources',\n execute: { loader: () => import('./commands/list') },\n });\n reg.addCommand({\n path: ['actions', 'execute'],\n description: 'Execute an action',\n execute: { loader: () => import('./commands/execute') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'add'],\n description: 'Add a plugin source for action discovery',\n execute: { loader: () => import('./commands/sourcesAdd') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'list'],\n description: 'List configured plugin sources',\n execute: { loader: () => import('./commands/sourcesList') },\n });\n reg.addCommand({\n path: ['actions', 'sources', 'remove'],\n description: 'Remove a plugin source',\n execute: { loader: () => import('./commands/sourcesRemove') },\n });\n },\n});\n"],"names":["createCliModule","packageJson"],"mappings":";;;;;;;AAmBA,YAAeA,uBAAA,CAAgB;AAAA,eAC7BC,gBAAA;AAAA,EACA,IAAA,EAAM,OAAM,GAAA,KAAO;AACjB,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,MACxB,WAAA,EAAa,uDAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,wBAAiB,CAAA;AAAE,KACpD,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAS,CAAA;AAAA,MAC3B,WAAA,EAAa,mBAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,2BAAoB,CAAA;AAAE,KACvD,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,KAAK,CAAA;AAAA,MAClC,WAAA,EAAa,0CAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,8BAAuB,CAAA;AAAE,KAC1D,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,MAAM,CAAA;AAAA,MACnC,WAAA,EAAa,gCAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,+BAAwB,CAAA;AAAE,KAC3D,CAAA;AACD,IAAA,GAAA,CAAI,UAAA,CAAW;AAAA,MACb,IAAA,EAAM,CAAC,SAAA,EAAW,SAAA,EAAW,QAAQ,CAAA;AAAA,MACrC,WAAA,EAAa,wBAAA;AAAA,MACb,SAAS,EAAE,MAAA,EAAQ,MAAM,OAAO,iCAA0B,CAAA;AAAE,KAC7D,CAAA;AAAA,EACH;AACF,CAAC,CAAA;;"}
|
|
@@ -22,8 +22,10 @@ class ActionsClient {
|
|
|
22
22
|
this.baseUrl = baseUrl;
|
|
23
23
|
this.accessToken = accessToken;
|
|
24
24
|
}
|
|
25
|
+
baseUrl;
|
|
26
|
+
accessToken;
|
|
25
27
|
async list(pluginSources) {
|
|
26
|
-
|
|
28
|
+
const results = await Promise.allSettled(
|
|
27
29
|
pluginSources.map(async (pluginId) => {
|
|
28
30
|
const url = pluginActionsUrl(this.baseUrl, pluginId);
|
|
29
31
|
const response = await httpJson.httpJson(url, {
|
|
@@ -33,10 +35,27 @@ class ActionsClient {
|
|
|
33
35
|
return { pluginId, actions: response.actions };
|
|
34
36
|
})
|
|
35
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 };
|
|
36
52
|
}
|
|
37
53
|
async listForPlugin(actionId) {
|
|
38
54
|
const pluginId = extractPluginId(actionId);
|
|
39
|
-
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
|
+
}
|
|
40
59
|
return grouped.flatMap((g) => g.actions);
|
|
41
60
|
}
|
|
42
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<
|
|
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;AA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AA,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.cjs.js","sources":["../../src/lib/format.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 chalk from 'chalk';\nimport type { GroupedActions } from './ActionsClient';\nimport type { CleyeFlag } from './schemaToFlags';\n\nasync function renderMarkdown(text: string): Promise<string> {\n const { Marked } = await import('marked');\n const { markedTerminal } = await import('marked-terminal');\n const stripAnsi = (await import('strip-ansi')).default;\n\n const instance = new Marked(markedTerminal());\n const sanitized = stripAnsi(text);\n return instance.parse(sanitized) as string;\n}\n\nfunction dedent(text: string): string {\n const trimmed = text.replace(/^\\n+/, '').replace(/\\n+$/, '');\n const lines = trimmed.split('\\n');\n const nonEmptyLines = lines.filter(l => l.trim().length > 0);\n if (nonEmptyLines.length === 0) return trimmed;\n const minIndent = Math.min(\n ...nonEmptyLines.map(l => l.match(/^(\\s*)/)![0].length),\n );\n if (minIndent === 0) return trimmed;\n return lines.map(l => l.slice(minIndent)).join('\\n');\n}\n\nfunction terminalWidth(): number {\n return process.stdout.columns || 80;\n}\n\nexport function formatActionList(grouped: GroupedActions): string {\n const width = terminalWidth();\n const lines: string[] = [];\n\n for (let i = 0; i < grouped.length; i++) {\n const { pluginId, actions } = grouped[i];\n\n if (i > 0) {\n lines.push('');\n }\n\n const header = `── ${pluginId} `;\n const remaining = Math.max(0, width - header.length);\n lines.push(chalk.bold(`${header}${'─'.repeat(remaining)}`));\n lines.push('');\n\n if (actions.length === 0) {\n lines.push(` ${chalk.dim('(no actions)')}`);\n continue;\n }\n\n const maxIdLen = Math.max(...actions.map(a => a.id.length));\n const idColWidth = maxIdLen + 4;\n\n for (const action of actions) {\n const paddedId = action.id.padEnd(idColWidth);\n\n if (!action.title) {\n lines.push(` ${chalk.cyan(paddedId.trimEnd())}`);\n continue;\n }\n\n lines.push(` ${chalk.cyan(paddedId)}${chalk.dim(action.title)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\nexport type FlagInfo = {\n name: string;\n type: string;\n description?: string;\n};\n\nconst typeHintNames: Record<string, string> = {\n String: 'string',\n Number: 'number',\n Boolean: '',\n};\n\nexport function flagDefsToFlagInfo(\n defs: Record<string, CleyeFlag>,\n): FlagInfo[] {\n return Object.entries(defs).map(([name, def]) => ({\n name,\n type: typeHintNames[def.type.name] ?? 'string',\n description: def.description,\n }));\n}\n\nexport async function formatActionHelp(options: {\n action: {\n id: string;\n title?: string;\n description?: string;\n };\n usage: string;\n flags: FlagInfo[];\n}): Promise<string> {\n const { action, usage, flags } = options;\n const lines: string[] = [];\n\n lines.push(chalk.bold.cyan(action.id));\n\n if (action.title) {\n lines.push(` ${action.title}`);\n }\n\n if (action.description) {\n lines.push('');\n const dedented = dedent(action.description);\n const rendered = await renderMarkdown(dedented);\n lines.push(rendered.trimEnd());\n }\n\n lines.push('');\n lines.push(chalk.bold('Usage:'));\n lines.push(` ${usage} ${chalk.dim('[flags]')}`);\n\n if (flags.length > 0) {\n lines.push('');\n lines.push(chalk.bold('Flags:'));\n\n const maxFlagLen = Math.max(\n ...flags.map(f => {\n const typeHint = f.type ? ` <${f.type}>` : '';\n return ` --${f.name}${typeHint}`.length;\n }),\n );\n const colWidth = maxFlagLen + 4;\n\n for (const flag of flags) {\n const typeHint = flag.type ? ` <${flag.type}>` : '';\n const left = ` --${flag.name}${typeHint}`.padEnd(colWidth);\n const desc = flag.description ? chalk.dim(flag.description) : '';\n lines.push(`${left}${desc}`);\n }\n }\n\n lines.push('');\n return lines.join('\\n');\n}\n"],"names":["chalk"],"mappings":";;;;;;;;AAoBA,eAAe,eAAe,IAAA,EAA+B;AAC3D,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,MAAM,OAAO,QAAQ,CAAA;AACxC,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,iBAAiB,CAAA;AACzD,EAAA,MAAM,SAAA,GAAA,CAAa,MAAM,OAAO,YAAY,CAAA,EAAG,OAAA;AAE/C,EAAA,MAAM,QAAA,GAAW,IAAI,MAAA,CAAO,cAAA,EAAgB,CAAA;AAC5C,EAAA,MAAM,SAAA,GAAY,UAAU,IAAI,CAAA;AAChC,EAAA,OAAO,QAAA,CAAS,MAAM,SAAS,CAAA;AACjC;AAEA,SAAS,OAAO,IAAA,EAAsB;AACpC,EAAA,MAAM,OAAA,GAAU,KAAK,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC3D,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA;AAChC,EAAA,MAAM,aAAA,GAAgB,MAAM,MAAA,CAAO,CAAA,CAAA,KAAK,EAAE,IAAA,EAAK,CAAE,SAAS,CAAC,CAAA;AAC3D,EAAA,IAAI,aAAA,CAAc,MAAA,KAAW,CAAA,EAAG,OAAO,OAAA;AACvC,EAAA,MAAM,YAAY,IAAA,CAAK,GAAA;AAAA,IACrB,GAAG,aAAA,CAAc,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,MAAM,QAAQ,CAAA,CAAG,CAAC,CAAA,CAAE,MAAM;AAAA,GACxD;AACA,EAAA,IAAI,SAAA,KAAc,GAAG,OAAO,OAAA;AA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,WAAW,UAAA,GAAa,CAAA;AAE9B,IAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,MAAA,MAAM,WAAW,IAAA,CAAK,IAAA,GAAO,CAAA,EAAA,EAAK,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA,GAAM,EAAA;AACjD,MAAA,MAAM,IAAA,GAAO,OAAO,IAAA,CAAK,IAAI,GAAG,QAAQ,CAAA,CAAA,CAAG,OAAO,QAAQ,CAAA;AAC1D,MAAA,MAAM,OAAO,IAAA,CAAK,WAAA,GAAcA,uBAAM,GAAA,CAAI,IAAA,CAAK,WAAW,CAAA,GAAI,EAAA;AAC9D,MAAA,KAAA,CAAM,IAAA,CAAK,CAAA,EAAG,IAAI,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,IAC7B;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,KAAK,EAAE,CAAA;AACb,EAAA,OAAO,KAAA,CAAM,KAAK,IAAI,CAAA;AACxB
|
|
1
|
+
{"version":3,"file":"format.cjs.js","sources":["../../src/lib/format.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 chalk from 'chalk';\nimport type { GroupedActions } from './ActionsClient';\nimport type { CleyeFlag } from './schemaToFlags';\n\nasync function renderMarkdown(text: string): Promise<string> {\n const { Marked } = await import('marked');\n const { markedTerminal } = await import('marked-terminal');\n const stripAnsi = (await import('strip-ansi')).default;\n\n const instance = new Marked(markedTerminal());\n const sanitized = stripAnsi(text);\n return instance.parse(sanitized) as string;\n}\n\nfunction dedent(text: string): string {\n const trimmed = text.replace(/^\\n+/, '').replace(/\\n+$/, '');\n const lines = trimmed.split('\\n');\n const nonEmptyLines = lines.filter(l => l.trim().length > 0);\n if (nonEmptyLines.length === 0) return trimmed;\n const minIndent = Math.min(\n ...nonEmptyLines.map(l => l.match(/^(\\s*)/)![0].length),\n );\n if (minIndent === 0) return trimmed;\n return lines.map(l => l.slice(minIndent)).join('\\n');\n}\n\nfunction terminalWidth(): number {\n return process.stdout.columns || 80;\n}\n\nexport function formatActionList(grouped: GroupedActions): string {\n const width = terminalWidth();\n const lines: string[] = [];\n\n for (let i = 0; i < grouped.length; i++) {\n const { pluginId, actions } = grouped[i];\n\n if (i > 0) {\n lines.push('');\n }\n\n const header = `── ${pluginId} `;\n const remaining = Math.max(0, width - header.length);\n lines.push(chalk.bold(`${header}${'─'.repeat(remaining)}`));\n lines.push('');\n\n if (actions.length === 0) {\n lines.push(` ${chalk.dim('(no actions)')}`);\n continue;\n }\n\n const maxIdLen = Math.max(...actions.map(a => a.id.length));\n const idColWidth = maxIdLen + 4;\n\n for (const action of actions) {\n const paddedId = action.id.padEnd(idColWidth);\n\n if (!action.title) {\n lines.push(` ${chalk.cyan(paddedId.trimEnd())}`);\n continue;\n }\n\n lines.push(` ${chalk.cyan(paddedId)}${chalk.dim(action.title)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\nexport type FlagInfo = {\n name: string;\n type: string;\n description?: string;\n};\n\nconst typeHintNames: Record<string, string> = {\n String: 'string',\n Number: 'number',\n Boolean: '',\n};\n\nexport function flagDefsToFlagInfo(\n defs: Record<string, CleyeFlag>,\n): FlagInfo[] {\n return Object.entries(defs).map(([name, def]) => ({\n name,\n type: typeHintNames[def.type.name] ?? 'string',\n description: def.description,\n }));\n}\n\nexport async function formatActionHelp(options: {\n action: {\n id: string;\n title?: string;\n description?: string;\n };\n usage: string;\n flags: FlagInfo[];\n}): Promise<string> {\n const { action, usage, flags } = options;\n const lines: string[] = [];\n\n lines.push(chalk.bold.cyan(action.id));\n\n if (action.title) {\n lines.push(` ${action.title}`);\n }\n\n if (action.description) {\n lines.push('');\n const dedented = dedent(action.description);\n const rendered = await renderMarkdown(dedented);\n lines.push(rendered.trimEnd());\n }\n\n lines.push('');\n lines.push(chalk.bold('Usage:'));\n lines.push(` ${usage} ${chalk.dim('[flags]')}`);\n\n if (flags.length > 0) {\n lines.push('');\n lines.push(chalk.bold('Flags:'));\n\n const maxFlagLen = Math.max(\n ...flags.map(f => {\n const typeHint = f.type ? ` <${f.type}>` : '';\n return ` --${f.name}${typeHint}`.length;\n }),\n );\n const colWidth = maxFlagLen + 4;\n\n for (const flag of flags) {\n const typeHint = flag.type ? ` <${flag.type}>` : '';\n const left = ` --${flag.name}${typeHint}`.padEnd(colWidth);\n const desc = flag.description ? chalk.dim(flag.description) : '';\n lines.push(`${left}${desc}`);\n }\n }\n\n lines.push('');\n return lines.join('\\n');\n}\n"],"names":["chalk"],"mappings":";;;;;;;;AAoBA,eAAe,eAAe,IAAA,EAA+B;AAC3D,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,MAAM,OAAO,QAAQ,CAAA;AACxC,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,iBAAiB,CAAA;AACzD,EAAA,MAAM,SAAA,GAAA,CAAa,MAAM,OAAO,YAAY,CAAA,EAAG,OAAA;AAE/C,EAAA,MAAM,QAAA,GAAW,IAAI,MAAA,CAAO,cAAA,EAAgB,CAAA;AAC5C,EAAA,MAAM,SAAA,GAAY,UAAU,IAAI,CAAA;AAChC,EAAA,OAAO,QAAA,CAAS,MAAM,SAAS,CAAA;AACjC;AAEA,SAAS,OAAO,IAAA,EAAsB;AACpC,EAAA,MAAM,OAAA,GAAU,KAAK,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC3D,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA;AAChC,EAAA,MAAM,aAAA,GAAgB,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AC,CAAA;AAE/B,IAAA,MAAM,aAAa,IAAA,CAAK,GAAA;AAAA,MACtB,GAAG,KAAA,CAAM,GAAA,CAAI,CAAA,CAAA,KAAK;AAChB,QAAA,MAAM,WAAW,CAAA,CAAE,IAAA,GAAO,CAAA,EAAA,EAAK,CAAA,CAAE,IAAI,CAAA,CAAA,CAAA,GAAM,EAAA;AAC3C,QAAA,OAAO,CAAA,IAAA,EAAO,CAAA,CAAE,IAAI,CAAA,EAAG,QAAQ,CAAA,CAAA,CAAG,MAAA;AAAA,MACpC,CAAC;AAAA,KACH;AACA,IAAA,MAAM,WAAW,UAAA,GAAa,CAAA;AAE9B,IAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,MAAA,MAAM,WAAW,IAAA,CAAK,IAAA,GAAO,CAAA,EAAA,EAAK,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA,GAAM,EAAA;AACjD,MAAA,MAAM,IAAA,GAAO,OAAO,IAAA,CAAK,IAAI,GAAG,QAAQ,CAAA,CAAA,CAAG,OAAO,QAAQ,CAAA;AAC1D,MAAA,MAAM,OAAO,IAAA,CAAK,WAAA,GAAcA,uBAAM,GAAA,CAAI,IAAA,CAAK,WAAW,CAAA,GAAI,EAAA;AAC9D,MAAA,KAAA,CAAM,IAAA,CAAK,CAAA,EAAG,IAAI,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,IAC7B;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,KAAK,EAAE,CAAA;AACb,EAAA,OAAO,KAAA,CAAM,KAAK,IAAI,CAAA;AACxB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpJson.cjs.js","sources":["../../src/lib/httpJson.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 { ResponseError } from '@backstage/errors';\n\ntype HttpInit = {\n headers?: Record<string, string>;\n method?: string;\n body?: any;\n signal?: AbortSignal;\n};\n\nexport async function httpJson<T>(url: string, init?: HttpInit): Promise<T> {\n const res = await fetch(url, {\n ...init,\n body: init?.body ? JSON.stringify(init.body) : undefined,\n headers: {\n ...(init?.body ? { 'Content-Type': 'application/json' } : {}),\n ...init?.headers,\n },\n });\n if (!res.ok) {\n const responseError = await ResponseError.fromResponse(res);\n const causeMessage = responseError.cause?.message;\n throw new Error(\n causeMessage || `Request failed with ${res.status} ${res.statusText}`,\n { cause: responseError },\n );\n }\n return (await res.json()) as T;\n}\n"],"names":["ResponseError"],"mappings":";;;;AAyBA,eAAsB,QAAA,CAAY,KAAa,IAAA,EAA6B;AAC1E,EAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM,GAAA,EAAK;AAAA,IAC3B,GAAG,IAAA;AAAA,IACH,MAAM,IAAA,EAAM,IAAA,GAAO,KAAK,SAAA,CAAU,IAAA,CAAK,IAAI,CAAA,GAAI,MAAA;AAAA,IAC/C,OAAA,EAAS;AAAA,MACP,GAAI,IAAA,EAAM,IAAA,GAAO,EAAE,cAAA,EAAgB,kBAAA,KAAuB,EAAC;AAAA,MAC3D,GAAG,IAAA,EAAM;AAAA;AACX,GACD,CAAA;AACD,EAAA,IAAI,CAAC,IAAI,EAAA,EAAI;AACX,IAAA,MAAM,aAAA,GAAgB,MAAMA,oBAAA,CAAc,YAAA,CAAa,GAAG,CAAA;AAC1D,IAAA,MAAM,YAAA,GAAe,cAAc,KAAA,EAAO,OAAA;AAC1C,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,gBAAgB,CAAA,oBAAA,EAAuB,GAAA,CAAI,MAAM,CAAA,CAAA,EAAI,IAAI,UAAU,CAAA,CAAA;AAAA,MACnE,EAAE,OAAO,aAAA;AAAc,KACzB;AAAA,EACF;AACA,EAAA,OAAQ,MAAM,IAAI,IAAA,EAAK;AACzB
|
|
1
|
+
{"version":3,"file":"httpJson.cjs.js","sources":["../../src/lib/httpJson.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 { ResponseError } from '@backstage/errors';\n\ntype HttpInit = {\n headers?: Record<string, string>;\n method?: string;\n body?: any;\n signal?: AbortSignal;\n};\n\nexport async function httpJson<T>(url: string, init?: HttpInit): Promise<T> {\n const res = await fetch(url, {\n ...init,\n body: init?.body ? JSON.stringify(init.body) : undefined,\n headers: {\n ...(init?.body ? { 'Content-Type': 'application/json' } : {}),\n ...init?.headers,\n },\n });\n if (!res.ok) {\n const responseError = await ResponseError.fromResponse(res);\n const causeMessage = responseError.cause?.message;\n throw new Error(\n causeMessage || `Request failed with ${res.status} ${res.statusText}`,\n { cause: responseError },\n );\n }\n return (await res.json()) as T;\n}\n"],"names":["ResponseError"],"mappings":";;;;AAyBA,eAAsB,QAAA,CAAY,KAAa,IAAA,EAA6B;AAC1E,EAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM,GAAA,EAAK;AAAA,IAC3B,GAAG,IAAA;AAAA,IACH,MAAM,IAAA,EAAM,IAAA,GAAO,KAAK,SAAA,CAAU,IAAA,CAAK,IAAI,CAAA,GAAI,MAAA;AAAA,IAC/C,OAAA,EAAS;AAAA,MACP,GAAI,IAAA,EAAM,IAAA,GAAO,EAAE,cAAA,EAAgB,kBAAA,KAAuB,EAAC;AAAA,MAC3D,GAAG,IAAA,EAAM;AAAA;AACX,GACD,CAAA;AACD,EAAA,IAAI,CAAC,IAAI,EAAA,EAAI;AACX,IAAA,MAAM,aAAA,GAAgB,MAAMA,oBAAA,CAAc,YAAA,CAAa,GAAG,CAAA;AAC1D,IAAA,MAAM,YAAA,GAAe,cAAc,KAAA,EAAO,OAAA;AAC1C,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,gBAAgB,CAAA,oBAAA,EAAuB,GAAA,CAAI,MAAM,CAAA,CAAA,EAAI,IAAI,UAAU,CAAA,CAAA;AAAA,MACnE,EAAE,OAAO,aAAA;AAAc,KACzB;AAAA,EACF;AACA,EAAA,OAAQ,MAAM,IAAI,IAAA,EAAK;AACzB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginSources.cjs.js","sources":["../../src/lib/pluginSources.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 { z } from 'zod/v3';\n\nexport const pluginSourcesSchema = z.array(z.string()).default([]);\n"],"names":["z"],"mappings":";;;;AAkBO,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"pluginSources.cjs.js","sources":["../../src/lib/pluginSources.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 { z } from 'zod/v3';\n\nexport const pluginSourcesSchema = z.array(z.string()).default([]);\n"],"names":["z"],"mappings":";;;;AAkBO,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveAuth.cjs.js","sources":["../../src/lib/resolveAuth.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 { CliAuth } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from './pluginSources';\n\nexport async function resolveAuth(instanceFlag?: string): Promise<{\n baseUrl: string;\n instanceName: string;\n accessToken: string;\n pluginSources: string[];\n}> {\n const auth = await CliAuth.create({ instanceName: instanceFlag });\n const accessToken = await auth.getAccessToken();\n const pluginSources = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n return {\n baseUrl: auth.getBaseUrl(),\n instanceName: auth.getInstanceName(),\n accessToken,\n pluginSources,\n };\n}\n"],"names":["CliAuth","pluginSources","pluginSourcesSchema"],"mappings":";;;;;AAmBA,eAAsB,YAAY,YAAA,EAK/B;AACD,EAAA,MAAM,OAAO,MAAMA,eAAA,CAAQ,OAAO,EAAE,YAAA,EAAc,cAAc,CAAA;AAChE,EAAA,MAAM,WAAA,GAAc,MAAM,IAAA,CAAK,cAAA,EAAe;AAC9C,EAAA,MAAMC,kBAAgBC,iCAAA,CAAoB,KAAA;AAAA,IACxC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAK,UAAA,EAAW;AAAA,IACzB,YAAA,EAAc,KAAK,eAAA,EAAgB;AAAA,IACnC,WAAA;AAAA,mBACAD;AAAA,GACF;AACF
|
|
1
|
+
{"version":3,"file":"resolveAuth.cjs.js","sources":["../../src/lib/resolveAuth.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 { CliAuth } from '@backstage/cli-node';\nimport { pluginSourcesSchema } from './pluginSources';\n\nexport async function resolveAuth(instanceFlag?: string): Promise<{\n baseUrl: string;\n instanceName: string;\n accessToken: string;\n pluginSources: string[];\n}> {\n const auth = await CliAuth.create({ instanceName: instanceFlag });\n const accessToken = await auth.getAccessToken();\n const pluginSources = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n return {\n baseUrl: auth.getBaseUrl(),\n instanceName: auth.getInstanceName(),\n accessToken,\n pluginSources,\n };\n}\n"],"names":["CliAuth","pluginSources","pluginSourcesSchema"],"mappings":";;;;;AAmBA,eAAsB,YAAY,YAAA,EAK/B;AACD,EAAA,MAAM,OAAO,MAAMA,eAAA,CAAQ,OAAO,EAAE,YAAA,EAAc,cAAc,CAAA;AAChE,EAAA,MAAM,WAAA,GAAc,MAAM,IAAA,CAAK,cAAA,EAAe;AAC9C,EAAA,MAAMC,kBAAgBC,iCAAA,CAAoB,KAAA;AAAA,IACxC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAK,UAAA,EAAW;AAAA,IACzB,YAAA,EAAc,KAAK,eAAA,EAAgB;AAAA,IACnC,WAAA;AAAA,mBACAD;AAAA,GACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaToFlags.cjs.js","sources":["../../src/lib/schemaToFlags.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\ntype JsonSchemaProperty = {\n type?: string | string[];\n description?: string;\n enum?: unknown[];\n default?: unknown;\n anyOf?: unknown[];\n oneOf?: unknown[];\n allOf?: unknown[];\n};\n\ntype JsonSchemaObject = {\n properties?: Record<string, JsonSchemaProperty>;\n required?: string[];\n};\n\nexport type CleyeFlag = {\n type: StringConstructor | NumberConstructor | BooleanConstructor;\n description?: string;\n default?: unknown;\n};\n\nfunction isComplexType(prop: JsonSchemaProperty): boolean {\n if (prop.anyOf || prop.oneOf || prop.allOf) {\n return true;\n }\n const rawType = Array.isArray(prop.type) ? prop.type[0] : prop.type;\n return rawType === 'object' || rawType === 'array';\n}\n\nfunction resolveFlagType(\n rawType: string | undefined,\n): StringConstructor | NumberConstructor | BooleanConstructor | undefined {\n if (rawType === 'string') return String;\n if (rawType === 'number' || rawType === 'integer') return Number;\n if (rawType === 'boolean') return Boolean;\n return undefined;\n}\n\nexport function schemaToFlags(schema: JsonSchemaObject): {\n flags: Record<string, CleyeFlag>;\n complexKeys: Set<string>;\n} {\n const flags: Record<string, CleyeFlag> = {};\n const complexKeys = new Set<string>();\n const required = new Set(schema.required ?? []);\n\n if (!schema.properties) {\n return { flags, complexKeys };\n }\n\n for (const [key, prop] of Object.entries(schema.properties)) {\n const rawType = Array.isArray(prop.type) ? prop.type[0] : prop.type;\n const complex = isComplexType(prop);\n let flagType = resolveFlagType(rawType);\n\n if (!flagType && complex) {\n flagType = String;\n }\n\n if (!flagType) {\n continue;\n }\n\n if (complex) {\n complexKeys.add(key);\n }\n\n let desc = prop.description ?? '';\n\n if (complex) {\n desc = desc ? `${desc} (JSON)` : '(JSON)';\n }\n\n if (prop.enum?.length) {\n const values = prop.enum.map(v => String(v)).join(', ');\n desc = desc ? `${desc} [${values}]` : `[${values}]`;\n }\n if (required.has(key)) {\n desc = desc ? `${desc} (required)` : '(required)';\n }\n\n const flag: CleyeFlag = { type: flagType, description: desc || undefined };\n if (prop.default !== undefined) {\n flag.default = prop.default;\n }\n\n flags[key] = flag;\n }\n\n return { flags, complexKeys };\n}\n"],"names":[],"mappings":";;AAqCA,SAAS,cAAc,IAAA,EAAmC;AACxD,EAAA,IAAI,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,KAAA,IAAS,KAAK,KAAA,EAAO;AAC1C,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,CAAC,CAAA,GAAI,IAAA,CAAK,IAAA;AAC/D,EAAA,OAAO,OAAA,KAAY,YAAY,OAAA,KAAY,OAAA;AAC7C;AAEA,SAAS,gBACP,OAAA,EACwE;AACxE,EAAA,IAAI,OAAA,KAAY,UAAU,OAAO,MAAA;AACjC,EAAA,IAAI,OAAA,KAAY,QAAA,IAAY,OAAA,KAAY,SAAA,EAAW,OAAO,MAAA;AAC1D,EAAA,IA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AO,CAAC,CAAC,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA;AACtD,MAAA,IAAA,GAAO,OAAO,CAAA,EAAG,IAAI,KAAK,MAAM,CAAA,CAAA,CAAA,GAAM,IAAI,MAAM,CAAA,CAAA,CAAA;AAAA,IAClD;AACA,IAAA,IAAI,QAAA,CAAS,GAAA,CAAI,GAAG,CAAA,EAAG;AACrB,MAAA,IAAA,GAAO,IAAA,GAAO,CAAA,EAAG,IAAI,CAAA,WAAA,CAAA,GAAgB,YAAA;AAAA,IACvC;AAEA,IAAA,MAAM,OAAkB,EAAE,IAAA,EAAM,QAAA,EAAU,WAAA,EAAa,QAAQ,MAAA,EAAU;AACzE,IAAA,IAAI,IAAA,CAAK,YAAY,MAAA,EAAW;AAC9B,MAAA,IAAA,CAAK,UAAU,IAAA,CAAK,OAAA;AAAA,IACtB;AAEA,IAAA,KAAA,CAAM,GAAG,CAAA,GAAI,IAAA;AAAA,EACf;AAEA,EAAA,OAAO,EAAE,OAAO,WAAA,EAAY;AAC9B
|
|
1
|
+
{"version":3,"file":"schemaToFlags.cjs.js","sources":["../../src/lib/schemaToFlags.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\ntype JsonSchemaProperty = {\n type?: string | string[];\n description?: string;\n enum?: unknown[];\n default?: unknown;\n anyOf?: unknown[];\n oneOf?: unknown[];\n allOf?: unknown[];\n};\n\ntype JsonSchemaObject = {\n properties?: Record<string, JsonSchemaProperty>;\n required?: string[];\n};\n\nexport type CleyeFlag = {\n type: StringConstructor | NumberConstructor | BooleanConstructor;\n description?: string;\n default?: unknown;\n};\n\nfunction isComplexType(prop: JsonSchemaProperty): boolean {\n if (prop.anyOf || prop.oneOf || prop.allOf) {\n return true;\n }\n const rawType = Array.isArray(prop.type) ? prop.type[0] : prop.type;\n return rawType === 'object' || rawType === 'array';\n}\n\nfunction resolveFlagType(\n rawType: string | undefined,\n): StringConstructor | NumberConstructor | BooleanConstructor | undefined {\n if (rawType === 'string') return String;\n if (rawType === 'number' || rawType === 'integer') return Number;\n if (rawType === 'boolean') return Boolean;\n return undefined;\n}\n\nexport function schemaToFlags(schema: JsonSchemaObject): {\n flags: Record<string, CleyeFlag>;\n complexKeys: Set<string>;\n} {\n const flags: Record<string, CleyeFlag> = {};\n const complexKeys = new Set<string>();\n const required = new Set(schema.required ?? []);\n\n if (!schema.properties) {\n return { flags, complexKeys };\n }\n\n for (const [key, prop] of Object.entries(schema.properties)) {\n const rawType = Array.isArray(prop.type) ? prop.type[0] : prop.type;\n const complex = isComplexType(prop);\n let flagType = resolveFlagType(rawType);\n\n if (!flagType && complex) {\n flagType = String;\n }\n\n if (!flagType) {\n continue;\n }\n\n if (complex) {\n complexKeys.add(key);\n }\n\n let desc = prop.description ?? '';\n\n if (complex) {\n desc = desc ? `${desc} (JSON)` : '(JSON)';\n }\n\n if (prop.enum?.length) {\n const values = prop.enum.map(v => String(v)).join(', ');\n desc = desc ? `${desc} [${values}]` : `[${values}]`;\n }\n if (required.has(key)) {\n desc = desc ? `${desc} (required)` : '(required)';\n }\n\n const flag: CleyeFlag = { type: flagType, description: desc || undefined };\n if (prop.default !== undefined) {\n flag.default = prop.default;\n }\n\n flags[key] = flag;\n }\n\n return { flags, complexKeys };\n}\n"],"names":[],"mappings":";;AAqCA,SAAS,cAAc,IAAA,EAAmC;AACxD,EAAA,IAAI,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,KAAA,IAAS,KAAK,KAAA,EAAO;AAC1C,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,OAAA,GAAU,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AI,GAAG,CAAA;AAAA,IACrB;AAEA,IAAA,IAAI,IAAA,GAAO,KAAK,WAAA,IAAe,EAAA;AAE/B,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,IAAA,GAAO,IAAA,GAAO,CAAA,EAAG,IAAI,CAAA,OAAA,CAAA,GAAY,QAAA;AAAA,IACnC;AAEA,IAAA,IAAI,IAAA,CAAK,MAAM,MAAA,EAAQ;AACrB,MAAA,MAAM,MAAA,GAAS,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,CAAA,CAAA,KAAK,OAAO,CAAC,CAAC,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA;AACtD,MAAA,IAAA,GAAO,OAAO,CAAA,EAAG,IAAI,KAAK,MAAM,CAAA,CAAA,CAAA,GAAM,IAAI,MAAM,CAAA,CAAA,CAAA;AAAA,IAClD;AACA,IAAA,IAAI,QAAA,CAAS,GAAA,CAAI,GAAG,CAAA,EAAG;AACrB,MAAA,IAAA,GAAO,IAAA,GAAO,CAAA,EAAG,IAAI,CAAA,WAAA,CAAA,GAAgB,YAAA;AAAA,IACvC;AAEA,IAAA,MAAM,OAAkB,EAAE,IAAA,EAAM,QAAA,EAAU,WAAA,EAAa,QAAQ,MAAA,EAAU;AACzE,IAAA,IAAI,IAAA,CAAK,YAAY,MAAA,EAAW;AAC9B,MAAA,IAAA,CAAK,UAAU,IAAA,CAAK,OAAA;AAAA,IACtB;AAEA,IAAA,KAAA,CAAM,GAAG,CAAA,GAAI,IAAA;AAAA,EACf;AAEA,EAAA,OAAO,EAAE,OAAO,WAAA,EAAY;AAC9B;;"}
|
package/dist/package.json.cjs.js
CHANGED
|
@@ -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.
|
|
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"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-module-actions",
|
|
3
|
-
"version": "0.1.
|
|
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.
|
|
37
|
-
"@backstage/errors": "^1.3.
|
|
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.
|
|
47
|
-
"@backstage/cli": "^0.36.
|
|
46
|
+
"@backstage/backend-test-utils": "^1.11.8",
|
|
47
|
+
"@backstage/cli": "^0.36.7"
|
|
48
48
|
},
|
|
49
49
|
"typesVersions": {
|
|
50
50
|
"*": {
|