sweatstack-cli 0.12.1__tar.gz → 0.13.0__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 (63) hide show
  1. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/CHANGELOG.md +11 -0
  2. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/PKG-INFO +1 -1
  3. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/pyproject.toml +1 -1
  4. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/commands/app.py +6 -0
  5. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/commands/page.py +3 -11
  6. sweatstack_cli-0.13.0/src/sweatstack_cli/go_live.py +45 -0
  7. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/test_app.py +17 -0
  8. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/test_page_deploy.py +58 -0
  9. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/settings.local.json +0 -0
  10. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/SKILL.md +0 -0
  11. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/api.md +0 -0
  12. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/auth.md +0 -0
  13. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/cli.md +0 -0
  14. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/pyscript.md +0 -0
  15. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.claude/skills/sweatstack/webapp.md +0 -0
  16. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.gitignore +0 -0
  17. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/.python-version +0 -0
  18. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/CREATE_PRIVATE_APP.md +0 -0
  19. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/DEVELOPMENT.md +0 -0
  20. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/Makefile +0 -0
  21. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/PLAN.md +0 -0
  22. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/README.md +0 -0
  23. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/plans/001-page-init-command.md +0 -0
  24. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/__init__.py +0 -0
  25. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/api/__init__.py +0 -0
  26. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/api/client.py +0 -0
  27. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/auth/__init__.py +0 -0
  28. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/auth/callback_server.py +0 -0
  29. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/auth/jwt.py +0 -0
  30. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/auth/pkce.py +0 -0
  31. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/auth/tokens.py +0 -0
  32. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/commands/__init__.py +0 -0
  33. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/commands/auth.py +0 -0
  34. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/config.py +0 -0
  35. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/console.py +0 -0
  36. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/exceptions.py +0 -0
  37. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/main.py +0 -0
  38. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/project.py +0 -0
  39. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/py.typed +0 -0
  40. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/services/__init__.py +0 -0
  41. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/services/applications.py +0 -0
  42. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/templates/page/index.html +0 -0
  43. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/src/sweatstack_cli/version_check.py +0 -0
  44. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/sweatstack.toml +0 -0
  45. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/__init__.py +0 -0
  46. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/conftest.py +0 -0
  47. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_api/__init__.py +0 -0
  48. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_api/test_client.py +0 -0
  49. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_auth/__init__.py +0 -0
  50. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_auth/test_callback_server.py +0 -0
  51. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_auth/test_jwt.py +0 -0
  52. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_auth/test_pkce.py +0 -0
  53. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_auth/test_tokens.py +0 -0
  54. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/__init__.py +0 -0
  55. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/test_auth.py +0 -0
  56. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/test_cli.py +0 -0
  57. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_commands/test_page_init.py +0 -0
  58. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_project.py +0 -0
  59. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_services/__init__.py +0 -0
  60. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_services/test_applications.py +0 -0
  61. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_version.py +0 -0
  62. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/tests/test_version_check.py +0 -0
  63. {sweatstack_cli-0.12.1 → sweatstack_cli-0.13.0}/uv.lock +0 -0
@@ -4,6 +4,17 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.13.0] - 2026-10-15
8
+
9
+ ### Changed
10
+
11
+ - `page deploy` prints what the app still needs before anyone else can connect,
12
+ as the server reports it (`go_live_missing`), and links to the app's Consent
13
+ screen, where it goes live. It used to print a bare `/publish` link, which only
14
+ ever said the app was private.
15
+ - `app create` points to the app's overview as the next step and lists what is
16
+ missing before anyone else can connect.
17
+
7
18
  ## [0.12.1] - 2026-10-13
8
19
 
9
20
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sweatstack-cli
3
- Version: 0.12.1
3
+ Version: 0.13.0
4
4
  Summary: Command-line interface for SweatStack — the sports data platform for developers
5
5
  Project-URL: Homepage, https://sweatstack.no
6
6
  Project-URL: Documentation, https://docs.sweatstack.no
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sweatstack-cli"
3
- version = "0.12.1"
3
+ version = "0.13.0"
4
4
  description = "Command-line interface for SweatStack — the sports data platform for developers"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Aart Goossens", email = "aart@sweatstack.no" }]
