sovaria-cli 0.8.0__tar.gz → 0.8.3__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 (105) hide show
  1. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/PKG-INFO +3 -3
  2. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/__init__.py +1 -1
  3. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/auth_product.py +2 -2
  4. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/context.py +4 -2
  5. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/db.py +10 -0
  6. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/deploy.py +9 -0
  7. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/storage.py +66 -7
  8. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/premium_display.py +1 -1
  9. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/pyproject.toml +3 -3
  10. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/.gitignore +0 -0
  11. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/README.md +0 -0
  12. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/__init__.py +0 -0
  13. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/__init__.py +0 -0
  14. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/admin.py +0 -0
  15. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/ai_credits.py +0 -0
  16. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/ai_data.py +0 -0
  17. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/alerts.py +0 -0
  18. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/analytics.py +0 -0
  19. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/api.py +0 -0
  20. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/api_versions.py +0 -0
  21. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/audit.py +0 -0
  22. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/auth_enterprise.py +0 -0
  23. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/auth_settings.py +0 -0
  24. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/billing.py +0 -0
  25. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/branches.py +0 -0
  26. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/builds.py +0 -0
  27. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/chrono.py +0 -0
  28. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/collections.py +0 -0
  29. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/compliance.py +0 -0
  30. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/connect.py +0 -0
  31. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/crashes.py +0 -0
  32. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/dashboard.py +0 -0
  33. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/data.py +0 -0
  34. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/distribute.py +0 -0
  35. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/env.py +0 -0
  36. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/experiments.py +0 -0
  37. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/fn_platform.py +0 -0
  38. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/frontends.py +0 -0
  39. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/gen.py +0 -0
  40. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/governance.py +0 -0
  41. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/hosting.py +0 -0
  42. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/iam.py +0 -0
  43. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/import_cmd.py +0 -0
  44. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/init_cmd.py +0 -0
  45. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/inspect.py +0 -0
  46. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/integrations.py +0 -0
  47. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/keys.py +0 -0
  48. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/knowledge.py +0 -0
  49. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/link_cmd.py +0 -0
  50. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/local.py +0 -0
  51. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/login.py +0 -0
  52. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/logs.py +0 -0
  53. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/mcp.py +0 -0
  54. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/messaging.py +0 -0
  55. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/metrics.py +0 -0
  56. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/oidc_providers.py +0 -0
  57. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/org.py +0 -0
  58. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/org_key.py +0 -0
  59. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/orgs_projects.py +0 -0
  60. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/passkeys.py +0 -0
  61. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/perf.py +0 -0
  62. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/policy.py +0 -0
  63. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/project.py +0 -0
  64. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/push.py +0 -0
  65. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/queues.py +0 -0
  66. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/realtime.py +0 -0
  67. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/remote_config.py +0 -0
  68. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/rules.py +0 -0
  69. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/schema.py +0 -0
  70. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/scope.py +0 -0
  71. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/secrets.py +0 -0
  72. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/shell.py +0 -0
  73. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/sim.py +0 -0
  74. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/simulate.py +0 -0
  75. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/templates.py +0 -0
  76. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/test_cmd.py +0 -0
  77. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/vector.py +0 -0
  78. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/commands/wallet.py +0 -0
  79. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/local/docker-compose.yml +0 -0
  80. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/local/initdb/001_axis_tables.sql +0 -0
  81. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/local/initdb/002_axis_base_schema.sql +0 -0
  82. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/local/initdb/003_guard_policies.sql +0 -0
  83. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/local/initdb/010_local_stack.sql +0 -0
  84. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/main.py +0 -0
  85. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/__init__.py +0 -0
  86. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/api_client.py +0 -0
  87. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/api_helpers.py +0 -0
  88. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/auth_store.py +0 -0
  89. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/config.py +0 -0
  90. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/display.py +0 -0
  91. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/forge_local.py +0 -0
  92. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/importers.py +0 -0
  93. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/local_function_server.py +0 -0
  94. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/local_stack.py +0 -0
  95. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/log_tail.py +0 -0
  96. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/loopback_host.py +0 -0
  97. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/macho_symbols.py +0 -0
  98. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/migrations.py +0 -0
  99. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/mobile_types.py +0 -0
  100. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/output_mode.py +0 -0
  101. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/project_context.py +0 -0
  102. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/schema_introspect.py +0 -0
  103. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/scope_picker.py +0 -0
  104. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/sim_offline.py +0 -0
  105. {sovaria_cli-0.8.0 → sovaria_cli-0.8.3}/apps/cli/src/utils/theme.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sovaria-cli
