sweatstack-cli 0.12.1__py3-none-any.whl → 0.13.0__py3-none-any.whl
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.
- sweatstack_cli/commands/app.py +6 -0
- sweatstack_cli/commands/page.py +3 -11
- sweatstack_cli/go_live.py +45 -0
- {sweatstack_cli-0.12.1.dist-info → sweatstack_cli-0.13.0.dist-info}/METADATA +1 -1
- {sweatstack_cli-0.12.1.dist-info → sweatstack_cli-0.13.0.dist-info}/RECORD +7 -6
- {sweatstack_cli-0.12.1.dist-info → sweatstack_cli-0.13.0.dist-info}/WHEEL +0 -0
- {sweatstack_cli-0.12.1.dist-info → sweatstack_cli-0.13.0.dist-info}/entry_points.txt +0 -0
sweatstack_cli/commands/app.py
CHANGED
|
@@ -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(
|
sweatstack_cli/commands/page.py
CHANGED
|
@@ -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
|
-
#
|
|
200
|
-
|
|
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')}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sweatstack-cli
|
|
3
|
-
Version: 0.
|
|
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
|
|
@@ -2,6 +2,7 @@ sweatstack_cli/__init__.py,sha256=FalqkgMa69vADPpNY76Cztq5oiLgzRNVlhaR4itdZ78,46
|
|
|
2
2
|
sweatstack_cli/config.py,sha256=cD4OXnVAKVagYazyk9Cw-WWx62tJPqcjQt1cknYyymM,706
|
|
3
3
|
sweatstack_cli/console.py,sha256=69KWAM7ksnYRTONMYTXGXN4LWRAQhRxcLXO0LcWGLqo,300
|
|
4
4
|
sweatstack_cli/exceptions.py,sha256=VKV6KVhztfGRmj5jLKnqY0PEBD1qJGEg1ePuKY9rn_o,1334
|
|
5
|
+
sweatstack_cli/go_live.py,sha256=6-WjN9jyfLnbLXs0eAEX0NkwWeigf1A7BYVGG6W092w,1855
|
|
5
6
|
sweatstack_cli/main.py,sha256=obcF1VGhwcE_pI1BwTJkY4J4BgIGac-y3yYGvY6ZOp8,2330
|
|
6
7
|
sweatstack_cli/project.py,sha256=yUpkrEbPD2c0lu8IKw88aQrkFtksLHMjmgHlaqKVQUo,3660
|
|
7
8
|
sweatstack_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -14,13 +15,13 @@ sweatstack_cli/auth/jwt.py,sha256=Ja6ccFyRKtX5MPjFdHNavVYf8KTz0MYT86StbnF-cwg,15
|
|
|
14
15
|
sweatstack_cli/auth/pkce.py,sha256=sO_xUeN1UIvXKX0yEIGgMTIIzvfCOCUwlyNAveEd16k,1542
|
|
15
16
|
sweatstack_cli/auth/tokens.py,sha256=kc8ytoO9PAyjLD6wUTIagVuP7_ia5ZjW5m_WjXIRIkA,4942
|
|
16
17
|
sweatstack_cli/commands/__init__.py,sha256=YCO8wYVvdGeoEI0p_oUm8ANLneuET4SHsKDjitMjAgY,35
|
|
17
|
-
sweatstack_cli/commands/app.py,sha256=
|
|
18
|
+
sweatstack_cli/commands/app.py,sha256=90AwUm5RhagE5tZww77Fk9B0vpZFlC59OlylGXTxWC0,9055
|
|
18
19
|
sweatstack_cli/commands/auth.py,sha256=kkSZoWFTUw9Mo30FA_bOJxduWC1nuvkl_m1qtrtSj4I,3905
|
|
19
|
-
sweatstack_cli/commands/page.py,sha256=
|
|
20
|
+
sweatstack_cli/commands/page.py,sha256=G58KEsiCeq4hD0Z5ot2g9W6vBH6iZu-lCvdA1kzep-U,24612
|
|
20
21
|
sweatstack_cli/services/__init__.py,sha256=pFrcjumdHNRU8aa3bxplq4jhCivH2YGGqkGG8yIMv20,337
|
|
21
22
|
sweatstack_cli/services/applications.py,sha256=VToXlk48kn2-39eTdDf_hSJUdZqkJjCFoDaqf6DpdGA,4428
|
|
22
23
|
sweatstack_cli/templates/page/index.html,sha256=vOnZnIstf252XLiQ6GBznVp5dSy5SqpSwRUfJT43bbQ,17374
|
|
23
|
-
sweatstack_cli-0.
|
|
24
|
-
sweatstack_cli-0.
|
|
25
|
-
sweatstack_cli-0.
|
|
26
|
-
sweatstack_cli-0.
|
|
24
|
+
sweatstack_cli-0.13.0.dist-info/METADATA,sha256=D0md2zThfT3J3yDShj0E9bO93viZqYoT6gEoZH55YhI,5531
|
|
25
|
+
sweatstack_cli-0.13.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
26
|
+
sweatstack_cli-0.13.0.dist-info/entry_points.txt,sha256=rnH0EV1U9CQlmKQcJ7RmxGpNRTa9J-YdiIJZDYrAXb4,56
|
|
27
|
+
sweatstack_cli-0.13.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|