@backstage/cli-module-actions 0.0.0-nightly-20260321030622
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/bin/backstage-cli-module-actions +32 -0
- package/dist/commands/execute.cjs.js +86 -0
- package/dist/commands/execute.cjs.js.map +1 -0
- package/dist/commands/list.cjs.js +48 -0
- package/dist/commands/list.cjs.js.map +1 -0
- package/dist/commands/sourcesAdd.cjs.js +37 -0
- package/dist/commands/sourcesAdd.cjs.js.map +1 -0
- package/dist/commands/sourcesList.cjs.js +27 -0
- package/dist/commands/sourcesList.cjs.js.map +1 -0
- package/dist/commands/sourcesRemove.cjs.js +38 -0
- package/dist/commands/sourcesRemove.cjs.js.map +1 -0
- package/dist/index.cjs.js +40 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/lib/ActionsClient.cjs.js +58 -0
- package/dist/lib/ActionsClient.cjs.js.map +1 -0
- package/dist/lib/httpJson.cjs.js +21 -0
- package/dist/lib/httpJson.cjs.js.map +1 -0
- package/dist/lib/resolveAuth.cjs.js +22 -0
- package/dist/lib/resolveAuth.cjs.js.map +1 -0
- package/dist/lib/schemaToFlags.cjs.js +39 -0
- package/dist/lib/schemaToFlags.cjs.js.map +1 -0
- package/dist/package.json.cjs.js +82 -0
- package/dist/package.json.cjs.js.map +1 -0
- package/package.json +52 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @backstage/cli-module-actions
|
|
2
|
+
|
|
3
|
+
## 0.0.0-nightly-20260321030622
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/cli-node@0.0.0-nightly-20260321030622
|
|
9
|
+
- @backstage/errors@1.2.7
|
|
10
|
+
|
|
11
|
+
## 0.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 42960f1: Added `actions` CLI module for listing and executing actions from the distributed actions registry. Includes `actions list`, `actions execute`, and `actions sources` commands for managing plugin sources.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/cli-node@0.3.0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 The Backstage Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const path = require('node:path');
|
|
19
|
+
|
|
20
|
+
/* eslint-disable-next-line no-restricted-syntax */
|
|
21
|
+
const isLocal = require('node:fs').existsSync(
|
|
22
|
+
path.resolve(__dirname, '../src'),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
if (isLocal) {
|
|
26
|
+
require('@backstage/cli-node/config/nodeTransform.cjs');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const { runCliModule } = require('@backstage/cli-node');
|
|
30
|
+
const cliModule = require(isLocal ? '../src/index' : '..').default;
|
|
31
|
+
const pkg = require('../package.json');
|
|
32
|
+
runCliModule({ module: cliModule, name: pkg.name, version: pkg.version });
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
var ActionsClient = require('../lib/ActionsClient.cjs.js');
|
|
7
|
+
var schemaToFlags = require('../lib/schemaToFlags.cjs.js');
|
|
8
|
+
var resolveAuth = require('../lib/resolveAuth.cjs.js');
|
|
9
|
+
|
|
10
|
+
var execute = async ({ args, info }) => {
|
|
11
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
12
|
+
cleye.cli(
|
|
13
|
+
{
|
|
14
|
+
help: info,
|
|
15
|
+
parameters: ["<action-id>"],
|
|
16
|
+
flags: {
|
|
17
|
+
instance: {
|
|
18
|
+
type: String,
|
|
19
|
+
description: "Name of the instance to use"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
void 0,
|
|
24
|
+
args
|
|
25
|
+
);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const instanceIdx = args.indexOf("--instance");
|
|
29
|
+
const instanceFlag = instanceIdx !== -1 ? args[instanceIdx + 1] : void 0;
|
|
30
|
+
const skipIndices = /* @__PURE__ */ new Set();
|
|
31
|
+
if (instanceIdx !== -1) {
|
|
32
|
+
skipIndices.add(instanceIdx);
|
|
33
|
+
skipIndices.add(instanceIdx + 1);
|
|
34
|
+
}
|
|
35
|
+
let actionId;
|
|
36
|
+
let actionIdIdx = -1;
|
|
37
|
+
for (let i = 0; i < args.length; i++) {
|
|
38
|
+
if (!skipIndices.has(i) && !args[i].startsWith("-")) {
|
|
39
|
+
actionId = args[i];
|
|
40
|
+
actionIdIdx = i;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!actionId) {
|
|
45
|
+
process.stderr.write("Usage: actions execute <action-id> [flags]\n");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const { accessToken, baseUrl } = await resolveAuth.resolveAuth(instanceFlag);
|
|
49
|
+
const client = new ActionsClient.ActionsClient(baseUrl, accessToken);
|
|
50
|
+
const actions = await client.listForPlugin(actionId);
|
|
51
|
+
const action = actions.find((a) => a.id === actionId);
|
|
52
|
+
if (!action) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Action "${actionId}" not found. Run "actions list" to see available actions.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const schemaFlags = schemaToFlags.schemaToFlags(action.schema.input);
|
|
58
|
+
const flagArgs = args.filter((_, i) => i !== actionIdIdx);
|
|
59
|
+
const { flags } = cleye.cli(
|
|
60
|
+
{
|
|
61
|
+
help: info,
|
|
62
|
+
flags: {
|
|
63
|
+
instance: {
|
|
64
|
+
type: String,
|
|
65
|
+
description: "Name of the instance to use"
|
|
66
|
+
},
|
|
67
|
+
...schemaFlags
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
void 0,
|
|
71
|
+
flagArgs
|
|
72
|
+
);
|
|
73
|
+
const allFlags = flags;
|
|
74
|
+
const input = {};
|
|
75
|
+
for (const [key, value] of Object.entries(allFlags)) {
|
|
76
|
+
if (key !== "instance" && value !== void 0) {
|
|
77
|
+
input[key] = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const output = await client.execute(actionId, input);
|
|
81
|
+
process.stdout.write(`${JSON.stringify(output, null, 2)}
|
|
82
|
+
`);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.default = execute;
|
|
86
|
+
//# sourceMappingURL=execute.cjs.js.map
|
|
@@ -0,0 +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';\n\nexport default async ({ args, info }: CliCommandContext) => {\n if (args.includes('--help') || args.includes('-h')) {\n cli(\n {\n help: info,\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 return;\n }\n\n const instanceIdx = args.indexOf('--instance');\n const instanceFlag = instanceIdx !== -1 ? args[instanceIdx + 1] : undefined;\n\n // Skip flag names, flag values (the argument after a known flag), and\n // the --instance value position so we only pick up positional arguments.\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 if (!actionId) {\n process.stderr.write('Usage: actions execute <action-id> [flags]\\n');\n process.exit(1);\n }\n\n const { accessToken, baseUrl } = await resolveAuth(instanceFlag);\n\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 schemaFlags = schemaToFlags(action.schema.input as any);\n\n const flagArgs = args.filter((_, i) => i !== actionIdIdx);\n\n const { flags } = cli(\n {\n help: info,\n flags: {\n instance: {\n type: String,\n description: 'Name of the instance to use',\n },\n ...schemaFlags,\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 input[key] = value;\n }\n }\n\n const output = await client.execute(actionId, input);\n process.stdout.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Q,QAAQ,CAAA,EAAG;AACnD,IAAA,IAAI,GAAA,KAAQ,UAAA,IAAc,KAAA,KAAU,MAAA,EAAW;AAC7C,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;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
var ActionsClient = require('../lib/ActionsClient.cjs.js');
|
|
7
|
+
var resolveAuth = require('../lib/resolveAuth.cjs.js');
|
|
8
|
+
|
|
9
|
+
var list = async ({ args, info }) => {
|
|
10
|
+
const {
|
|
11
|
+
flags: { instance: instanceFlag }
|
|
12
|
+
} = cleye.cli(
|
|
13
|
+
{
|
|
14
|
+
help: info,
|
|
15
|
+
flags: {
|
|
16
|
+
instance: {
|
|
17
|
+
type: String,
|
|
18
|
+
description: "Name of the instance to use"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
void 0,
|
|
23
|
+
args
|
|
24
|
+
);
|
|
25
|
+
const { accessToken, pluginSources, baseUrl } = await resolveAuth.resolveAuth(
|
|
26
|
+
instanceFlag
|
|
27
|
+
);
|
|
28
|
+
if (!pluginSources.length) {
|
|
29
|
+
process.stderr.write(
|
|
30
|
+
'No plugin sources configured. Run "actions sources add <plugin-id>" to add one.\n'
|
|
31
|
+
);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const client = new ActionsClient.ActionsClient(baseUrl, accessToken);
|
|
35
|
+
const actions = await client.list(pluginSources);
|
|
36
|
+
if (!actions.length) {
|
|
37
|
+
process.stderr.write("No actions found.\n");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
for (const action of actions) {
|
|
41
|
+
const desc = action.description ? ` - ${action.description}` : "";
|
|
42
|
+
process.stdout.write(`${action.id}${desc}
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.default = list;
|
|
48
|
+
//# sourceMappingURL=list.cjs.js.map
|
|
@@ -0,0 +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';\n\nexport default async ({ args, info }: CliCommandContext) => {\n const {\n flags: { instance: instanceFlag },\n } = cli(\n {\n help: info,\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 actions = await client.list(pluginSources);\n\n if (!actions.length) {\n process.stderr.write('No actions found.\\n');\n return;\n }\n\n for (const action of actions) {\n const desc = action.description ? ` - ${action.description}` : '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0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
var cliNode = require('@backstage/cli-node');
|
|
7
|
+
var v3 = require('zod/v3');
|
|
8
|
+
|
|
9
|
+
const pluginSourcesSchema = v3.z.array(v3.z.string()).default([]);
|
|
10
|
+
var sourcesAdd = async ({ args, info }) => {
|
|
11
|
+
const parsed = cleye.cli(
|
|
12
|
+
{
|
|
13
|
+
help: info,
|
|
14
|
+
parameters: ["<plugin-id>"]
|
|
15
|
+
},
|
|
16
|
+
void 0,
|
|
17
|
+
args
|
|
18
|
+
);
|
|
19
|
+
const pluginId = parsed._[0];
|
|
20
|
+
const auth = await cliNode.CliAuth.create();
|
|
21
|
+
const existing = pluginSourcesSchema.parse(
|
|
22
|
+
await auth.getMetadata("pluginSources")
|
|
23
|
+
);
|
|
24
|
+
if (existing.includes(pluginId)) {
|
|
25
|
+
process.stderr.write(
|
|
26
|
+
`Plugin source "${pluginId}" is already configured.
|
|
27
|
+
`
|
|
28
|
+
);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
await auth.setMetadata("pluginSources", [...existing, pluginId]);
|
|
32
|
+
process.stdout.write(`Added plugin source "${pluginId}".
|
|
33
|
+
`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.default = sourcesAdd;
|
|
37
|
+
//# sourceMappingURL=sourcesAdd.cjs.js.map
|
|
@@ -0,0 +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 { z } from 'zod/v3';\n\nconst pluginSourcesSchema = z.array(z.string()).default([]);\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n help: info,\n parameters: ['<plugin-id>'],\n },\n undefined,\n args,\n );\n\n const pluginId = parsed._[0];\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n if (existing.includes(pluginId)) {\n process.stderr.write(\n `Plugin source \"${pluginId}\" is already configured.\\n`,\n );\n return;\n }\n\n await auth.setMetadata('pluginSources', [...existing, pluginId]);\n\n process.stdout.write(`Added plugin source \"${pluginId}\".\\n`);\n};\n"],"names":["z","cli","CliAuth"],"mappings":";;;;;;;;AAoBA,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAE1D,iBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASC,SAAA;AAAA,IACb;AAAA,MACE,IAAA,EAAM,IAAA;AAAA,MACN,UAAA,EAAY,CAAC,aAAa;AAAA,KAC5B;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,CAAA,CAAE,CAAC,CAAA;AAE3B,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAW,mBAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,IAAI,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAC/B,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,MACb,kBAAkB,QAAQ,CAAA;AAAA;AAAA,KAC5B;AACA,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,KAAK,WAAA,CAAY,eAAA,EAAiB,CAAC,GAAG,QAAA,EAAU,QAAQ,CAAC,CAAA;AAE/D,EAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,qBAAA,EAAwB,QAAQ,CAAA;AAAA,CAAM,CAAA;AAC7D,CAAA;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
var cliNode = require('@backstage/cli-node');
|
|
7
|
+
var v3 = require('zod/v3');
|
|
8
|
+
|
|
9
|
+
const pluginSourcesSchema = v3.z.array(v3.z.string()).default([]);
|
|
10
|
+
var sourcesList = async ({ args, info }) => {
|
|
11
|
+
cleye.cli({ help: info }, void 0, args);
|
|
12
|
+
const auth = await cliNode.CliAuth.create();
|
|
13
|
+
const sources = pluginSourcesSchema.parse(
|
|
14
|
+
await auth.getMetadata("pluginSources")
|
|
15
|
+
);
|
|
16
|
+
if (!sources.length) {
|
|
17
|
+
process.stderr.write("No plugin sources configured.\n");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
for (const source of sources) {
|
|
21
|
+
process.stdout.write(`${source}
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.default = sourcesList;
|
|
27
|
+
//# sourceMappingURL=sourcesList.cjs.js.map
|
|
@@ -0,0 +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 { z } from 'zod/v3';\n\nconst pluginSourcesSchema = z.array(z.string()).default([]);\n\nexport default async ({ args, info }: CliCommandContext) => {\n cli({ help: info }, 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":["z","cli","CliAuth"],"mappings":";;;;;;;;AAoBA,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAE1D,kBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAAC,SAAA,CAAI,EAAE,IAAA,EAAM,IAAA,EAAK,EAAG,QAAW,IAAI,CAAA;AAEnC,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,UAAU,mBAAA,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;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
var cliNode = require('@backstage/cli-node');
|
|
7
|
+
var v3 = require('zod/v3');
|
|
8
|
+
|
|
9
|
+
const pluginSourcesSchema = v3.z.array(v3.z.string()).default([]);
|
|
10
|
+
var sourcesRemove = async ({ args, info }) => {
|
|
11
|
+
const parsed = cleye.cli(
|
|
12
|
+
{
|
|
13
|
+
help: info,
|
|
14
|
+
parameters: ["<plugin-id>"]
|
|
15
|
+
},
|
|
16
|
+
void 0,
|
|
17
|
+
args
|
|
18
|
+
);
|
|
19
|
+
const pluginId = parsed._[0];
|
|
20
|
+
const auth = await cliNode.CliAuth.create();
|
|
21
|
+
const existing = pluginSourcesSchema.parse(
|
|
22
|
+
await auth.getMetadata("pluginSources")
|
|
23
|
+
);
|
|
24
|
+
if (!existing.includes(pluginId)) {
|
|
25
|
+
process.stderr.write(`Plugin source "${pluginId}" is not configured.
|
|
26
|
+
`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await auth.setMetadata(
|
|
30
|
+
"pluginSources",
|
|
31
|
+
existing.filter((s) => s !== pluginId)
|
|
32
|
+
);
|
|
33
|
+
process.stdout.write(`Removed plugin source "${pluginId}".
|
|
34
|
+
`);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.default = sourcesRemove;
|
|
38
|
+
//# sourceMappingURL=sourcesRemove.cjs.js.map
|
|
@@ -0,0 +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 { z } from 'zod/v3';\n\nconst pluginSourcesSchema = z.array(z.string()).default([]);\n\nexport default async ({ args, info }: CliCommandContext) => {\n const parsed = cli(\n {\n help: info,\n parameters: ['<plugin-id>'],\n },\n undefined,\n args,\n );\n\n const pluginId = parsed._[0];\n\n const auth = await CliAuth.create();\n const existing = pluginSourcesSchema.parse(\n await auth.getMetadata('pluginSources'),\n );\n\n if (!existing.includes(pluginId)) {\n process.stderr.write(`Plugin source \"${pluginId}\" is not configured.\\n`);\n return;\n }\n\n await auth.setMetadata(\n 'pluginSources',\n existing.filter(s => s !== pluginId),\n );\n\n process.stdout.write(`Removed plugin source \"${pluginId}\".\\n`);\n};\n"],"names":["z","cli","CliAuth"],"mappings":";;;;;;;;AAoBA,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAE1D,oBAAe,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,KAAyB;AAC1D,EAAA,MAAM,MAAA,GAASC,SAAA;AAAA,IACb;AAAA,MACE,IAAA,EAAM,IAAA;AAAA,MACN,UAAA,EAAY,CAAC,aAAa;AAAA,KAC5B;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,CAAA,CAAE,CAAC,CAAA;AAE3B,EAAA,MAAM,IAAA,GAAO,MAAMC,eAAA,CAAQ,MAAA,EAAO;AAClC,EAAA,MAAM,WAAW,mBAAA,CAAoB,KAAA;AAAA,IACnC,MAAM,IAAA,CAAK,WAAA,CAAY,eAAe;AAAA,GACxC;AAEA,EAAA,IAAI,CAAC,QAAA,CAAS,QAAA,CAAS,QAAQ,CAAA,EAAG;AAChC,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,eAAA,EAAkB,QAAQ,CAAA;AAAA,CAAwB,CAAA;AACvE,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,IAAA,CAAK,WAAA;AAAA,IACT,eAAA;AAAA,IACA,QAAA,CAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,KAAM,QAAQ;AAAA,GACrC;AAEA,EAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,uBAAA,EAA0B,QAAQ,CAAA;AAAA,CAAM,CAAA;AAC/D,CAAA;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cliNode = require('@backstage/cli-node');
|
|
6
|
+
var _package = require('./package.json.cjs.js');
|
|
7
|
+
|
|
8
|
+
var index = cliNode.createCliModule({
|
|
9
|
+
packageJson: _package.default,
|
|
10
|
+
init: async (reg) => {
|
|
11
|
+
reg.addCommand({
|
|
12
|
+
path: ["actions", "list"],
|
|
13
|
+
description: "List available actions from configured plugin sources",
|
|
14
|
+
execute: { loader: () => import('./commands/list.cjs.js') }
|
|
15
|
+
});
|
|
16
|
+
reg.addCommand({
|
|
17
|
+
path: ["actions", "execute"],
|
|
18
|
+
description: "Execute an action",
|
|
19
|
+
execute: { loader: () => import('./commands/execute.cjs.js') }
|
|
20
|
+
});
|
|
21
|
+
reg.addCommand({
|
|
22
|
+
path: ["actions", "sources", "add"],
|
|
23
|
+
description: "Add a plugin source for action discovery",
|
|
24
|
+
execute: { loader: () => import('./commands/sourcesAdd.cjs.js') }
|
|
25
|
+
});
|
|
26
|
+
reg.addCommand({
|
|
27
|
+
path: ["actions", "sources", "list"],
|
|
28
|
+
description: "List configured plugin sources",
|
|
29
|
+
execute: { loader: () => import('./commands/sourcesList.cjs.js') }
|
|
30
|
+
});
|
|
31
|
+
reg.addCommand({
|
|
32
|
+
path: ["actions", "sources", "remove"],
|
|
33
|
+
description: "Remove a plugin source",
|
|
34
|
+
execute: { loader: () => import('./commands/sourcesRemove.cjs.js') }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.default = index;
|
|
40
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +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,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|
|
3
|
+
var httpJson = require('./httpJson.cjs.js');
|
|
4
|
+
|
|
5
|
+
function extractPluginId(actionId) {
|
|
6
|
+
const colonIndex = actionId.indexOf(":");
|
|
7
|
+
if (colonIndex === -1) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`Invalid action ID "${actionId}". Expected format "pluginId:actionName".`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return actionId.substring(0, colonIndex);
|
|
13
|
+
}
|
|
14
|
+
function pluginActionsUrl(baseUrl, pluginId) {
|
|
15
|
+
return new URL(
|
|
16
|
+
`/api/${encodeURIComponent(pluginId)}/.backstage/actions/v1/actions`,
|
|
17
|
+
baseUrl
|
|
18
|
+
).toString();
|
|
19
|
+
}
|
|
20
|
+
class ActionsClient {
|
|
21
|
+
constructor(baseUrl, accessToken) {
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
this.accessToken = accessToken;
|
|
24
|
+
}
|
|
25
|
+
async list(pluginSources) {
|
|
26
|
+
const results = [];
|
|
27
|
+
for (const pluginId of pluginSources) {
|
|
28
|
+
const url = pluginActionsUrl(this.baseUrl, pluginId);
|
|
29
|
+
const response = await httpJson.httpJson(url, {
|
|
30
|
+
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
31
|
+
signal: AbortSignal.timeout(3e4)
|
|
32
|
+
});
|
|
33
|
+
results.push(...response.actions);
|
|
34
|
+
}
|
|
35
|
+
return results;
|
|
36
|
+
}
|
|
37
|
+
async listForPlugin(actionId) {
|
|
38
|
+
const pluginId = extractPluginId(actionId);
|
|
39
|
+
return this.list([pluginId]);
|
|
40
|
+
}
|
|
41
|
+
async execute(actionId, input) {
|
|
42
|
+
const pluginId = extractPluginId(actionId);
|
|
43
|
+
const url = `${pluginActionsUrl(
|
|
44
|
+
this.baseUrl,
|
|
45
|
+
pluginId
|
|
46
|
+
)}/${encodeURIComponent(actionId)}/invoke`;
|
|
47
|
+
const response = await httpJson.httpJson(url, {
|
|
48
|
+
method: "POST",
|
|
49
|
+
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
50
|
+
body: input ?? {},
|
|
51
|
+
signal: AbortSignal.timeout(3e4)
|
|
52
|
+
});
|
|
53
|
+
return response.output;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.ActionsClient = ActionsClient;
|
|
58
|
+
//# sourceMappingURL=ActionsClient.cjs.js.map
|
|
@@ -0,0 +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 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 class ActionsClient {\n constructor(\n private readonly baseUrl: string,\n private readonly accessToken: string,\n ) {}\n\n async list(pluginSources: string[]): Promise<ActionDef[]> {\n const results: ActionDef[] = [];\n\n for (const pluginId of pluginSources) {\n const url = pluginActionsUrl(this.baseUrl, pluginId);\n\n const response = await httpJson<ListActionsResponse>(url, {\n headers: { Authorization: `Bearer ${this.accessToken}` },\n signal: AbortSignal.timeout(30_000),\n });\n\n results.push(...response.actions);\n }\n\n return results;\n }\n\n async listForPlugin(actionId: string): Promise<ActionDef[]> {\n const pluginId = extractPluginId(actionId);\n return this.list([pluginId]);\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":";;;;AAoCA,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;AAEO,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,EAEH,MAAM,KAAK,aAAA,EAA+C;AACxD,IAAA,MAAM,UAAuB,EAAC;AA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A;AAAA,EAClB;AACF;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors = require('@backstage/errors');
|
|
4
|
+
|
|
5
|
+
async function httpJson(url, init) {
|
|
6
|
+
const res = await fetch(url, {
|
|
7
|
+
...init,
|
|
8
|
+
body: init?.body ? JSON.stringify(init.body) : void 0,
|
|
9
|
+
headers: {
|
|
10
|
+
...init?.body ? { "Content-Type": "application/json" } : {},
|
|
11
|
+
...init?.headers
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
if (!res.ok) {
|
|
15
|
+
throw await errors.ResponseError.fromResponse(res);
|
|
16
|
+
}
|
|
17
|
+
return await res.json();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.httpJson = httpJson;
|
|
21
|
+
//# sourceMappingURL=httpJson.cjs.js.map
|
|
@@ -0,0 +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 throw await ResponseError.fromResponse(res);\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,MAAMA,oBAAA,CAAc,YAAA,CAAa,GAAG,CAAA;AAAA,EAC5C;AACA,EAAA,OAAQ,MAAM,IAAI,IAAA,EAAK;AACzB;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var cliNode = require('@backstage/cli-node');
|
|
4
|
+
var v3 = require('zod/v3');
|
|
5
|
+
|
|
6
|
+
const pluginSourcesSchema = v3.z.array(v3.z.string()).default([]);
|
|
7
|
+
async function resolveAuth(instanceFlag) {
|
|
8
|
+
const auth = await cliNode.CliAuth.create({ instanceName: instanceFlag });
|
|
9
|
+
const accessToken = await auth.getAccessToken();
|
|
10
|
+
const pluginSources = pluginSourcesSchema.parse(
|
|
11
|
+
await auth.getMetadata("pluginSources")
|
|
12
|
+
);
|
|
13
|
+
return {
|
|
14
|
+
baseUrl: auth.getBaseUrl(),
|
|
15
|
+
instanceName: auth.getInstanceName(),
|
|
16
|
+
accessToken,
|
|
17
|
+
pluginSources
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.resolveAuth = resolveAuth;
|
|
22
|
+
//# sourceMappingURL=resolveAuth.cjs.js.map
|
|
@@ -0,0 +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 { z } from 'zod/v3';\n\nconst pluginSourcesSchema = z.array(z.string()).default([]);\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":["z","CliAuth"],"mappings":";;;;;AAmBA,MAAM,mBAAA,GAAsBA,KAAE,KAAA,CAAMA,IAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAE1D,eAAsB,YAAY,YAAA,EAK/B;AACD,EAAA,MAAM,OAAO,MAAMC,eAAA,CAAQ,OAAO,EAAE,YAAA,EAAc,cAAc,CAAA;AAChE,EAAA,MAAM,WAAA,GAAc,MAAM,IAAA,CAAK,cAAA,EAAe;AAC9C,EAAA,MAAM,gBAAgB,mBAAA,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,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function schemaToFlags(schema) {
|
|
4
|
+
const flags = {};
|
|
5
|
+
const required = new Set(schema.required ?? []);
|
|
6
|
+
if (!schema.properties) {
|
|
7
|
+
return flags;
|
|
8
|
+
}
|
|
9
|
+
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
10
|
+
const rawType = Array.isArray(prop.type) ? prop.type[0] : prop.type;
|
|
11
|
+
let flagType;
|
|
12
|
+
if (rawType === "string") {
|
|
13
|
+
flagType = String;
|
|
14
|
+
} else if (rawType === "number" || rawType === "integer") {
|
|
15
|
+
flagType = Number;
|
|
16
|
+
} else if (rawType === "boolean") {
|
|
17
|
+
flagType = Boolean;
|
|
18
|
+
} else {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
let desc = prop.description ?? "";
|
|
22
|
+
if (prop.enum?.length) {
|
|
23
|
+
const values = prop.enum.map((v) => String(v)).join(", ");
|
|
24
|
+
desc = desc ? `${desc} [${values}]` : `[${values}]`;
|
|
25
|
+
}
|
|
26
|
+
if (required.has(key)) {
|
|
27
|
+
desc = desc ? `${desc} (required)` : "(required)";
|
|
28
|
+
}
|
|
29
|
+
const flag = { type: flagType, description: desc || void 0 };
|
|
30
|
+
if (prop.default !== void 0) {
|
|
31
|
+
flag.default = prop.default;
|
|
32
|
+
}
|
|
33
|
+
flags[key] = flag;
|
|
34
|
+
}
|
|
35
|
+
return flags;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.schemaToFlags = schemaToFlags;
|
|
39
|
+
//# sourceMappingURL=schemaToFlags.cjs.js.map
|
|
@@ -0,0 +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};\n\ntype JsonSchemaObject = {\n properties?: Record<string, JsonSchemaProperty>;\n required?: string[];\n};\n\ntype CleyeFlag = {\n type: StringConstructor | NumberConstructor | BooleanConstructor;\n description?: string;\n default?: unknown;\n};\n\nexport function schemaToFlags(\n schema: JsonSchemaObject,\n): Record<string, CleyeFlag> {\n const flags: Record<string, CleyeFlag> = {};\n const required = new Set(schema.required ?? []);\n\n if (!schema.properties) {\n return flags;\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\n let flagType: StringConstructor | NumberConstructor | BooleanConstructor;\n if (rawType === 'string') {\n flagType = String;\n } else if (rawType === 'number' || rawType === 'integer') {\n flagType = Number;\n } else if (rawType === 'boolean') {\n flagType = Boolean;\n } else {\n continue;\n }\n\n let desc = prop.description ?? '';\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;\n}\n"],"names":[],"mappings":";;AAkCO,SAAS,cACd,MAAA,EAC2B;AAC3B,EAAA,MAAM,QAAmC,EAAC;AAC1C,EAAA,MAAM,WAAW,IAAI,GAAA,CAAI,MAAA,CAAO,QAAA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AAA,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,KAAA;AACT;;;;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var name = "@backstage/cli-module-actions";
|
|
6
|
+
var version = "0.0.0-nightly-20260321030622";
|
|
7
|
+
var description = "CLI module for executing distributed actions";
|
|
8
|
+
var backstage = {
|
|
9
|
+
role: "cli-module"
|
|
10
|
+
};
|
|
11
|
+
var publishConfig = {
|
|
12
|
+
access: "public",
|
|
13
|
+
main: "dist/index.cjs.js",
|
|
14
|
+
types: "dist/index.d.ts"
|
|
15
|
+
};
|
|
16
|
+
var homepage = "https://backstage.io";
|
|
17
|
+
var repository = {
|
|
18
|
+
type: "git",
|
|
19
|
+
url: "https://github.com/backstage/backstage",
|
|
20
|
+
directory: "packages/cli-module-actions"
|
|
21
|
+
};
|
|
22
|
+
var license = "Apache-2.0";
|
|
23
|
+
var main = "src/index.ts";
|
|
24
|
+
var types = "src/index.ts";
|
|
25
|
+
var files = [
|
|
26
|
+
"dist",
|
|
27
|
+
"bin"
|
|
28
|
+
];
|
|
29
|
+
var bin = "bin/backstage-cli-module-actions";
|
|
30
|
+
var scripts = {
|
|
31
|
+
build: "backstage-cli package build",
|
|
32
|
+
clean: "backstage-cli package clean",
|
|
33
|
+
lint: "backstage-cli package lint",
|
|
34
|
+
prepack: "backstage-cli package prepack",
|
|
35
|
+
postpack: "backstage-cli package postpack",
|
|
36
|
+
test: "backstage-cli package test"
|
|
37
|
+
};
|
|
38
|
+
var dependencies = {
|
|
39
|
+
"@backstage/cli-node": "workspace:*",
|
|
40
|
+
"@backstage/errors": "workspace:*",
|
|
41
|
+
cleye: "^2.3.0",
|
|
42
|
+
zod: "^3.25.76 || ^4.0.0"
|
|
43
|
+
};
|
|
44
|
+
var devDependencies = {
|
|
45
|
+
"@backstage/backend-test-utils": "workspace:*",
|
|
46
|
+
"@backstage/cli": "workspace:*"
|
|
47
|
+
};
|
|
48
|
+
var packageJson = {
|
|
49
|
+
name: name,
|
|
50
|
+
version: version,
|
|
51
|
+
description: description,
|
|
52
|
+
backstage: backstage,
|
|
53
|
+
publishConfig: publishConfig,
|
|
54
|
+
homepage: homepage,
|
|
55
|
+
repository: repository,
|
|
56
|
+
license: license,
|
|
57
|
+
main: main,
|
|
58
|
+
types: types,
|
|
59
|
+
files: files,
|
|
60
|
+
bin: bin,
|
|
61
|
+
scripts: scripts,
|
|
62
|
+
dependencies: dependencies,
|
|
63
|
+
devDependencies: devDependencies
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.backstage = backstage;
|
|
67
|
+
exports.bin = bin;
|
|
68
|
+
exports.default = packageJson;
|
|
69
|
+
exports.dependencies = dependencies;
|
|
70
|
+
exports.description = description;
|
|
71
|
+
exports.devDependencies = devDependencies;
|
|
72
|
+
exports.files = files;
|
|
73
|
+
exports.homepage = homepage;
|
|
74
|
+
exports.license = license;
|
|
75
|
+
exports.main = main;
|
|
76
|
+
exports.name = name;
|
|
77
|
+
exports.publishConfig = publishConfig;
|
|
78
|
+
exports.repository = repository;
|
|
79
|
+
exports.scripts = scripts;
|
|
80
|
+
exports.types = types;
|
|
81
|
+
exports.version = version;
|
|
82
|
+
//# sourceMappingURL=package.json.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage/cli-module-actions",
|
|
3
|
+
"version": "0.0.0-nightly-20260321030622",
|
|
4
|
+
"description": "CLI module for executing distributed actions",
|
|
5
|
+
"backstage": {
|
|
6
|
+
"role": "cli-module"
|
|
7
|
+
},
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"main": "dist/index.cjs.js",
|
|
11
|
+
"types": "dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://backstage.io",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/backstage/backstage",
|
|
17
|
+
"directory": "packages/cli-module-actions"
|
|
18
|
+
},
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"main": "dist/index.cjs.js",
|
|
21
|
+
"types": "dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"bin"
|
|
25
|
+
],
|
|
26
|
+
"bin": "bin/backstage-cli-module-actions",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "backstage-cli package build",
|
|
29
|
+
"clean": "backstage-cli package clean",
|
|
30
|
+
"lint": "backstage-cli package lint",
|
|
31
|
+
"prepack": "backstage-cli package prepack",
|
|
32
|
+
"postpack": "backstage-cli package postpack",
|
|
33
|
+
"test": "backstage-cli package test"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@backstage/cli-node": "0.0.0-nightly-20260321030622",
|
|
37
|
+
"@backstage/errors": "1.2.7",
|
|
38
|
+
"cleye": "^2.3.0",
|
|
39
|
+
"zod": "^3.25.76 || ^4.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@backstage/backend-test-utils": "0.0.0-nightly-20260321030622",
|
|
43
|
+
"@backstage/cli": "0.0.0-nightly-20260321030622"
|
|
44
|
+
},
|
|
45
|
+
"typesVersions": {
|
|
46
|
+
"*": {
|
|
47
|
+
"package.json": [
|
|
48
|
+
"package.json"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|