hac-client-cli 0.3.1__tar.gz → 0.3.2__tar.gz

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.
Files changed (19) hide show
  1. {hac_client_cli-0.3.1/src/hac_client_cli.egg-info → hac_client_cli-0.3.2}/PKG-INFO +1 -1
  2. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/pyproject.toml +1 -1
  3. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_session.py +24 -22
  4. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2/src/hac_client_cli.egg-info}/PKG-INFO +1 -1
  5. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/LICENSE +0 -0
  6. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/README.md +0 -0
  7. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/setup.cfg +0 -0
  8. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/__init__.py +0 -0
  9. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/app.py +0 -0
  10. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_endpoint.py +0 -0
  11. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_env.py +0 -0
  12. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_update.py +0 -0
  13. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/config_loader.py +0 -0
  14. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli/environment_manager.py +0 -0
  15. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/SOURCES.txt +0 -0
  16. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/dependency_links.txt +0 -0
  17. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/entry_points.txt +0 -0
  18. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/requires.txt +0 -0
  19. {hac_client_cli-0.3.1 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hac-client-cli
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: CLI for SAP Commerce HAC (Hybris Administration Console)
5
5
  Author: SapCommerceTools
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hac-client-cli"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "CLI for SAP Commerce HAC (Hybris Administration Console)"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -306,25 +306,23 @@ def list_sessions(
306
306
  @session_app.command("show")
307
307
  def show_session(
308
308
  environment: str = typer.Argument(..., help="Environment name"),
309
+ endpoint: Optional[str] = typer.Option(None, "--endpoint", "-n", help="Endpoint name (uses default if not specified)"),
309
310
  json_output: bool = typer.Option(False, "--json", help="Output as JSON")
310
311
  ):
311
312
  """Show details of a specific session."""
312
313
  try:
313
- from hac_client_cli.environment_manager import EnvironmentManager
314
+ from hac_client_cli.config_loader import get_endpoint_config
314
315
  from hac_client_core.session import SessionManager
315
316
 
316
- env_manager = EnvironmentManager()
317
- env = env_manager.get_environment(environment)
318
-
319
- if not env:
320
- print(f"ERROR: Environment '{environment}' not found", file=sys.stderr)
321
- raise typer.Exit(1)
322
-
317
+ env_name, endpoint_name, ep_config = get_endpoint_config(environment, endpoint)
318
+ session_id = f"{env_name}/{endpoint_name}"
319
+
323
320
  session_manager = SessionManager()
324
- session = session_manager.load_session(env.url, env.username, environment)
321
+ sessions = session_manager.list_sessions()
322
+ session = next((s for s in sessions if s.environment == session_id), None)
325
323
 
326
324
  if not session:
327
- print(f"No active session for environment '{environment}'")
325
+ print(f"No active session for environment '{session_id}'")
328
326
  return
329
327
 
330
328
  if json_output:
@@ -367,24 +365,28 @@ def show_session(
367
365
 
368
366
  @session_app.command("clear")
369
367
  def clear_session(
370
- environment: str = typer.Argument(..., help="Environment name")
368
+ environment: str = typer.Argument(..., help="Environment name"),
369
+ endpoint: Optional[str] = typer.Option(None, "--endpoint", "-n", help="Endpoint name (uses default if not specified)")
371
370
  ):
372
371
  """Clear session for a specific environment."""
373
372
  try:
374
- from hac_client_cli.environment_manager import EnvironmentManager
373
+ from hac_client_cli.config_loader import get_endpoint_config
375
374
  from hac_client_core.session import SessionManager
376
375
 
377
- env_manager = EnvironmentManager()
378
- env = env_manager.get_environment(environment)
379
-
380
- if not env:
381
- print(f"ERROR: Environment '{environment}' not found", file=sys.stderr)
382
- raise typer.Exit(1)
383
-
376
+ env_name, endpoint_name, ep_config = get_endpoint_config(environment, endpoint)
377
+ session_id = f"{env_name}/{endpoint_name}"
378
+
384
379
  session_manager = SessionManager()
385
- session_manager.remove_session(env.url, env.username, environment)
386
-
387
- print(f"Session cleared for environment '{environment}'")
380
+ sessions = session_manager.list_sessions()
381
+ session = next((s for s in sessions if s.environment == session_id), None)
382
+
383
+ if not session:
384
+ print(f"No active session for environment '{session_id}'")
385
+ return
386
+
387
+ session_manager.remove_session(session.base_url, session.username, session_id)
388
+
389
+ print(f"Session cleared for environment '{session_id}'")
388
390
 
389
391
  except Exception as e:
390
392
  print(f"ERROR: {e}", file=sys.stderr)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hac-client-cli
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: CLI for SAP Commerce HAC (Hybris Administration Console)
5
5
  Author: SapCommerceTools
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes