valentina-python-client 1.22.1__tar.gz → 2.0.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 (84) hide show
  1. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/PKG-INFO +2 -2
  2. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/pyproject.toml +10 -10
  3. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/__init__.py +5 -1
  4. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_codegen.py +5 -0
  5. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/__init__.py +2 -0
  6. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/client.py +112 -48
  7. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/registry.py +95 -50
  8. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/__init__.py +2 -0
  9. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/base.py +20 -0
  10. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/campaign_book_chapters.py +17 -5
  11. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/campaign_books.py +8 -13
  12. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/campaigns.py +8 -8
  13. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/character_autogen.py +20 -17
  14. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/character_blueprint.py +5 -2
  15. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/character_traits.py +5 -16
  16. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/characters.py +19 -19
  17. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/companies.py +2 -2
  18. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/dicerolls.py +5 -5
  19. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/dictionary.py +5 -1
  20. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/options.py +5 -1
  21. valentina_python_client-2.0.0/src/vclient/_sync/services/user_self_registration.py +71 -0
  22. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/users.py +27 -106
  23. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/client.py +135 -49
  24. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/constants.py +1 -0
  25. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/endpoints.py +3 -3
  26. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/__init__.py +4 -2
  27. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/characters.py +1 -0
  28. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/companies.py +39 -5
  29. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/system.py +4 -1
  30. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/users.py +1 -11
  31. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/registry.py +119 -50
  32. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/__init__.py +2 -0
  33. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/base.py +24 -0
  34. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/campaign_book_chapters.py +17 -5
  35. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/campaign_books.py +13 -8
  36. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/campaigns.py +7 -8
  37. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/character_autogen.py +20 -11
  38. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/character_blueprint.py +3 -2
  39. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/character_traits.py +8 -8
  40. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/characters.py +18 -13
  41. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/companies.py +2 -2
  42. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/dicerolls.py +5 -5
  43. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/dictionary.py +3 -1
  44. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/options.py +3 -1
  45. valentina_python_client-2.0.0/src/vclient/services/user_self_registration.py +74 -0
  46. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/users.py +10 -85
  47. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/testing/_routes.py +3 -1
  48. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/LICENSE +0 -0
  49. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/README.md +0 -0
  50. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/_audit_params.py +0 -0
  51. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/developers.py +0 -0
  52. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/global_admin.py +0 -0
  53. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/system.py +0 -0
  54. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/services/user_lookup.py +0 -0
  55. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/testing/__init__.py +0 -0
  56. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/_sync/testing/_client.py +0 -0
  57. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/config.py +0 -0
  58. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/exceptions.py +0 -0
  59. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/audit_logs.py +0 -0
  60. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/books.py +0 -0
  61. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/campaigns.py +0 -0
  62. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/chapters.py +0 -0
  63. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/character_autogen.py +0 -0
  64. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/character_blueprint.py +0 -0
  65. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/character_trait.py +0 -0
  66. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/developers.py +0 -0
  67. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/diceroll.py +0 -0
  68. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/dictionary.py +0 -0
  69. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/full_sheet.py +0 -0
  70. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/global_admin.py +0 -0
  71. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/pagination.py +0 -0
  72. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/shared.py +0 -0
  73. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/models/user_lookup.py +0 -0
  74. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/py.typed +0 -0
  75. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/_audit_params.py +0 -0
  76. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/developers.py +0 -0
  77. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/global_admin.py +0 -0
  78. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/system.py +0 -0
  79. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/services/user_lookup.py +0 -0
  80. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/testing/__init__.py +0 -0
  81. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/testing/_client.py +0 -0
  82. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/testing/_factories.py +0 -0
  83. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/testing/_router.py +0 -0
  84. {valentina_python_client-1.22.1 → valentina_python_client-2.0.0}/src/vclient/validate_constants.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: valentina-python-client
3
- Version: 1.22.1
3
+ Version: 2.0.0
4
4
  Summary: Async Python client library for the Valentina Noir API
5
5
  Author: Nate Landau
6
6
  Author-email: Nate Landau <github@natenate.org>
@@ -19,7 +19,7 @@ Requires-Dist: anyio>=4.13.0
19
19
  Requires-Dist: httpx>=0.28.1
20
20
  Requires-Dist: loguru>=0.7.3
21
21
  Requires-Dist: polyfactory>=3.3.0
22
- Requires-Dist: pydantic[email]>=2.12.5
22
+ Requires-Dist: pydantic[email]>=2.13.1
23
23
  Requires-Dist: polyfactory>=3.3.0 ; extra == 'testing'
24
24
  Requires-Python: >=3.13
25
25
  Project-URL: Homepage, https://docs.valentina-noir.com/python-api-client/
@@ -9,14 +9,14 @@
9
9
  "httpx>=0.28.1",
10
10
  "loguru>=0.7.3",
11
11
  "polyfactory>=3.3.0",
12
- "pydantic[email]>=2.12.5",
12
+ "pydantic[email]>=2.13.1",
13
13
  ]
14
14
  description = "Async Python client library for the Valentina Noir API"
15
15
  license = { file = "LICENSE" }
16
16
  name = "valentina-python-client"
17
17
  readme = "README.md"
18
18
  requires-python = ">=3.13"
19
- version = "1.22.1"
19
+ version = "2.0.0"
20
20
 
21
21
  [project.optional-dependencies]
22
22
  testing = ["polyfactory>=3.3.0"]
@@ -34,10 +34,10 @@
34
34
 
35
35
  [dependency-groups]
36
36
  dev = [
37
- "commitizen>=4.13.9",
37
+ "commitizen>=4.13.10",
38
38
  "coverage>=7.13.5",
39
39
  "duty>=1.9.0",
40
- "prek>=0.3.8",
40
+ "prek>=0.3.9",
41
41
  "pytest-anyio>=0.0.0",
42
42
  "pytest-clarity>=1.0.1",
43
43
  "pytest-cov>=7.1.0",
@@ -46,16 +46,16 @@
46
46
  "pytest-repeat>=0.9.4",
47
47
  "pytest-sugar>=1.1.1",
48
48
  "pytest-xdist>=3.8.0",
49
- "pytest>=9.0.2",
50
- "respx>=0.22.0",
51
- "ruff>=0.15.9",
49
+ "pytest>=9.0.3",
50
+ "respx>=0.23.1",
51
+ "ruff>=0.15.10",
52
52
  "shellcheck-py>=0.11.0.1",
53
- "ty>=0.0.29",
54
- "typos>=1.45.0",
53
+ "ty>=0.0.31",
54
+ "typos>=1.45.1",
55
55
  "vulture>=2.16",
56
56
  "yamllint>=1.38.0",
57
57
  ]
58
- docs = ["zensical>=0.0.31"]
58
+ docs = ["zensical>=0.0.33"]
59
59
 
60
60
  [tool.commitizen]
61
61
  bump_message = "bump(release): v$current_version → v$new_version"
@@ -50,6 +50,7 @@ from vclient._sync import ( # noqa: E402
50
50
  sync_options_service,
51
51
  sync_system_service,
52
52
  sync_user_lookup_service,
53
+ sync_user_self_registration_service,
53
54
  sync_users_service,
54
55
  )
55
56
  from vclient.client import VClient # noqa: E402
@@ -69,6 +70,7 @@ from vclient.registry import ( # noqa: E402
69
70
  options_service,
70
71
  system_service,
71
72
  user_lookup_service,
73
+ user_self_registration_service,
72
74
  users_service,
73
75
  )
74
76
 
@@ -103,10 +105,12 @@ __all__ = (
103
105
  "sync_options_service",
104
106
  "sync_system_service",
105
107
  "sync_user_lookup_service",
108
+ "sync_user_self_registration_service",
106
109
  "sync_users_service",
107
110
  "system_service",
108
111
  "user_lookup_service",
112
+ "user_self_registration_service",
109
113
  "users_service",
110
114
  )
111
115
 
112
- __version__ = "1.22.1"
116
+ __version__ = "2.0.0"
@@ -29,6 +29,7 @@ RENAME_CLASSES: dict[str, str] = {
29
29
  "OptionsService": "SyncOptionsService",
30
30
  "SystemService": "SyncSystemService",
31
31
  "UserLookupService": "SyncUserLookupService",
32
+ "UserSelfRegistrationService": "SyncUserSelfRegistrationService",
32
33
  "UsersService": "SyncUsersService",
33
34
  "VClient": "SyncVClient",
34
35
  "FakeVClient": "SyncFakeVClient",
@@ -51,6 +52,7 @@ FACTORY_RENAMES: dict[str, str] = {
51
52
  "options_service": "sync_options_service",
52
53
  "character_autogen_service": "sync_character_autogen_service",
53
54
  "user_lookup_service": "sync_user_lookup_service",
55
+ "user_self_registration_service": "sync_user_self_registration_service",
54
56
  "configure_default_client": "sync_configure_default_client",
55
57
  "clear_default_client": "sync_clear_default_client",
56
58
  "default_client": "sync_default_client",
@@ -76,6 +78,7 @@ IMPORT_REWRITES: dict[str, str] = {
76
78
  "vclient.services.options": "vclient._sync.services.options",
77
79
  "vclient.services.character_autogen": "vclient._sync.services.character_autogen",
78
80
  "vclient.services.user_lookup": "vclient._sync.services.user_lookup",
81
+ "vclient.services.user_self_registration": "vclient._sync.services.user_self_registration",
79
82
  "vclient.registry": "vclient._sync.registry",
80
83
  "vclient.testing._client": "vclient._sync.testing._client",
81
84
  }
@@ -311,6 +314,7 @@ def _write_sync_init(path: Path) -> None:
311
314
  " sync_options_service,",
312
315
  " sync_system_service,",
313
316
  " sync_user_lookup_service,",
317
+ " sync_user_self_registration_service,",
314
318
  " sync_users_service,",
315
319
  ")",
316
320
  "",
@@ -334,6 +338,7 @@ def _write_sync_init(path: Path) -> None:
334
338
  ' "sync_options_service",',
335
339
  ' "sync_system_service",',
336
340
  ' "sync_user_lookup_service",',
341
+ ' "sync_user_self_registration_service",',
337
342
  ' "sync_users_service",',
338
343
  "]",
339
344
  "",
@@ -20,6 +20,7 @@ from vclient._sync.registry import (
20
20
  sync_options_service,
21
21
  sync_system_service,
22
22
  sync_user_lookup_service,
23
+ sync_user_self_registration_service,
23
24
  sync_users_service,
24
25
  )
25
26
 
@@ -43,5 +44,6 @@ __all__ = [
43
44
  "sync_options_service",
44
45
  "sync_system_service",
45
46
  "sync_user_lookup_service",
47
+ "sync_user_self_registration_service",
46
48
  "sync_users_service",
47
49
  ]
@@ -38,6 +38,7 @@ if TYPE_CHECKING:
38
38
  SyncOptionsService,
39
39
  SyncSystemService,
40
40
  SyncUserLookupService,
41
+ SyncUserSelfRegistrationService,
41
42
  SyncUsersService,
42
43
  )
43
44
 
@@ -293,13 +294,14 @@ class SyncVClient:
293
294
  self._user_lookup = SyncUserLookupService(self)
294
295
  return self._user_lookup
295
296
 
296
- def users(self, company_id: str | None = None) -> "SyncUsersService":
297
+ def users(self, on_behalf_of: str, *, company_id: str | None = None) -> "SyncUsersService":
297
298
  """Get a SyncUsersService scoped to a specific company.
298
299
 
299
300
  Provides methods to create, retrieve, update, and delete users,
300
301
  as well as access user statistics and assets.
301
302
 
302
303
  Args:
304
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
303
305
  company_id: The ID of the company to operate within. If not provided,
304
306
  uses the default_company_id from config.
305
307
 
@@ -310,27 +312,57 @@ class SyncVClient:
310
312
  ValueError: If no company_id provided and no default configured.
311
313
 
312
314
  Example:
313
- >>> users = client.users("company_id")
315
+ >>> users = client.users("user_id", "company_id")
314
316
  >>> all_users = await users.list_all()
315
317
  >>> user = await users.get("user_id")
316
318
  """
317
319
  from vclient._sync.services.users import SyncUsersService
318
320
 
319
- return SyncUsersService(self, self._resolve_company_id(company_id))
321
+ return SyncUsersService(
322
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
323
+ )
324
+
325
+ def user_self_registration(
326
+ self, *, company_id: str | None = None
327
+ ) -> "SyncUserSelfRegistrationService":
328
+ """Get a SyncUserSelfRegistrationService scoped to a specific company.
329
+
330
+ Handles user self-registration via SSO onboarding. Does not require
331
+ an acting user — only developer API key authentication.
332
+
333
+ Args:
334
+ company_id: The ID of the company to register users in. If not
335
+ provided, uses the default_company_id from config.
336
+
337
+ Returns:
338
+ A SyncUserSelfRegistrationService instance.
339
+
340
+ Raises:
341
+ ValueError: If no company_id provided and no default configured.
320
342
 
321
- def campaigns(self, user_id: str, company_id: str | None = None) -> "SyncCampaignsService":
322
- """Get a SyncCampaignsService scoped to a specific company and user.
343
+ Example:
344
+ >>> registration = client.user_self_registration()
345
+ >>> user = await registration.register(username="alice", email="a@b.com")
346
+ """
347
+ from vclient._sync.services.user_self_registration import SyncUserSelfRegistrationService
348
+
349
+ return SyncUserSelfRegistrationService(self, self._resolve_company_id(company_id))
350
+
351
+ def campaigns(
352
+ self, on_behalf_of: str, *, company_id: str | None = None
353
+ ) -> "SyncCampaignsService":
354
+ """Get a SyncCampaignsService scoped to a specific company.
323
355
 
324
356
  Provides methods to create, retrieve, update, and delete campaigns,
325
357
  as well as access campaign statistics, assets, and notes.
326
358
 
327
359
  Args:
328
- user_id: The ID of the user to operate as.
360
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
329
361
  company_id: The ID of the company to operate within. If not provided,
330
362
  uses the default_company_id from config.
331
363
 
332
364
  Returns:
333
- A SyncCampaignsService instance scoped to the specified company and user.
365
+ A SyncCampaignsService instance scoped to the specified company.
334
366
 
335
367
  Raises:
336
368
  ValueError: If no company_id provided and no default configured.
@@ -342,19 +374,21 @@ class SyncVClient:
342
374
  """
343
375
  from vclient._sync.services.campaigns import SyncCampaignsService
344
376
 
345
- return SyncCampaignsService(self, self._resolve_company_id(company_id), user_id)
377
+ return SyncCampaignsService(
378
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
379
+ )
346
380
 
347
381
  def books(
348
- self, user_id: str, campaign_id: str, *, company_id: str | None = None
382
+ self, campaign_id: str, on_behalf_of: str, *, company_id: str | None = None
349
383
  ) -> "SyncBooksService":
350
- """Get a SyncBooksService scoped to a specific company, user, and campaign.
384
+ """Get a SyncBooksService scoped to a specific company and campaign.
351
385
 
352
386
  Provides methods to create, retrieve, update, and delete campaign books,
353
387
  as well as access book notes and assets.
354
388
 
355
389
  Args:
356
- user_id: The ID of the user to operate as.
357
390
  campaign_id: The ID of the campaign to operate within.
391
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
358
392
  company_id: The ID of the company to operate within. If not provided,
359
393
  uses the default_company_id from config.
360
394
 
@@ -365,26 +399,31 @@ class SyncVClient:
365
399
  ValueError: If no company_id provided and no default configured.
366
400
 
367
401
  Example:
368
- >>> books = client.books("user_id", "campaign_id")
402
+ >>> books = client.books("campaign_id", "user_id")
369
403
  >>> all_books = await books.list_all()
370
404
  >>> book = await books.get("book_id")
371
405
  """
372
406
  from vclient._sync.services.campaign_books import SyncBooksService
373
407
 
374
- return SyncBooksService(self, self._resolve_company_id(company_id), user_id, campaign_id)
408
+ return SyncBooksService(
409
+ self,
410
+ company_id=self._resolve_company_id(company_id),
411
+ campaign_id=campaign_id,
412
+ on_behalf_of=on_behalf_of,
413
+ )
375
414
 
376
415
  def chapters(
377
- self, user_id: str, campaign_id: str, book_id: str, *, company_id: str | None = None
416
+ self, campaign_id: str, book_id: str, on_behalf_of: str, *, company_id: str | None = None
378
417
  ) -> "SyncChaptersService":
379
- """Get a SyncChaptersService scoped to a specific company, user, campaign, and book.
418
+ """Get a SyncChaptersService scoped to a specific company, campaign, and book.
380
419
 
381
420
  Provides methods to create, retrieve, update, and delete campaign book chapters,
382
421
  as well as access chapter notes and assets.
383
422
 
384
423
  Args:
385
- user_id: The ID of the user to operate as.
386
424
  campaign_id: The ID of the campaign to operate within.
387
425
  book_id: The ID of the book to operate within.
426
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
388
427
  company_id: The ID of the company to operate within. If not provided,
389
428
  uses the default_company_id from config.
390
429
 
@@ -395,27 +434,30 @@ class SyncVClient:
395
434
  ValueError: If no company_id provided and no default configured.
396
435
 
397
436
  Example:
398
- >>> chapters = client.chapters("user_id", "campaign_id", "book_id")
437
+ >>> chapters = client.chapters("campaign_id", "book_id", "user_id")
399
438
  >>> all_chapters = await chapters.list_all()
400
439
  >>> chapter = await chapters.get("chapter_id")
401
440
  """
402
441
  from vclient._sync.services.campaign_book_chapters import SyncChaptersService
403
442
 
404
443
  return SyncChaptersService(
405
- self, self._resolve_company_id(company_id), user_id, campaign_id, book_id
444
+ self,
445
+ company_id=self._resolve_company_id(company_id),
446
+ campaign_id=campaign_id,
447
+ book_id=book_id,
448
+ on_behalf_of=on_behalf_of,
406
449
  )
407
450
 
408
451
  def characters(
409
- self, user_id: str, campaign_id: str, *, company_id: str | None = None
452
+ self, on_behalf_of: str, *, company_id: str | None = None
410
453
  ) -> "SyncCharactersService":
411
- """Get a SyncCharactersService scoped to a specific company, user, and campaign.
454
+ """Get a SyncCharactersService scoped to a specific company.
412
455
 
413
- Provides methods to create, retrieve, update, and delete characters within
414
- a campaign.
456
+ Provides methods to create, retrieve, update, and delete characters.
457
+ Use the optional ``campaign_id`` filter on list methods to scope to a campaign.
415
458
 
416
459
  Args:
417
- user_id: The ID of the user to operate as.
418
- campaign_id: The ID of the campaign to operate within.
460
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
419
461
  company_id: The ID of the company to operate within. If not provided,
420
462
  uses the default_company_id from config.
421
463
 
@@ -426,28 +468,27 @@ class SyncVClient:
426
468
  ValueError: If no company_id provided and no default configured.
427
469
 
428
470
  Example:
429
- >>> characters = client.characters("user_id", "campaign_id")
471
+ >>> characters = client.characters("user_id")
430
472
  >>> all_characters = await characters.list_all()
431
473
  >>> character = await characters.get("character_id")
432
474
  """
433
475
  from vclient._sync.services.characters import SyncCharactersService
434
476
 
435
477
  return SyncCharactersService(
436
- self, self._resolve_company_id(company_id), user_id, campaign_id
478
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
437
479
  )
438
480
 
439
481
  def character_traits(
440
- self, user_id: str, campaign_id: str, character_id: str, *, company_id: str | None = None
482
+ self, character_id: str, on_behalf_of: str, *, company_id: str | None = None
441
483
  ) -> "SyncCharacterTraitsService":
442
- """Get a SyncCharacterTraitsService scoped to a specific company, user, campaign, and character.
484
+ """Get a SyncCharacterTraitsService scoped to a specific company and character.
443
485
 
444
486
  Provides methods to create, retrieve, update, and delete character traits within
445
487
  a character.
446
488
 
447
489
  Args:
448
- user_id: The ID of the user to operate as.
449
- campaign_id: The ID of the campaign to operate within.
450
490
  character_id: The ID of the character to operate within.
491
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
451
492
  company_id: The ID of the company to operate within. If not provided,
452
493
  uses the default_company_id from config.
453
494
 
@@ -458,23 +499,29 @@ class SyncVClient:
458
499
  ValueError: If no company_id provided and no default configured.
459
500
 
460
501
  Example:
461
- >>> character_traits = client.character_traits("user_id", "campaign_id", "character_id")
502
+ >>> character_traits = client.character_traits("character_id", "user_id")
462
503
  >>> all_character_traits = await character_traits.list_all()
463
504
  >>> character_trait = await character_traits.get("character_trait_id")
464
505
  """
465
506
  from vclient._sync.services.character_traits import SyncCharacterTraitsService
466
507
 
467
508
  return SyncCharacterTraitsService(
468
- self, self._resolve_company_id(company_id), user_id, campaign_id, character_id
509
+ self,
510
+ company_id=self._resolve_company_id(company_id),
511
+ character_id=character_id,
512
+ on_behalf_of=on_behalf_of,
469
513
  )
470
514
 
471
- def character_blueprint(self, company_id: str | None = None) -> "SyncCharacterBlueprintService":
515
+ def character_blueprint(
516
+ self, on_behalf_of: str | None = None, *, company_id: str | None = None
517
+ ) -> "SyncCharacterBlueprintService":
472
518
  """Get a SyncCharacterBlueprintService scoped to a specific company.
473
519
 
474
520
  Provides methods to create, retrieve, update, and delete character blueprint sections,
475
521
  categories, and traits.
476
522
 
477
523
  Args:
524
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
478
525
  company_id: The ID of the company to operate within. If not provided,
479
526
  uses the default_company_id from config.
480
527
 
@@ -483,14 +530,19 @@ class SyncVClient:
483
530
  """
484
531
  from vclient._sync.services.character_blueprint import SyncCharacterBlueprintService
485
532
 
486
- return SyncCharacterBlueprintService(self, self._resolve_company_id(company_id))
533
+ return SyncCharacterBlueprintService(
534
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
535
+ )
487
536
 
488
- def dictionary(self, company_id: str | None = None) -> "SyncDictionaryService":
537
+ def dictionary(
538
+ self, on_behalf_of: str | None = None, *, company_id: str | None = None
539
+ ) -> "SyncDictionaryService":
489
540
  """Get a SyncDictionaryService scoped to a specific company.
490
541
 
491
542
  Provides methods to create, retrieve, update, and delete dictionary terms.
492
543
 
493
544
  Args:
545
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
494
546
  company_id: The ID of the company to operate within. If not provided,
495
547
  uses the default_company_id from config.
496
548
 
@@ -499,15 +551,19 @@ class SyncVClient:
499
551
  """
500
552
  from vclient._sync.services.dictionary import SyncDictionaryService
501
553
 
502
- return SyncDictionaryService(self, self._resolve_company_id(company_id))
554
+ return SyncDictionaryService(
555
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
556
+ )
503
557
 
504
- def dicerolls(self, user_id: str, company_id: str | None = None) -> "SyncDicerollService":
505
- """Get a SyncDicerollService scoped to a specific company and user.
558
+ def dicerolls(
559
+ self, on_behalf_of: str, *, company_id: str | None = None
560
+ ) -> "SyncDicerollService":
561
+ """Get a SyncDicerollService scoped to a specific company.
506
562
 
507
563
  Provides methods to create, retrieve, and list dice rolls.
508
564
 
509
565
  Args:
510
- user_id: The ID of the user to operate as.
566
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
511
567
  company_id: The ID of the company to operate within. If not provided,
512
568
  uses the default_company_id from config.
513
569
 
@@ -516,14 +572,19 @@ class SyncVClient:
516
572
  """
517
573
  from vclient._sync.services.dicerolls import SyncDicerollService
518
574
 
519
- return SyncDicerollService(self, self._resolve_company_id(company_id), user_id)
575
+ return SyncDicerollService(
576
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
577
+ )
520
578
 
521
- def options(self, company_id: str | None = None) -> "SyncOptionsService":
579
+ def options(
580
+ self, on_behalf_of: str | None = None, *, company_id: str | None = None
581
+ ) -> "SyncOptionsService":
522
582
  """Get a SyncOptionsService scoped to a specific company.
523
583
 
524
584
  Provides methods to retrieve all options and enumerations for the api.
525
585
 
526
586
  Args:
587
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
527
588
  company_id: The ID of the company to operate within. If not provided,
528
589
  uses the default_company_id from config.
529
590
 
@@ -532,18 +593,21 @@ class SyncVClient:
532
593
  """
533
594
  from vclient._sync.services.options import SyncOptionsService
534
595
 
535
- return SyncOptionsService(self, self._resolve_company_id(company_id))
596
+ return SyncOptionsService(
597
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
598
+ )
536
599
 
537
600
  def character_autogen(
538
- self, user_id: str, campaign_id: str, *, company_id: str | None = None
601
+ self, on_behalf_of: str, *, company_id: str | None = None
539
602
  ) -> "SyncCharacterAutogenService":
540
- """Get a SyncCharacterAutogenService scoped to a specific company, user, and campaign.
603
+ """Get a SyncCharacterAutogenService scoped to a specific company.
541
604
 
542
- Provides methods to create, retrieve, update, and delete character autogen.
605
+ Provides methods to autogenerate characters and manage chargen sessions.
606
+ Pass ``campaign_id`` directly to ``generate_character()`` and
607
+ ``start_chargen_session()`` to scope each call to a specific campaign.
543
608
 
544
609
  Args:
545
- user_id: The ID of the user to operate as.
546
- campaign_id: The ID of the campaign to operate within.
610
+ on_behalf_of: User ID to impersonate via On-Behalf-Of header.
547
611
  company_id: The ID of the company to operate within. If not provided,
548
612
  uses the default_company_id from config.
549
613
 
@@ -553,5 +617,5 @@ class SyncVClient:
553
617
  from vclient._sync.services.character_autogen import SyncCharacterAutogenService
554
618
 
555
619
  return SyncCharacterAutogenService(
556
- self, self._resolve_company_id(company_id), user_id, campaign_id
620
+ self, company_id=self._resolve_company_id(company_id), on_behalf_of=on_behalf_of
557
621
  )