@mcp-abap-adt/auth-broker 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ Thank you to all contributors! See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the co
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [3.0.3] - 2026-09-27
15
+
16
+ ### Added
17
+
18
+ - **`help` and `version` as commands** for `mcp-auth` and `mcp-sso`: `help` / `--help` / `-h` and `version` / `--version` / `-v` — the same set in every CLI of the family, each answering before anything starts or connects. Both answered "Unknown command".
19
+
14
20
  ## [3.0.2] - 2026-09-27
15
21
 
16
22
  ### Changed
@@ -131,8 +131,8 @@ function showHelp() {
131
131
  console.log(' --assertion <base64> A SAMLResponse obtained elsewhere');
132
132
  console.log(' --assertion-flow <flow> browser|manual|assertion');
133
133
  console.log('');
134
- console.log(' --version, -v Show version number');
135
- console.log(' --help, -h Show this help message');
134
+ console.log(' version, --version, -v Show version number');
135
+ console.log(' help, --help, -h Show this help message');
136
136
  console.log('');
137
137
  console.log('Examples:');
138
138
  console.log(' # Auth code (default flow via service key)');
@@ -189,11 +189,16 @@ function showHelp() {
189
189
  }
190
190
  function parseArgs(args = process.argv.slice(2)) {
191
191
  // Handle --version and --help first
192
- if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
192
+ if (args.length === 0 ||
193
+ args[0] === 'help' ||
194
+ args.includes('--help') ||
195
+ args.includes('-h')) {
193
196
  showHelp();
194
197
  process.exit(0);
195
198
  }
196
- if (args.includes('--version') || args.includes('-v')) {
199
+ if (args[0] === 'version' ||
200
+ args.includes('--version') ||
201
+ args.includes('-v')) {
197
202
  console.log(getVersion());
198
203
  process.exit(0);
199
204
  }
@@ -401,6 +406,16 @@ function workDir() {
401
406
  }
402
407
  async function main() {
403
408
  const rawArgs = process.argv.slice(2);
409
+ // `help` and `version` as commands, like every CLI in the family; they answer
410
+ // before any subcommand is dispatched.
411
+ if (rawArgs[0] === 'help') {
412
+ showHelp();
413
+ process.exit(0);
414
+ }
415
+ if (rawArgs[0] === 'version') {
416
+ console.log(getVersion());
417
+ process.exit(0);
418
+ }
404
419
  const subcommand = rawArgs[0];
405
420
  const hasSubcommand = subcommand && !subcommand.startsWith('-') && subcommand.length > 0;
406
421
  if (hasSubcommand) {
@@ -165,8 +165,8 @@ function showHelp() {
165
165
  console.log(' also needs --idp-initiated or --authn-request-id; the browser and manual flows');
166
166
  console.log(' send their own request unless --idp-initiated is given.');
167
167
  console.log('');
168
- console.log(' --version, -v Show version number');
169
- console.log(' --help, -h Show this help message');
168
+ console.log(' version, --version, -v Show version number');
169
+ console.log(' help, --help, -h Show this help message');
170
170
  }
171
171
  function parseScopes(value) {
172
172
  if (!value)
@@ -218,11 +218,16 @@ function createCliLogger(prefix = 'SSO') {
218
218
  }
219
219
  function parseArgs() {
220
220
  let args = process.argv.slice(2);
221
- if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
221
+ if (args.length === 0 ||
222
+ args[0] === 'help' ||
223
+ args.includes('--help') ||
224
+ args.includes('-h')) {
222
225
  showHelp();
223
226
  process.exit(0);
224
227
  }
225
- if (args.includes('--version') || args.includes('-v')) {
228
+ if (args[0] === 'version' ||
229
+ args.includes('--version') ||
230
+ args.includes('-v')) {
226
231
  console.log(getVersion());
227
232
  process.exit(0);
228
233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/auth-broker",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Per-destination token broker for SAP BTP and ABAP: sessions and service keys from stores, tokens from an injected provider, results persisted - plus the mcp-auth and mcp-sso CLIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",