3
- Version: 0.8.0
3
+ Version: 0.8.3
4
4
  Summary: Sovaria BaaS command-line interface (sov)
5
5
  Project-URL: Homepage, https://sovaria.in
6
6
  Project-URL: Documentation, https://docs.sovaria.in/cli
@@ -12,7 +12,7 @@ Requires-Dist: httpx<1,>=0.28.1
12
12
  Requires-Dist: keyring<26,>=25.0
13
13
  Requires-Dist: pyyaml<7,>=6.0
14
14
  Requires-Dist: rich<16,>=13.7.0
15
- Requires-Dist: sovaria-sdk==0.12.0
15
+ Requires-Dist: sovaria-sdk==0.12.2
16
16
  Requires-Dist: tomli-w<2,>=1.2.0
17
17
  Requires-Dist: typer<1,>=0.17.4
18
18
  Provides-Extra: dev
@@ -22,7 +22,7 @@ Requires-Dist: pytest>=8.0; extra == 'dev'
22
22
  Requires-Dist: ruff>=0.9; extra == 'dev'
23
23
  Requires-Dist: twine>=6.0; extra == 'dev'
24
24
  Provides-Extra: mcp
25
- Requires-Dist: sovaria-sdk[mcp]==0.12.0; extra == 'mcp'
25
+ Requires-Dist: sovaria-sdk[mcp]==0.12.2; extra == 'mcp'
26
26
  Description-Content-Type: text/markdown
27
27
 
28
28
  # Sovaria CLI
@@ -1,3 +1,3 @@
1
1
  """Sovaria CLI — sov command."""
2
2
 
3
- __version__ = "0.8.0"
3
+ __version__ = "0.8.3"
@@ -218,7 +218,7 @@ def add_roles(
218
218
  project_id: str | None = typer.Option(None, "--project"),
219
219
  env_id: str | None = typer.Option(None, "--env"),
220
220
  ) -> None:
221
- """Give a product user roles. They are signed out and get the roles in their next session."""
221
+ """Give a product user roles. They apply to the user's requests within 20 seconds (usually at once); the user stays signed in."""
222
222
  try:
223
223
  result = _change_roles(user_id, roles, [], profile, org_id, project_id, env_id)
224
224
  except CLIRequestError as exc:
@@ -235,7 +235,7 @@ def remove_roles(
235
235
  project_id: str | None = typer.Option(None, "--project"),
236
236
  env_id: str | None = typer.Option(None, "--env"),
237
237
  ) -> None:
238
- """Take roles away from a product user (their current token keeps them until it is refreshed or expires)."""
238
+ """Take roles away from a product user. The change applies to their requests within 20 seconds (usually at once), even on the token they already have."""
239
239
  try:
240
240
  result = _change_roles(user_id, [], roles, profile, org_id, project_id, env_id)
241
241
  except CLIRequestError as exc:
@@ -124,9 +124,11 @@ def list_projects(
124
124
  if len(orgs) == 1:
125
125
  resolved_org = _node_id(orgs[0])
126
126
  else:
127
+ # Every organisation's projects were just listed: that is a complete answer (exit 0, scripts and CI
128
+ # read success); the hint only says how to narrow it.
127
129
  print_access_catalog(profile)
128
- typer.echo("Pass org_id: sov projects <org_id>", err=True)
129
- raise typer.Exit(1)
130
+ typer.echo("Tip: sov projects <org_id> lists one organisation's projects", err=True)
131
+ return
130
132
 
131
133
  projects = fetch_projects(resolved_org, profile)
132
134
  print_json(projects, title=f"Projects ({resolved_org[:8]}…)")
@@ -18,6 +18,8 @@ Commands:
18
18
 
19
19
  from __future__ import annotations
20
20
 
21
+ import re
22
+
21
23
  import json
22
24
  from datetime import UTC, datetime, timedelta
23
25
  from pathlib import Path
@@ -215,6 +217,9 @@ def list_tables(
215
217
  handle_cli_error(exc)
216
218
 
217
219
 
220
+ _DDL_REFUSED = re.compile(r"Dangerous SQL keyword is not allowed: (CREATE|ALTER|DROP|TRUNCATE|GRANT|REVOKE|COMMENT)")
221
+
222
+
218
223
  @app.command("sql")
219
224
  def run_sql(
220
225
  query: str | None = typer.Argument(None, help="SQL query to execute"),
@@ -284,6 +289,11 @@ def _execute_sql(
284
289
  env_id=env_id,
285
290
  )
286
291
  except CLIRequestError as exc:
292
+ if _DDL_REFUSED.search(str(exc)):
293
+ # `db sql` runs one statement through the data API, which takes no schema changes; say where they go.
294
+ print_warning("Schema changes (CREATE, ALTER, DROP …) go through migrations: put the SQL in "
295
+ "sovaria/migrations/<timestamp>_<name>.sql, check it with `sov db push --dry-run`, "
296
+ "then `sov db push`. `sov db plan` builds tables from a plan.")
287
297
  handle_cli_error(exc)
288
298
  print_sql_result(result)
289
299
 
@@ -22,6 +22,7 @@ from apps.cli.src.utils.display import (
22
22
  handle_command_error,
23
23
  print_json,
24
24
  print_success,
25
+ print_warning,
25
26
  )
26
27
  from apps.cli.src.utils.premium_display import (
27
28
  format_http_error,
@@ -1065,6 +1066,14 @@ def policy_get(
1065
1066
  )
1066
1067
  except CLIRequestError as exc:
1067
1068
  handle_cli_error(exc)
1069
+ if isinstance(result, dict) and result.get("saved") is False:
1070
+ # Nothing is enforced until a policy is saved (like Supabase's default, anyone with the project's API key may
1071
+ # call it); the values printed are what a save starts from, not what applies now.
1072
+ print_warning(
1073
+ f"No policy saved for {function_name}: anyone with the project's API key can call it, with no rate or "
1074
+ f"size limit. The values below are what a save starts from; to require sign-in run "
1075
+ f"`sov functions policy-set {function_name} '{{\"invoke_permission\": \"authenticated\"}}'`."
1076
+ )
1068
1077
  print_json(result)
1069
1078
 
1070
1079
 
@@ -44,6 +44,53 @@ def _object_path(bucket: str, object_path: str) -> str:
44
44
  return f"/api/v1/store/objects/{quote(bucket, safe='')}/{encoded}"
45
45
 
46
46
 
47
+ # One request carries at most 5 MB (the gateway's body limit); bigger files go up as a resumable upload in chunks,
48
+ # the same protocol the SDKs use (POST a session, PATCH chunks at the server's offset, Upload-Complete on the last).
49
+ _DIRECT_MAX_BYTES = 5 * 1024 * 1024 - 64 * 1024
50
+ _CHUNK_BYTES = 4 * 1024 * 1024
51
+
52
+
53
+ def _put_resumable(api_url: str, headers: dict, bucket: str, name: str, read_at, size: int, content_type: str,
54
+ *, upsert: bool) -> None:
55
+ """Upload ``size`` bytes, read with ``read_at(offset, length)``, as a resumable upload."""
56
+ if unsafe_object_name(bucket, name):
57
+ raise CLIRequestError(f"Refusing object name {bucket}/{name}: empty, '.' and '..' segments aren't allowed",
58
+ status_code=400)
59
+ if not upsert:
60
+ # A resumable upload replaces the file; keep the ordinary upload's answer when it already exists.
61
+ head = httpx.head(f"{api_url}{_object_path(bucket, name)}", headers=headers, timeout=60)
62
+ if head.status_code == 200:
63
+ raise CLIRequestError(f"{bucket}/{name} already exists", status_code=409)
64
+ encoded = "/".join(quote(part, safe="") for part in name.strip("/").split("/"))
65
+ tus = {**headers, "Tus-Resumable": "1.0.0"}
66
+ created = httpx.post(f"{api_url}/api/v1/store/resumable/{quote(bucket, safe='')}/{encoded}", timeout=60,
67
+ headers={**tus, "Upload-Length": str(size), "X-Content-Type": content_type})
68
+ created.raise_for_status()
69
+ upload_id = (created.headers.get("Location") or "").rstrip("/").rsplit("/", 1)[-1]
70
+ if not upload_id:
71
+ raise CLIRequestError("The upload session has no id", status_code=502)
72
+ url = f"{api_url}/api/v1/store/resumable/{quote(upload_id, safe='')}"
73
+ offset, conflicts = 0, 0
74
+ while True:
75
+ end = min(size, offset + _CHUNK_BYTES)
76
+ last = end >= size
77
+ extra = {"Upload-Complete": "1", "X-Content-Type": content_type} if last else {}
78
+ res = httpx.patch(url, content=read_at(offset, end - offset), timeout=300,
79
+ headers={**tus, "Content-Type": "application/offset+octet-stream",
80
+ "Upload-Offset": str(offset), **extra})
81
+ if res.status_code == 409 and conflicts < 3:
82
+ # The server's offset moved (a chunk that landed before a retry): carry on from where it is.
83
+ conflicts += 1
84
+ probe = httpx.head(url, headers=tus, timeout=60)
85
+ probe.raise_for_status()
86
+ offset = int(probe.headers.get("Upload-Offset") or offset)
87
+ continue
88
+ res.raise_for_status()
89
+ offset = int(res.headers.get("Upload-Offset") or end)
90
+ if last:
91
+ return
92
+
93
+
47
94
  @app.command("buckets")
48
95
  def list_buckets(
49
96
  project_id: str | None = typer.Option(None, "--project", help="Project ID"),
@@ -151,14 +198,22 @@ def upload(
151
198
  env_id=env_id,
152
199
  require_scope=True,
153
200
  )
201
+ size = path.stat().st_size
154
202
  with open(path, "rb") as handle:
155
- response = httpx.post(
156
- f"{api_url}{_object_path(bucket, remote_name)}",
157
- headers=headers,
158
- files={"file": (remote_name, handle)},
159
- timeout=120,
160
- )
161
- response.raise_for_status()
203
+ if size > _DIRECT_MAX_BYTES:
204
+ def read_at(start: int, length: int) -> bytes:
205
+ handle.seek(start)
206
+ return handle.read(length)
207
+ content_type = mimetypes.guess_type(remote_name)[0] or "application/octet-stream"
208
+ _put_resumable(api_url, headers, bucket, remote_name, read_at, size, content_type, upsert=False)
209
+ else:
210
+ response = httpx.post(
211
+ f"{api_url}{_object_path(bucket, remote_name)}",
212
+ headers=headers,
213
+ files={"file": (remote_name, handle)},
214
+ timeout=120,
215
+ )
216
+ response.raise_for_status()
162
217
  except CLIRequestError as exc:
163
218
  handle_cli_error(exc)
164
219
  except httpx.HTTPStatusError as exc:
@@ -436,6 +491,10 @@ def _get_object(bucket: str, name: str, scope: dict) -> bytes:
436
491
 
437
492
  def _put_object(bucket: str, name: str, data: bytes, content_type: str, scope: dict, *, upsert: bool) -> None:
438
493
  api_url, headers = build_request_context(require_scope=True, **scope)
494
+ if len(data) > _DIRECT_MAX_BYTES:
495
+ _put_resumable(api_url, headers, bucket, name, lambda start, length: data[start:start + length], len(data),
496
+ content_type, upsert=upsert)
497
+ return
439
498
  response = httpx.post(f"{api_url}{_object_path(bucket, name)}", headers=headers,
440
499
  params={"upsert": "true"} if upsert else None,
441
500
  files={"file": (PurePosixPath(name).name, data, content_type)}, timeout=300)
@@ -347,7 +347,7 @@ def print_smart(
347
347
  tree = Tree(title or "Response")
348
348
  _build_tree(tree, payload)
349
349
  _console.print(tree)
350
- _console.print("[dim]Tip: pass --json on any command for raw output[/]")
350
+ _console.print("[dim]Tip: `sov --json <command>` (or SOV_JSON=1) prints the raw JSON[/]")
351
351
 
352
352
 
353
353
  def _is_flat_record(data: dict[str, Any]) -> bool:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sovaria-cli"
7
- version = "0.8.0"
7
+ version = "0.8.3"
8
8
  description = "Sovaria BaaS command-line interface (sov)"
9
9
  readme = "apps/cli/README.md"
10
10
  requires-python = ">=3.11"
@@ -14,7 +14,7 @@ authors = [{ name = "Sovaria Team" }]
14
14
  # Upper bounds at the next major (SH28-46): a new major (or a hijacked release under one) never installs
15
15
  # silently with the published CLI.
16
16
  dependencies = [
17
- "sovaria-sdk==0.12.0",
17
+ "sovaria-sdk==0.12.2",
18
18
  "typer>=0.17.4,<1",
19
19
  "httpx>=0.28.1,<1",
20
20
  "keyring>=25.0,<26",
@@ -33,7 +33,7 @@ sov = "apps.cli.src.main:cli_entry"
33
33
 
34
34
  [project.optional-dependencies]
35
35
  mcp = [
36
- "sovaria-sdk[mcp]==0.12.0",
36
+ "sovaria-sdk[mcp]==0.12.2",
37
37
  ]
38
38
  dev = [
39
39
  "pytest>=8.0",
File without changes