dominus-sdk-python-dev 2.3.0__tar.gz → 2.4.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 (39) hide show
  1. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/PKG-INFO +10 -6
  2. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/README.md +9 -5
  3. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/__init__.py +69 -5
  4. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/helpers/cache.py +12 -4
  5. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/start.py +19 -32
  6. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus_sdk_python_dev.egg-info/PKG-INFO +10 -6
  7. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/pyproject.toml +1 -1
  8. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/config/__init__.py +0 -0
  9. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/config/endpoints.py +0 -0
  10. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/errors.py +0 -0
  11. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/helpers/__init__.py +0 -0
  12. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/helpers/auth.py +0 -0
  13. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/helpers/core.py +0 -0
  14. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/helpers/crypto.py +0 -0
  15. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/__init__.py +0 -0
  16. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/_deprecated_crossover.py +0 -0
  17. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/_deprecated_sql.py +0 -0
  18. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/admin.py +0 -0
  19. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/auth.py +0 -0
  20. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/courier.py +0 -0
  21. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/db.py +0 -0
  22. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/ddl.py +0 -0
  23. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/fastapi.py +0 -0
  24. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/files.py +0 -0
  25. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/health.py +0 -0
  26. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/logs.py +0 -0
  27. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/open.py +0 -0
  28. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/portal.py +0 -0
  29. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/redis.py +0 -0
  30. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/secrets.py +0 -0
  31. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/namespaces/secure.py +0 -0
  32. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/services/__init__.py +0 -0
  33. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/services/_deprecated_architect.py +0 -0
  34. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus/services/_deprecated_sovereign.py +0 -0
  35. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus_sdk_python_dev.egg-info/SOURCES.txt +0 -0
  36. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus_sdk_python_dev.egg-info/dependency_links.txt +0 -0
  37. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus_sdk_python_dev.egg-info/requires.txt +0 -0
  38. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/dominus_sdk_python_dev.egg-info/top_level.txt +0 -0
  39. {dominus_sdk_python_dev-2.3.0 → dominus_sdk_python_dev-2.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dominus-sdk-python-dev
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: Python SDK for the Dominus Orchestrator Platform
5
5
  Author-email: CareBridge Systems <dev@carebridge.io>
6
6
  License: Proprietary
@@ -417,8 +417,8 @@ from dominus import (
417
417
  ConflictError,
418
418
  ServiceError,
419
419
  SecureTableError,
420
- ConnectionError,
421
- TimeoutError,
420
+ DominusConnectionError, # Renamed to avoid shadowing built-in
421
+ DominusTimeoutError, # Renamed to avoid shadowing built-in
422
422
  )
423
423
 
424
424
  try:
@@ -445,6 +445,7 @@ except DominusError as e:
445
445
 
446
446
  | Error | Status | Description |
447
447
  |-------|--------|-------------|
448
+ | `DominusError` | - | Base class for all SDK errors |
448
449
  | `AuthenticationError` | 401 | Invalid or missing token |
449
450
  | `AuthorizationError` | 403 | Insufficient permissions |
450
451
  | `NotFoundError` | 404 | Resource not found |
@@ -452,8 +453,8 @@ except DominusError as e:
452
453
  | `ConflictError` | 409 | Duplicate or version conflict |
453
454
  | `ServiceError` | 5xx | Backend service error |
454
455
  | `SecureTableError` | 403 | Missing reason for secure table |
455
- | `ConnectionError` | - | Network connection failed |
456
- | `TimeoutError` | 504 | Request timed out |
456
+ | `DominusConnectionError` | - | Network connection failed |
457
+ | `DominusTimeoutError` | 504 | Request timed out |
457
458
 
458
459
  ## Configuration
459
460
 
@@ -551,10 +552,13 @@ async def get_all_users(page_size: int = 100):
551
552
 
552
553
  ## Version
553
554
 
554
- **v2.1.6** - Latest release with navigation routes and page scope methods
555
+ **v2.4.0** - Full namespace parity with Node.js SDK
555
556
 
556
557
  ### Changelog
557
558
 
559
+ - **v2.4.0** - Full parity with Node.js SDK: all namespaces properly initialized, error classes exported, cache utilities exposed
560
+ - **v2.3.0** - Add comprehensive auth namespace with 100+ methods
561
+ - **v2.2.0** - Add DDL schema builder and migration methods
558
562
  - **v2.1.6** - Fix navigation routes and add page scope methods
559
563
  - **v2.1.5** - Add PSK-only client login
560
564
  - **v2.1.4** - Make `tenant_id` optional in login methods
@@ -386,8 +386,8 @@ from dominus import (
386
386
  ConflictError,
387
387
  ServiceError,
388
388
  SecureTableError,
389
- ConnectionError,
390
- TimeoutError,
389
+ DominusConnectionError, # Renamed to avoid shadowing built-in
390
+ DominusTimeoutError, # Renamed to avoid shadowing built-in
391
391
  )
392
392
 
393
393
  try:
@@ -414,6 +414,7 @@ except DominusError as e:
414
414
 
415
415
  | Error | Status | Description |
416
416
  |-------|--------|-------------|
417
+ | `DominusError` | - | Base class for all SDK errors |
417
418
  | `AuthenticationError` | 401 | Invalid or missing token |
418
419
  | `AuthorizationError` | 403 | Insufficient permissions |
419
420
  | `NotFoundError` | 404 | Resource not found |
@@ -421,8 +422,8 @@ except DominusError as e:
421
422
  | `ConflictError` | 409 | Duplicate or version conflict |
422
423
  | `ServiceError` | 5xx | Backend service error |
423
424
  | `SecureTableError` | 403 | Missing reason for secure table |
424
- | `ConnectionError` | - | Network connection failed |
425
- | `TimeoutError` | 504 | Request timed out |
425
+ | `DominusConnectionError` | - | Network connection failed |
426
+ | `DominusTimeoutError` | 504 | Request timed out |
426
427
 
427
428
  ## Configuration
428
429
 
@@ -520,10 +521,13 @@ async def get_all_users(page_size: int = 100):
520
521
 
521
522
  ## Version
522
523
 
523
- **v2.1.6** - Latest release with navigation routes and page scope methods
524
+ **v2.4.0** - Full namespace parity with Node.js SDK
524
525
 
525
526
  ### Changelog
526
527
 
528
+ - **v2.4.0** - Full parity with Node.js SDK: all namespaces properly initialized, error classes exported, cache utilities exposed
529
+ - **v2.3.0** - Add comprehensive auth namespace with 100+ methods
530
+ - **v2.2.0** - Add DDL schema builder and migration methods
527
531
  - **v2.1.6** - Fix navigation routes and add page scope methods
528
532
  - **v2.1.5** - Add PSK-only client login
529
533
  - **v2.1.4** - Make `tenant_id` optional in login methods
@@ -8,6 +8,10 @@ Ultra-Flat API:
8
8
  value = await dominus.get("DB_URL")
9
9
  await dominus.upsert("KEY", "value")
10
10
 
11
+ # Secrets namespace
12
+ value = await dominus.secrets.get("DB_URL")
13
+ await dominus.secrets.upsert("KEY", "value")
14
+
11
15
  # Database (namespace-based)
12
16
  tables = await dominus.db.tables()
13
17
  rows = await dominus.db.query("users", filters={"status": "active"})
@@ -23,6 +27,16 @@ Ultra-Flat API:
23
27
  # Files (namespace-based)
24
28
  result = await dominus.files.upload(data=file_bytes, filename="report.pdf", category="reports")
25
29
 
30
+ # Redis caching
31
+ await dominus.redis.set("key", "value", ttl=3600)
32
+ value = await dominus.redis.get("key")
33
+
34
+ # Logging
35
+ await dominus.logs.info("Operation complete", {"user_id": user_id})
36
+
37
+ # Email
38
+ await dominus.courier.send("welcome", to="user@example.com", from_email="hello@app.com", model={})
39
+
26
40
  # Secure table access with audit logging
27
41
  rows = await dominus.db_secure.query("patients", context=SecureAccessContext(
28
42
  reason="Reviewing chart",
@@ -35,11 +49,14 @@ Ultra-Flat API:
35
49
  # Portal authentication
36
50
  session = await dominus.portal.login("user@example.com", "password", "tenant-id")
37
51
 
38
- # Open DSN
52
+ # Open DSN and raw SQL
39
53
  dsn = await dominus.open.dsn()
54
+ result = await dominus.open.execute("SELECT * FROM users WHERE id = $1", {"1": user_id})
40
55
 
41
56
  # Health
42
57
  status = await dominus.health.check()
58
+ await dominus.health.ping()
59
+ await dominus.health.warmup()
43
60
 
44
61
  Backward Compatible APIs:
45
62
  # String-based API
@@ -76,11 +93,37 @@ from .namespaces.files import FilesNamespace
76
93
  from .namespaces.portal import PortalNamespace
77
94
  from .namespaces.admin import AdminNamespace
78
95
  from .namespaces.secure import SecureNamespace, SecureAccessContext
96
+ from .namespaces.secrets import SecretsNamespace
97
+ from .namespaces.redis import RedisNamespace
98
+ from .namespaces.logs import LogsNamespace
99
+ from .namespaces.courier import CourierNamespace
100
+ from .namespaces.health import HealthNamespace
101
+ from .namespaces.open import OpenNamespace
102
+
103
+ # Export cache and resilience utilities
104
+ from .helpers.cache import (
105
+ dominus_cache,
106
+ CircuitBreaker,
107
+ DominusCache,
108
+ orchestrator_circuit_breaker,
109
+ exponential_backoff_with_jitter,
110
+ )
79
111
 
80
- # Export cache utilities
81
- from .helpers.cache import dominus_cache
112
+ # Export error classes
113
+ from .errors import (
114
+ DominusError,
115
+ AuthenticationError,
116
+ AuthorizationError,
117
+ NotFoundError,
118
+ ValidationError,
119
+ ConflictError,
120
+ ServiceError,
121
+ SecureTableError,
122
+ ConnectionError as DominusConnectionError,
123
+ TimeoutError as DominusTimeoutError,
124
+ )
82
125
 
83
- __version__ = "2.2.0"
126
+ __version__ = "2.4.0"
84
127
  __all__ = [
85
128
  # Main SDK instance
86
129
  "dominus",
@@ -103,6 +146,27 @@ __all__ = [
103
146
  "AdminNamespace",
104
147
  "SecureNamespace",
105
148
  "SecureAccessContext",
106
- # Cache utilities
149
+ "SecretsNamespace",
150
+ "RedisNamespace",
151
+ "LogsNamespace",
152
+ "CourierNamespace",
153
+ "HealthNamespace",
154
+ "OpenNamespace",
155
+ # Cache and resilience utilities
107
156
  "dominus_cache",
157
+ "CircuitBreaker",
158
+ "DominusCache",
159
+ "orchestrator_circuit_breaker",
160
+ "exponential_backoff_with_jitter",
161
+ # Error classes
162
+ "DominusError",
163
+ "AuthenticationError",
164
+ "AuthorizationError",
165
+ "NotFoundError",
166
+ "ValidationError",
167
+ "ConflictError",
168
+ "ServiceError",
169
+ "SecureTableError",
170
+ "DominusConnectionError",
171
+ "DominusTimeoutError",
108
172
  ]
@@ -1,7 +1,12 @@
1
1
  """
2
2
  Internal cache with automatic encryption and circuit breaker.
3
3
 
4
- NOT exposed to SDK users - internal use only.
4
+ Exports:
5
+ - CircuitBreaker: Circuit breaker class for resilience
6
+ - DominusCache: Encrypted cache class
7
+ - dominus_cache: Singleton cache instance
8
+ - orchestrator_circuit_breaker: Circuit breaker for orchestrator
9
+ - exponential_backoff_with_jitter: Backoff calculation utility
5
10
  """
6
11
  import time
7
12
  import json
@@ -181,12 +186,15 @@ class DominusCache:
181
186
  return count
182
187
 
183
188
 
184
- # Internal singletons - NOT exported to users
189
+ # Singleton instances
185
190
  dominus_cache = DominusCache(default_ttl=300)
186
191
 
187
- # Circuit breakers for different services (prevents retry storms)
188
- sovereign_circuit_breaker = CircuitBreaker(
192
+ # Circuit breaker for orchestrator (prevents retry storms)
193
+ orchestrator_circuit_breaker = CircuitBreaker(
189
194
  failure_threshold=5, # Open after 5 consecutive failures
190
195
  recovery_timeout=30.0, # Try again after 30 seconds
191
196
  half_open_max_calls=1 # Allow 1 test call in half-open state
192
197
  )
198
+
199
+ # Backward compatibility alias
200
+ sovereign_circuit_breaker = orchestrator_circuit_breaker
@@ -251,31 +251,6 @@ class SecureNamespace:
251
251
  )
252
252
 
253
253
 
254
- class OpenNamespace:
255
- """Open user namespace - Returns DSN string for dominus_open database."""
256
-
257
- def __init__(self, _execute_command):
258
- self._execute = _execute_command
259
-
260
- async def dsn(self) -> str:
261
- """
262
- Get the full DSN connection string for open_user role.
263
-
264
- Returns the complete PostgreSQL connection URI for the dominus_open
265
- database that can be used directly by clients to connect.
266
- """
267
- return await self._execute("sql.open.get_dsn")
268
-
269
-
270
- class HealthNamespace:
271
- """Health check operations namespace."""
272
-
273
- def __init__(self, _execute_command):
274
- self._execute = _execute_command
275
-
276
- async def check(self) -> Dict[str, Any]:
277
- """Check health of all services."""
278
- return await self._execute("health.check")
279
254
 
280
255
 
281
256
  class Dominus:
@@ -324,10 +299,8 @@ class Dominus:
324
299
 
325
300
  self._execute = _execute_command
326
301
 
327
- # Initialize minimal namespaces
302
+ # Initialize legacy flat API namespaces (backward compatibility)
328
303
  self.secure = SecureNamespace(_execute_command)
329
- self.open = OpenNamespace(_execute_command)
330
- self.health = HealthNamespace(_execute_command)
331
304
 
332
305
  # Initialize portal namespace (needs client reference for _request)
333
306
  from .namespaces.portal import PortalNamespace
@@ -337,22 +310,36 @@ class Dominus:
337
310
  from .namespaces.fastapi import FastAPINamespace
338
311
  self.fastapi = FastAPINamespace(self)
339
312
 
340
- # Initialize full namespaces (matching Node.js SDK pattern)
313
+ # Initialize all namespaces (matching Node.js SDK pattern)
341
314
  from .namespaces.db import DbNamespace
342
315
  from .namespaces.auth import AuthNamespace
343
316
  from .namespaces.ddl import DdlNamespace
344
317
  from .namespaces.files import FilesNamespace
345
318
  from .namespaces.admin import AdminNamespace
346
319
  from .namespaces.secure import SecureNamespace as SecureNS
347
-
320
+ from .namespaces.secrets import SecretsNamespace
321
+ from .namespaces.redis import RedisNamespace
322
+ from .namespaces.logs import LogsNamespace
323
+ from .namespaces.courier import CourierNamespace
324
+ from .namespaces.health import HealthNamespace
325
+ from .namespaces.open import OpenNamespace
326
+
327
+ # Core namespaces
348
328
  self.db = DbNamespace(self)
349
329
  self.auth = AuthNamespace(self)
350
330
  self.ddl = DdlNamespace(self)
351
331
  self.files = FilesNamespace(self)
352
332
  self.admin = AdminNamespace(self)
353
333
 
354
- # Note: self.secure is already defined above as the flat API namespace
355
- # The proper SecureNS namespace is available as dominus.db_secure for direct access
334
+ # Additional namespaces (Node.js SDK parity)
335
+ self.secrets = SecretsNamespace(self)
336
+ self.redis = RedisNamespace(self)
337
+ self.logs = LogsNamespace(self)
338
+ self.courier = CourierNamespace(self)
339
+ self.health = HealthNamespace(self)
340
+ self.open = OpenNamespace(self)
341
+
342
+ # Secure namespace with proper audit context support
356
343
  self.db_secure = SecureNS(self)
357
344
 
358
345
  # Cache for JWT public key
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dominus-sdk-python-dev
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: Python SDK for the Dominus Orchestrator Platform
5
5
  Author-email: CareBridge Systems <dev@carebridge.io>
6
6
  License: Proprietary
@@ -417,8 +417,8 @@ from dominus import (
417
417
  ConflictError,
418
418
  ServiceError,
419
419
  SecureTableError,
420
- ConnectionError,
421
- TimeoutError,
420
+ DominusConnectionError, # Renamed to avoid shadowing built-in
421
+ DominusTimeoutError, # Renamed to avoid shadowing built-in
422
422
  )
423
423
 
424
424
  try:
@@ -445,6 +445,7 @@ except DominusError as e:
445
445
 
446
446
  | Error | Status | Description |
447
447
  |-------|--------|-------------|
448
+ | `DominusError` | - | Base class for all SDK errors |
448
449
  | `AuthenticationError` | 401 | Invalid or missing token |
449
450
  | `AuthorizationError` | 403 | Insufficient permissions |
450
451
  | `NotFoundError` | 404 | Resource not found |
@@ -452,8 +453,8 @@ except DominusError as e:
452
453
  | `ConflictError` | 409 | Duplicate or version conflict |
453
454
  | `ServiceError` | 5xx | Backend service error |
454
455
  | `SecureTableError` | 403 | Missing reason for secure table |
455
- | `ConnectionError` | - | Network connection failed |
456
- | `TimeoutError` | 504 | Request timed out |
456
+ | `DominusConnectionError` | - | Network connection failed |
457
+ | `DominusTimeoutError` | 504 | Request timed out |
457
458
 
458
459
  ## Configuration
459
460
 
@@ -551,10 +552,13 @@ async def get_all_users(page_size: int = 100):
551
552
 
552
553
  ## Version
553
554
 
554
- **v2.1.6** - Latest release with navigation routes and page scope methods
555
+ **v2.4.0** - Full namespace parity with Node.js SDK
555
556
 
556
557
  ### Changelog
557
558
 
559
+ - **v2.4.0** - Full parity with Node.js SDK: all namespaces properly initialized, error classes exported, cache utilities exposed
560
+ - **v2.3.0** - Add comprehensive auth namespace with 100+ methods
561
+ - **v2.2.0** - Add DDL schema builder and migration methods
558
562
  - **v2.1.6** - Fix navigation routes and add page scope methods
559
563
  - **v2.1.5** - Add PSK-only client login
560
564
  - **v2.1.4** - Make `tenant_id` optional in login methods
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dominus-sdk-python-dev"
7
- version = "2.3.0"
7
+ version = "2.4.0"
8
8
  description = "Python SDK for the Dominus Orchestrator Platform"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"