@@ -12,6 +12,7 @@ import typer
12
12
  from sweatstack_cli.api import APIClient
13
13
  from sweatstack_cli.console import console, stderr_console
14
14
  from sweatstack_cli.exceptions import APIError, AuthenticationError
15
+ from sweatstack_cli.go_live import app_url, print_go_live
15
16
  from sweatstack_cli.project import CONFIG_FILENAME, write_config
16
17
  from sweatstack_cli.services.applications import create_application
17
18
 
@@ -198,6 +199,11 @@ def _print_app_created(result: dict[str, str], env_path: Path | None, config_pat
198
199
  console.print()
199
200
  console.print("[yellow]Save the secret now — it won't be shown again.[/yellow]")
200
201
 
202
+ console.print()
203
+ console.print("Next: authorize with your own account. The app's overview walks you through it:")
204
+ console.print(f" {app_url(result['id'])}")
205
+ print_go_live(result)
206
+
201
207
 
202
208
  @app.command()
203
209
  def link(
@@ -16,9 +16,9 @@ import typer
16
16
  from rich.progress import Progress, SpinnerColumn, TextColumn
17
17
 
18
18
  from sweatstack_cli.api import APIClient
19
- from sweatstack_cli.config import get_settings
20
19
  from sweatstack_cli.console import console
21
20
  from sweatstack_cli.exceptions import APIError, AuthenticationError
21
+ from sweatstack_cli.go_live import print_go_live
22
22
  from sweatstack_cli.project import CONFIG_FILENAME, ProjectConfig, update_config, write_config
23
23
  from sweatstack_cli.services.applications import (
24
24
  APPLICATION_HAS_PAGE_CODE,
@@ -196,16 +196,8 @@ def deploy(
196
196
  console.print(f" Files: {file_count}")
197
197
  console.print(f" URL: {result.get('url', 'N/A')}")
198
198
 
199
- # Nudge to publish if app is private
200
- application = result.get("application", {})
201
- if application.get("is_private"):
202
- app_id = application.get("id")
203
- if app_id:
204
- base_url = get_settings().api_url
205
- console.print()
206
- console.print("Your app is private. Ready to go public?")
207
- publish_url = f"{base_url}/applications/{app_id}/publish"
208
- console.print(f" {publish_url}")
199
+ # What the app still needs before anyone else can connect, as the server reports it.
200
+ print_go_live(result.get("application") or {}, on_pages=True)
209
201
 
210
202
 
211
203
  def _upload(
@@ -0,0 +1,45 @@
1
+ """What an app still needs before anyone else can connect, as the CLI prints it.
2
+
3
+ The server decides: `go_live_missing` on the application in an API response is the same
4
+ checklist the web app's pages show (SweatStack plan 080). The CLI only prints it and links to
5
+ the page where each item is filled in, so a terminal, an agent and the browser agree.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from typing import Any
11
+
12
+ from sweatstack_cli.config import get_settings
13
+ from sweatstack_cli.console import console
14
+
15
+
16
+ def app_url(application_id: str, tab: str = "") -> str:
17
+ """The application's page in the web app, or one of its tabs."""
18
+ return f"{get_settings().api_url}/applications/{application_id}{tab}"
19
+
20
+
21
+ def print_go_live(application: dict[str, Any], *, on_pages: bool = False) -> None:
22
+ """Print what stands between `application` and anyone else connecting, or nothing when the
23
+ app is ready. A server older than the checklist sends only `is_private`; then the CLI says
24
+ that much and links to the same page."""
25
+ application_id = application.get("id")
26
+ if not application_id:
27
+ return
28
+ missing = [item["label"] for item in application.get("go_live_missing") or []]
29
+ private = bool(application.get("is_private"))
30
+ if not missing and not private:
31
+ return
32
+
33
+ console.print()
34
+ if private:
35
+ console.print("Your app is private: only you can connect.")
36
+ else:
37
+ console.print("Your app is public, but anyone else is turned away until you add:")
38
+ if missing:
39
+ if private:
40
+ console.print("Before anyone else can, add:")
41
+ for label in missing:
42
+ console.print(f" - {label}")
43
+ if private and on_pages:
44
+ console.print("Runs entirely in the browser? The Pages fast track fills in most of it.")
45
+ console.print(f" {app_url(application_id, '/consent')}")
@@ -44,6 +44,23 @@ class TestAppCreate:
44
44
  json={"name": "Test App"},
45
45
  )
46
46
 
47
+ def test_create_points_to_the_next_step(self, mock_api: MagicMock, tmp_path: Path) -> None:
48
+ """The app's overview walks the developer from here (SweatStack plan 080)."""
49
+ mock_api.post.return_value = {
50
+ "name": "Test App",
51
+ "id": "abc123",
52
+ "is_private": True,
53
+ "go_live_missing": [{"field": "description", "label": "description"}],
54
+ }
55
+
56
+ with runner.isolated_filesystem(temp_dir=tmp_path):
57
+ result = runner.invoke(app, ["app", "create", "Test App"])
58
+
59
+ assert result.exit_code == 0, result.output
60
+ assert "Next: authorize with your own account" in result.stdout
61
+ assert "/applications/abc123\n" in result.stdout
62
+ assert " - description" in result.stdout
63
+
47
64
  def test_create_with_page(self, mock_api: MagicMock, tmp_path: Path) -> None:
48
65
  """Should create an app with page association."""
49
66
  mock_api.post.return_value = {
@@ -153,3 +153,61 @@ class TestDeployCreatesAppWhenUnlinked:
153
153
  assert result.exit_code == 1
154
154
  mock_api.post.assert_not_called()
155
155
  assert not Path("sweatstack.toml").exists()
156
+
157
+
158
+ class TestDeployPrintsWhatIsMissing:
159
+ """After a deploy the CLI prints the server's go-live checklist (SweatStack plan 080)."""
160
+
161
+ def _deploy(self, mock_api: MagicMock, application: dict) -> str:
162
+ mock_api.put.return_value = {**DEPLOYED, "application": application}
163
+ result = runner.invoke(app, ["page", "deploy", "my-page", "--dir", "public"])
164
+ assert result.exit_code == 0, result.output
165
+ return result.output
166
+
167
+ def test_a_private_app_lists_the_fields_and_the_consent_screen(
168
+ self, mock_api: MagicMock, site: Path
169
+ ) -> None:
170
+ output = self._deploy(
171
+ mock_api,
172
+ {
173
+ "id": "app_123",
174
+ "name": "My App",
175
+ "is_private": True,
176
+ "go_live_missing": [
177
+ {"field": "description", "label": "description"},
178
+ {"field": "purpose.activities", "label": "purpose for Activities"},
179
+ ],
180
+ },
181
+ )
182
+ assert "Your app is private" in output
183
+ assert " - description\n - purpose for Activities" in output
184
+ assert "Pages fast track" in output
185
+ assert "/applications/app_123/consent" in output
186
+ assert "/publish" not in output
187
+
188
+ def test_a_public_app_missing_a_purpose_says_who_is_turned_away(
189
+ self, mock_api: MagicMock, site: Path
190
+ ) -> None:
191
+ output = self._deploy(
192
+ mock_api,
193
+ {
194
+ "id": "app_123",
195
+ "name": "My App",
196
+ "is_private": False,
197
+ "go_live_missing": [{"field": "purpose.wellness", "label": "purpose for Wellness"}],
198
+ },
199
+ )
200
+ assert "turned away until you add" in output and "purpose for Wellness" in output
201
+
202
+ def test_a_ready_app_prints_nothing_extra(self, mock_api: MagicMock, site: Path) -> None:
203
+ output = self._deploy(
204
+ mock_api,
205
+ {"id": "app_123", "name": "My App", "is_private": False, "go_live_missing": []},
206
+ )
207
+ assert "/consent" not in output
208
+
209
+ def test_an_older_server_without_the_checklist_still_links(
210
+ self, mock_api: MagicMock, site: Path
211
+ ) -> None:
212
+ output = self._deploy(mock_api, {"id": "app_123", "name": "My App", "is_private": True})
213
+ assert "Your app is private" in output and "/applications/app_123/consent" in output
File without changes
File without changes