docges-api-py 0.1.0__tar.gz → 0.1.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 (35) hide show
  1. {docges_api_py-0.1.0/src/docges_api_py.egg-info → docges_api_py-0.1.2}/PKG-INFO +9 -5
  2. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/README.md +8 -4
  3. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/pyproject.toml +1 -1
  4. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/__init__.py +28 -31
  5. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/client.py +156 -178
  6. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/models/__init__.py +33 -24
  7. docges_api_py-0.1.2/src/docges_api_py/models/auth.py +30 -0
  8. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/models/requests.py +20 -12
  9. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/models/responses.py +15 -18
  10. {docges_api_py-0.1.0 → docges_api_py-0.1.2/src/docges_api_py.egg-info}/PKG-INFO +9 -5
  11. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py.egg-info/SOURCES.txt +1 -0
  12. docges_api_py-0.1.2/tests/test_client_auth.py +242 -0
  13. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_content_methods.py +20 -30
  14. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_endpoints.py +0 -1
  15. docges_api_py-0.1.2/tests/test_get_document.py +117 -0
  16. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_initial_cats.py +36 -16
  17. docges_api_py-0.1.2/tests/test_models_auth.py +50 -0
  18. docges_api_py-0.1.2/tests/test_models_init.py +16 -0
  19. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_models_requests.py +17 -10
  20. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_models_responses.py +49 -3
  21. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/tests/test_remaining_methods.py +33 -62
  22. docges_api_py-0.1.2/tests/test_retry.py +125 -0
  23. docges_api_py-0.1.2/tests/test_token_refresh.py +54 -0
  24. docges_api_py-0.1.0/src/docges_api_py/models/auth.py +0 -17
  25. docges_api_py-0.1.0/tests/test_client_auth.py +0 -56
  26. docges_api_py-0.1.0/tests/test_get_document.py +0 -56
  27. docges_api_py-0.1.0/tests/test_models_init.py +0 -38
  28. docges_api_py-0.1.0/tests/test_retry.py +0 -67
  29. docges_api_py-0.1.0/tests/test_token_refresh.py +0 -54
  30. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/LICENSE +0 -0
  31. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/setup.cfg +0 -0
  32. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py/models/document.py +0 -0
  33. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py.egg-info/dependency_links.txt +0 -0
  34. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py.egg-info/requires.txt +0 -0
  35. {docges_api_py-0.1.0 → docges_api_py-0.1.2}/src/docges_api_py.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docges-api-py
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Async, typed Python client for DocGes REST API
5
5
  Author-email: "ct.galega" <soporte@ctgalega.com>
6
6
  License: MIT
@@ -31,7 +31,7 @@ Async, typed Python client for the DocGes REST API.
31
31
  - ✅ Async HTTP client using `httpx`
32
32
  - ✅ Typed request/response models with Pydantic v2
33
33
  - ✅ Configurable retries and timeouts
34
- - ✅ Token-based auth with automatic refresh (TTL)
34
+ - ✅ Session-based auth using `loginResponse` passed to Content endpoints
35
35
  - ✅ Full test coverage (pytest + respx)
36
36
  - ✅ Complete DocGes API client (upload, download, search, categories)
37
37
 
@@ -72,15 +72,18 @@ pip install -e ".[dev]"
72
72
  import asyncio
73
73
  from docges_api_py import AsyncDocGes
74
74
 
75
+
75
76
  async def main():
76
77
  async with AsyncDocGes(
77
78
  "https://docges.example.com", "user", "password", "appid"
78
79
  ) as client:
79
80
  # Auth
80
81
  auth_resp = await client.auth()
81
- print(f"Token (partial): {auth_resp.token[:8]}...")
82
+ # The API is session-based: auth_resp contains user_info and ware_house_info
83
+ print(f"User: {auth_resp.user_info.get('Nombre')}")
84
+ print(f"Warehouse: {auth_resp.ware_house_info.get('Nombre')}")
82
85
 
83
- # Load initial categories
86
+ # Load initial categories (the client injects loginResponse automatically)
84
87
  cats = await client.get_initial_cats()
85
88
  print(f"Initial categories: {len(cats.CategoriasHijas)}")
86
89
 
@@ -90,10 +93,11 @@ async def main():
90
93
  )
91
94
  print(f"Search results: {len(results.results)}")
92
95
 
96
+
93
97
  asyncio.run(main())
94
98
  ```
95
99
 
96
- See `examples/quickstart.py` for a more complete example.
100
+ See `docs/quickstart.md` or `examples/quickstart.py` for a more complete example.
97
101
 
98
102
  ## Development
99
103
 
@@ -11,7 +11,7 @@ Async, typed Python client for the DocGes REST API.
11
11
  - ✅ Async HTTP client using `httpx`
12
12
  - ✅ Typed request/response models with Pydantic v2
13
13
  - ✅ Configurable retries and timeouts
14
- - ✅ Token-based auth with automatic refresh (TTL)
14
+ - ✅ Session-based auth using `loginResponse` passed to Content endpoints
15
15
  - ✅ Full test coverage (pytest + respx)
16
16
  - ✅ Complete DocGes API client (upload, download, search, categories)
17
17
 
@@ -52,15 +52,18 @@ pip install -e ".[dev]"
52
52
  import asyncio
53
53
  from docges_api_py import AsyncDocGes
54
54
 
55
+
55
56
  async def main():
56
57
  async with AsyncDocGes(
57
58
  "https://docges.example.com", "user", "password", "appid"
58
59
  ) as client:
59
60
  # Auth
60
61
  auth_resp = await client.auth()
61
- print(f"Token (partial): {auth_resp.token[:8]}...")
62
+ # The API is session-based: auth_resp contains user_info and ware_house_info
63
+ print(f"User: {auth_resp.user_info.get('Nombre')}")
64
+ print(f"Warehouse: {auth_resp.ware_house_info.get('Nombre')}")
62
65
 
63
- # Load initial categories
66
+ # Load initial categories (the client injects loginResponse automatically)
64
67
  cats = await client.get_initial_cats()
65
68
  print(f"Initial categories: {len(cats.CategoriasHijas)}")
66
69
 
@@ -70,10 +73,11 @@ async def main():
70
73
  )
71
74
  print(f"Search results: {len(results.results)}")
72
75
 
76
+
73
77
  asyncio.run(main())
74
78
  ```
75
79
 
76
- See `examples/quickstart.py` for a more complete example.
80
+ See `docs/quickstart.md` or `examples/quickstart.py` for a more complete example.
77
81
 
78
82
  ## Development
79
83
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "docges-api-py"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "Async, typed Python client for DocGes REST API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -1,69 +1,66 @@
1
1
  """DocGes API Python client — async, typed, tested."""
2
2
 
3
- from docges_api_py.client import AsyncDocGes, Endpoints, DocGesError, AuthenticationError, RequestError
3
+ from docges_api_py.client import AsyncDocGes, AuthenticationError, DocGesError, Endpoints, RequestError
4
4
  from docges_api_py.models import (
5
5
  # Auth
6
6
  AuthRequest,
7
7
  AuthResponse,
8
8
  # Document
9
9
  Document,
10
- # Requests
11
- ReqData,
12
- ReqAuthData,
10
+ FileDownloadResponse,
13
11
  FileUpload,
14
- ReqUpload,
15
- SearchFilterValue,
16
- SearchDateValue,
17
- ReqSearchContent,
12
+ ReqAuthData,
18
13
  ReqCreateCategory,
19
- ReqRenameCategory,
14
+ # Requests
15
+ ReqData,
20
16
  ReqDeleteCategory,
21
17
  ReqMoveContent,
22
- ReqUpdateContent,
23
18
  ReqRemoveContent,
19
+ ReqRenameCategory,
20
+ ReqSearchContent,
21
+ ReqUpdateContent,
22
+ ReqUpload,
24
23
  # Responses
25
24
  ResCat,
26
25
  ResCatItem,
26
+ ResFileDownload,
27
27
  ResSearch,
28
28
  ResSearchItem,
29
- ResFileDownload,
30
- FileDownloadResponse,
31
29
  ResultActionModel,
30
+ SearchDateValue,
31
+ SearchFilterValue,
32
32
  )
33
+ from docges_api_py.models.auth import DocGesAuthError
33
34
 
34
35
  __version__ = "0.2.0" # Phase 5: All endpoints implemented
35
36
  __all__ = [
36
- # Client
37
37
  "AsyncDocGes",
38
- "Endpoints",
39
- "DocGesError",
40
- "AuthenticationError",
41
- "RequestError",
42
- # Auth
43
38
  "AuthRequest",
44
39
  "AuthResponse",
45
- # Document
40
+ "AuthenticationError",
41
+ "DocGesAuthError",
42
+ "DocGesError",
46
43
  "Document",
47
- # Requests
48
- "ReqData",
49
- "ReqAuthData",
44
+ "Endpoints",
45
+ "FileDownloadResponse",
50
46
  "FileUpload",
51
- "ReqUpload",
52
- "SearchFilterValue",
53
- "SearchDateValue",
54
- "ReqSearchContent",
47
+ "ReqAuthData",
55
48
  "ReqCreateCategory",
56
- "ReqRenameCategory",
49
+ "ReqData",
57
50
  "ReqDeleteCategory",
58
51
  "ReqMoveContent",
59
- "ReqUpdateContent",
60
52
  "ReqRemoveContent",
61
- # Responses
53
+ "ReqRenameCategory",
54
+ "ReqSearchContent",
55
+ "ReqUpdateContent",
56
+ "ReqUpload",
57
+ "RequestError",
62
58
  "ResCat",
63
59
  "ResCatItem",
60
+ "ResFileDownload",
64
61
  "ResSearch",
65
62
  "ResSearchItem",
66
- "ResFileDownload",
67
- "FileDownloadResponse",
68
63
  "ResultActionModel",
64
+ "SearchDateValue",
65
+ "SearchFilterValue",
69
66
  ]