quantumbpm-sdk 1.3.0__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 (130) hide show
  1. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/PKG-INFO +58 -36
  2. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/README.md +57 -34
  3. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/pyproject.toml +1 -2
  4. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/__init__.py +3 -3
  5. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/api/bpmn_api.py +1577 -429
  6. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/api/default_api.py +576 -1209
  7. quantumbpm_sdk-2.0.0/quantumbpm/auth.py +141 -0
  8. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/bpmn.py +121 -46
  9. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/client.py +2 -2
  10. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/configuration.py +3 -3
  11. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/dmn.py +0 -29
  12. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/exceptions.py +1 -1
  13. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/__init__.py +8 -2
  14. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/active_scope.py +1 -1
  15. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/batch_evaluate_design_request.py +1 -1
  16. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/batch_evaluation_response.py +1 -1
  17. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/batch_evaluation_response_results_inner.py +1 -1
  18. quantumbpm_sdk-2.0.0/quantumbpm/models/bpmn_activity_state.py +131 -0
  19. quantumbpm_sdk-2.0.0/quantumbpm/models/bpmn_element_statistics.py +106 -0
  20. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_external_job_paginated_response.py +4 -4
  21. quantumbpm_sdk-2.0.0/quantumbpm/models/bpmn_history_page.py +98 -0
  22. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_incident.py +8 -7
  23. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_incident_record.py +9 -12
  24. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_incident_record_paginated_response.py +4 -4
  25. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_instance.py +13 -20
  26. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_instance_children_response.py +1 -1
  27. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_instance_paginated_response.py +4 -4
  28. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_instance_state.py +31 -9
  29. quantumbpm_sdk-2.0.0/quantumbpm/models/bpmn_instance_status.py +40 -0
  30. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_process_definition.py +5 -5
  31. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_process_summary.py +1 -1
  32. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_process_summary_paginated_response.py +1 -1
  33. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_process_version.py +7 -7
  34. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_process_version_paginated_response.py +1 -1
  35. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_resource.py +1 -1
  36. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_resource_detail.py +1 -1
  37. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_resource_paginated_response.py +1 -1
  38. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_resource_summary.py +1 -1
  39. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_resource_summary_paginated_response.py +1 -1
  40. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_user_task_paginated_response.py +4 -4
  41. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_validate_response.py +1 -1
  42. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/bpmn_validation_issue.py +1 -1
  43. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/complete_bpmn_external_job_request.py +5 -5
  44. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/complete_bpmn_external_jobs_batch_request.py +2 -2
  45. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/complete_bpmn_external_jobs_batch_request_items_inner.py +4 -4
  46. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/correlation_keys.py +2 -2
  47. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/create_bpmn_resource_request.py +1 -1
  48. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/create_definition_request.py +6 -8
  49. quantumbpm_sdk-2.0.0/quantumbpm/models/cursor_page.py +92 -0
  50. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/decision_input_field.py +1 -1
  51. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/decision_summary.py +3 -3
  52. quantumbpm_sdk-2.0.0/quantumbpm/models/decision_version.py +97 -0
  53. quantumbpm_sdk-2.0.0/quantumbpm/models/decision_version_list.py +96 -0
  54. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/definition.py +14 -10
  55. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/element_mapping.py +1 -1
  56. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/error.py +2 -2
  57. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/error_mode.py +1 -1
  58. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/evaluate_design_request.py +1 -1
  59. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/evaluate_stored_request.py +5 -5
  60. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/evaluation_result.py +5 -3
  61. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/execution.py +33 -17
  62. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/external_job.py +10 -11
  63. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/external_job_batch_response.py +1 -1
  64. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/external_job_batch_response_results_inner.py +1 -1
  65. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/external_job_queue_depth_item.py +1 -1
  66. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/external_job_queue_depth_response.py +1 -1
  67. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/feel_warning.py +1 -1
  68. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/get_bpmn_instance_variables200_response.py +1 -1
  69. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/get_version200_response.py +3 -7
  70. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/heartbeat_bpmn_external_job_request.py +1 -1
  71. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/hit_rule.py +1 -1
  72. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/join_arrivals.py +1 -1
  73. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/migrate_bpmn_instance_request.py +1 -1
  74. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/migration_validation_result.py +1 -1
  75. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/modification_instruction.py +1 -1
  76. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/modify_bpmn_instance_request.py +1 -1
  77. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/paginated_decisions_response.py +1 -1
  78. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/paginated_definitions_response.py +1 -1
  79. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/paginated_executions_response.py +1 -1
  80. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/pagination_metadata.py +1 -1
  81. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/poll_bpmn_job_request.py +1 -1
  82. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/project.py +1 -1
  83. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/publish_bpmn_message_request.py +1 -1
  84. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/publish_bpmn_signal_request.py +1 -1
  85. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/start_bpmn_instance201_response.py +4 -4
  86. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/start_bpmn_instance_request.py +7 -6
  87. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/start_bpmn_test_instance201_response.py +4 -4
  88. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/start_bpmn_test_instance_request.py +1 -1
  89. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/suspend_bpmn_definition_request.py +1 -1
  90. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/suspend_bpmn_instance_request.py +2 -2
  91. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/suspension_entry.py +1 -1
  92. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/throw_bpmn_external_job_error_request.py +5 -3
  93. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/throw_bpmn_external_job_errors_batch_request.py +2 -2
  94. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/throw_bpmn_external_job_errors_batch_request_items_inner.py +4 -4
  95. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/throw_bpmn_user_task_error_request.py +1 -1
  96. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/trigger_bpmn_ad_hoc_node_request.py +1 -1
  97. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/update_bpmn_instance_variables_request.py +1 -1
  98. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/update_definition_request.py +4 -6
  99. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/update_user_task_assignment_request.py +1 -1
  100. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/user_task.py +14 -12
  101. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/validate_bpmn_resource_request.py +1 -1
  102. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/tracing.py +1 -1
  103. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/workers.py +4 -3
  104. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm_sdk.egg-info/PKG-INFO +58 -36
  105. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm_sdk.egg-info/SOURCES.txt +9 -1
  106. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm_sdk.egg-info/requires.txt +0 -1
  107. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/setup.py +1 -2
  108. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_business_id_threading.py +41 -29
  109. quantumbpm_sdk-2.0.0/tests/test_client_credentials.py +145 -0
  110. quantumbpm_sdk-2.0.0/tests/test_history_args.py +48 -0
  111. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_smoke.py +2 -2
  112. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_token_refresh.py +1 -2
  113. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_workers_job.py +1 -2
  114. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_workers_run.py +1 -2
  115. quantumbpm_sdk-1.3.0/quantumbpm/auth.py +0 -140
  116. quantumbpm_sdk-1.3.0/quantumbpm/models/create_project_request.py +0 -88
  117. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/LICENSE +0 -0
  118. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/api/__init__.py +0 -0
  119. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/api_client.py +0 -0
  120. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/api_response.py +0 -0
  121. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/models/feel_value.py +0 -0
  122. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/py.typed +0 -0
  123. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/rest.py +0 -0
  124. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm/variables.py +0 -0
  125. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm_sdk.egg-info/dependency_links.txt +0 -0
  126. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/quantumbpm_sdk.egg-info/top_level.txt +0 -0
  127. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/setup.cfg +0 -0
  128. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_decimal_roundtrip.py +0 -0
  129. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_workers_clamp.py +0 -0
  130. {quantumbpm_sdk-1.3.0 → quantumbpm_sdk-2.0.0}/tests/test_workers_options.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantumbpm-sdk
3
- Version: 1.3.0
3
+ Version: 2.0.0
4
4
  Summary: QuantumBPM Python SDK - DMN evaluation, BPMN orchestration, and external job workers.
5
5
  Home-page: https://quantumbpm.com
6
6
  Author: QuantumBPM
@@ -14,7 +14,6 @@ Requires-Dist: urllib3<3.0.0,>=2.1.0
14
14
  Requires-Dist: python-dateutil>=2.8.2
15
15
  Requires-Dist: pydantic>=2
16
16
  Requires-Dist: typing-extensions>=4.7.1
17
- Requires-Dist: PyJWT[crypto]>=2.8.0
18
17
  Requires-Dist: simplejson>=3.19
19
18
  Requires-Dist: requests>=2.31.0
20
19
  Dynamic: author
@@ -39,7 +38,7 @@ Python 3.10+. Async-first; built on `asyncio`.
39
38
  | Module | Purpose |
40
39
  | ------------------------- | ----------------------------------------------------------------------------- |
41
40
  | `quantumbpm.QuantumBPM` | Top-level client exposing `.dmn`, `.bpmn`, plus `new_worker(...)` |
42
- | `quantumbpm.auth` | `TokenProvider`, `ZitadelTokenProvider`, `StaticTokenProvider` |
41
+ | `quantumbpm.auth` | `TokenProvider`, `ClientCredentialsTokenProvider`, `StaticTokenProvider` |
43
42
  | `quantumbpm.dmn` | DMN evaluation: stored definitions, ad-hoc XML, batch |
44
43
  | `quantumbpm.bpmn` | BPMN resources, instances, messaging, user tasks, processes |
45
44
  | `quantumbpm.workers` | External job worker runtime - long-poll, lock heartbeat, dispatch |
@@ -50,17 +49,18 @@ Python 3.10+. Async-first; built on `asyncio`.
50
49
 
51
50
  ```python
52
51
  import asyncio
53
- from quantumbpm import QuantumBPM, Vars, ZitadelTokenProvider
52
+ import os
53
+ from quantumbpm import ClientCredentialsTokenProvider, QuantumBPM, Vars
54
54
 
55
55
  async def main():
56
- provider = ZitadelTokenProvider(
57
- "./service-account.json", # Zitadel JSON Key file
58
- "https://auth.quantumbpm.com", # issuer
59
- "your-zitadel-project-id", # audience scope
56
+ provider = ClientCredentialsTokenProvider(
57
+ token_url="https://idp.example.com/realms/acme/protocol/openid-connect/token",
58
+ client_id="billing-svc",
59
+ client_secret=os.environ["QUANTUMBPM_CLIENT_SECRET"],
60
60
  )
61
61
 
62
62
  async with QuantumBPM(
63
- base_url="https://api.quantumbpm.com",
63
+ base_url="https://quantumbpm.example.com",
64
64
  project_id="00000000-0000-0000-0000-000000000000",
65
65
  token_provider=provider,
66
66
  ) as client:
@@ -79,24 +79,33 @@ The async context manager (`async with`) fetches a bearer token on entry, so an
79
79
 
80
80
  The SDK awaits `TokenProvider.get_token()` before every API call and sends the result as the bearer token. Two implementations ship out of the box.
81
81
 
82
- ### Zitadel service account
82
+ ### OAuth 2.0 client credentials
83
83
 
84
- ```python
85
- from quantumbpm import ZitadelTokenProvider
84
+ `ClientCredentialsTokenProvider` fetches access tokens from your OIDC identity provider (Keycloak, Microsoft Entra ID, Okta, Auth0 and others) with the client credentials grant. Register a confidential client for your service at the identity provider and pass its token endpoint and credentials:
86
85
 
87
- provider = ZitadelTokenProvider(
88
- "./service-account.json", # path to JSON Key file
89
- "https://auth.quantumbpm.com", # issuer URL
90
- "your-zitadel-project-id", # adds the audience scope
91
- ssl_ca_cert="/path/to/ca.crt", # optional, for self-signed CAs
86
+ ```python
87
+ import os
88
+ from quantumbpm import ClientCredentialsTokenProvider
89
+
90
+ provider = ClientCredentialsTokenProvider(
91
+ token_url="https://idp.example.com/realms/acme/protocol/openid-connect/token",
92
+ client_id="billing-svc",
93
+ client_secret=os.environ["QUANTUMBPM_CLIENT_SECRET"],
94
+ scopes=["openid"], # optional
95
+ audience="quantumbpm", # optional, some providers such as Auth0 require it
96
+ ssl_ca_cert="/path/to/ca.crt", # optional, for an identity provider behind a private CA
92
97
  )
93
98
  ```
94
99
 
95
- The provider caches the token in memory and fetches a new one once the cached token is within 60 seconds of expiry, so the lookup before each call is cheap.
100
+ The exact token endpoint depends on the identity provider. The provider's OIDC discovery document (`/.well-known/openid-configuration`) lists it as `token_endpoint`.
101
+
102
+ `scopes` are sent space-joined as the `scope` parameter and `audience` as the `audience` parameter. Each is left out of the request when empty. The client must be set up at the identity provider so its tokens carry the audience and roles your QuantumBPM deployment expects.
103
+
104
+ The provider caches the token in memory and fetches a new one once less than 60 seconds of its lifetime remain, so the lookup before each call is cheap. Concurrent callers wait for one shared request. A non-2xx response from the token endpoint raises `quantumbpm.exceptions.ApiException` with the HTTP status and response body.
96
105
 
97
106
  ### Static bearer token
98
107
 
99
- For Enterprise deployments that issue long-lived API keys, or in tests where a token is acquired out of band:
108
+ For a token acquired out of band, for example by another library or in tests:
100
109
 
101
110
  ```python
102
111
  from quantumbpm import StaticTokenProvider
@@ -146,14 +155,6 @@ result = await client.dmn.evaluate(
146
155
  )
147
156
  ```
148
157
 
149
- ### Evaluate by platform UUID
150
-
151
- When you already hold a database-version pointer:
152
-
153
- ```python
154
- result = await client.dmn.evaluate_by_id(definition_uuid, vars)
155
- ```
156
-
157
158
  ### Ad-hoc XML evaluation
158
159
 
159
160
  For "evaluate while editing" flows that don't store the XML:
@@ -188,12 +189,13 @@ batch = await client.dmn.evaluate_design_batch(dmn_xml, rows)
188
189
  draft = await client.bpmn.create_resource("loan-process", bpmn_xml)
189
190
  await client.bpmn.deploy_resource(draft.id)
190
191
 
191
- # Re-fetch to get the populated process-definition list.
192
+ # Re-fetch to get the process versions the deploy created.
192
193
  deployed = await client.bpmn.get_resource(draft.id)
193
194
  process_def = deployed.processes[0]
194
195
 
195
- workflow_id = await client.bpmn.start_instance(
196
- process_def.id,
196
+ # Starts the latest version. Pass version=N to pick one.
197
+ instance_id = await client.bpmn.start_instance(
198
+ process_def.process_id,
197
199
  Vars().set("applicantID", "u-123").set("requestedAmt", 25000),
198
200
  )
199
201
  ```
@@ -201,12 +203,19 @@ workflow_id = await client.bpmn.start_instance(
201
203
  ### Inspect runtime state
202
204
 
203
205
  ```python
204
- state = await client.bpmn.get_instance(workflow_id)
206
+ state = await client.bpmn.get_instance(instance_id)
205
207
  print(state.status, state.active_scopes)
206
208
 
207
- vars = await client.bpmn.get_instance_variables(workflow_id)
209
+ vars = await client.bpmn.get_instance_variables(instance_id)
210
+
211
+ children = await client.bpmn.get_instance_children(instance_id)
212
+
213
+ # History pages run oldest first. Without options a page holds the newest
214
+ # entries, and an entry read by its seq carries its inputs and outputs.
215
+ page = await client.bpmn.get_instance_history(instance_id, from_seq=1, limit=100)
216
+ entry = await client.bpmn.get_instance_history_entry(instance_id, page.items[0].seq)
208
217
 
209
- children = await client.bpmn.get_instance_children(workflow_id)
218
+ version = await client.bpmn.get_process_version("loan-process", 2)
210
219
  ```
211
220
 
212
221
  ### Send messages and signals
@@ -230,6 +239,19 @@ page = await client.bpmn.list_user_tasks(
230
239
  status="CREATED",
231
240
  )
232
241
 
242
+ # Lists of instances and user tasks page by cursor: pass the page's
243
+ # next_cursor back for the next one. It is None on the last page.
244
+ if page.pagination.next_cursor:
245
+ page = await client.bpmn.list_user_tasks(
246
+ assignee="alice@example.com",
247
+ status="CREATED",
248
+ cursor=page.pagination.next_cursor,
249
+ )
250
+
251
+ # The caller's tasks soonest due first, and the project's overdue ones.
252
+ mine = await client.bpmn.list_user_tasks_for_caller(sort="dueDate")
253
+ overdue = await client.bpmn.list_user_tasks(status="CREATED", due_before=datetime.now(timezone.utc))
254
+
233
255
  await client.bpmn.complete_user_task(execution_key, Vars().set("approved", True))
234
256
 
235
257
  # Or fail with a BPMN error code (matches boundary error events):
@@ -283,11 +305,11 @@ Concurrency is per task type. Different task types run independently.
283
305
 
284
306
  `poll_timeout` and `lock_duration` take Go duration strings such as `30s`, `1m30s`, `12.5s` or `500ms`. `handler` and `handle` raise `ValueError` for a value that does not parse. One poll request waits at most 5 seconds on the server, and a larger `poll_timeout` is capped to that. When a poll returns no job, the worker polls again right away.
285
307
 
286
- The server clamps every lock to between 10 seconds and 5 minutes by default (`BPMN_WORKER_LEASE_MIN` and `BPMN_WORKER_LEASE_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
308
+ The server clamps every lock to between 10 seconds and 5 minutes by default (`ENGINE_WORKER_LOCK_MIN` and `ENGINE_WORKER_LOCK_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
287
309
 
288
310
  ### Heartbeats, lost locks, and shutdown
289
311
 
290
- A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`BPMN_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
312
+ A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`ENGINE_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
291
313
 
292
314
  When a heartbeat answers that this worker no longer holds the job (HTTP 409 or 404), the runtime cancels the handler with `asyncio.CancelledError` and reports nothing. A complete or error report rejected with 409 is discarded by the server and logged as a warning. Let `CancelledError` propagate out of handlers.
293
315
 
@@ -395,7 +417,7 @@ from quantumbpm.api.bpmn_api import BpmnApi
395
417
 
396
418
  await client.authenticate()
397
419
  api = BpmnApi(client.raw)
398
- result = api.migrate_bpmn_instance(client.project_id, workflow_id, body)
420
+ result = api.migrate_bpmn_instance(client.project_id, instance_id, body)
399
421
  ```
400
422
 
401
423
  Calls through `client.raw` send the token of the last SDK call. `await client.authenticate()` puts a current token on it first.
@@ -15,7 +15,7 @@ Python 3.10+. Async-first; built on `asyncio`.
15
15
  | Module | Purpose |
16
16
  | ------------------------- | ----------------------------------------------------------------------------- |
17
17
  | `quantumbpm.QuantumBPM` | Top-level client exposing `.dmn`, `.bpmn`, plus `new_worker(...)` |
18
- | `quantumbpm.auth` | `TokenProvider`, `ZitadelTokenProvider`, `StaticTokenProvider` |
18
+ | `quantumbpm.auth` | `TokenProvider`, `ClientCredentialsTokenProvider`, `StaticTokenProvider` |
19
19
  | `quantumbpm.dmn` | DMN evaluation: stored definitions, ad-hoc XML, batch |
20
20
  | `quantumbpm.bpmn` | BPMN resources, instances, messaging, user tasks, processes |
21
21
  | `quantumbpm.workers` | External job worker runtime - long-poll, lock heartbeat, dispatch |
@@ -26,17 +26,18 @@ Python 3.10+. Async-first; built on `asyncio`.
26
26
 
27
27
  ```python
28
28
  import asyncio
29
- from quantumbpm import QuantumBPM, Vars, ZitadelTokenProvider
29
+ import os
30
+ from quantumbpm import ClientCredentialsTokenProvider, QuantumBPM, Vars
30
31
 
31
32
  async def main():
32
- provider = ZitadelTokenProvider(
33
- "./service-account.json", # Zitadel JSON Key file
34
- "https://auth.quantumbpm.com", # issuer
35
- "your-zitadel-project-id", # audience scope
33
+ provider = ClientCredentialsTokenProvider(
34
+ token_url="https://idp.example.com/realms/acme/protocol/openid-connect/token",
35
+ client_id="billing-svc",
36
+ client_secret=os.environ["QUANTUMBPM_CLIENT_SECRET"],
36
37
  )
37
38
 
38
39
  async with QuantumBPM(
39
- base_url="https://api.quantumbpm.com",
40
+ base_url="https://quantumbpm.example.com",
40
41
  project_id="00000000-0000-0000-0000-000000000000",
41
42
  token_provider=provider,
42
43
  ) as client:
@@ -55,24 +56,33 @@ The async context manager (`async with`) fetches a bearer token on entry, so an
55
56
 
56
57
  The SDK awaits `TokenProvider.get_token()` before every API call and sends the result as the bearer token. Two implementations ship out of the box.
57
58
 
58
- ### Zitadel service account
59
+ ### OAuth 2.0 client credentials
59
60
 
60
- ```python
61
- from quantumbpm import ZitadelTokenProvider
61
+ `ClientCredentialsTokenProvider` fetches access tokens from your OIDC identity provider (Keycloak, Microsoft Entra ID, Okta, Auth0 and others) with the client credentials grant. Register a confidential client for your service at the identity provider and pass its token endpoint and credentials:
62
62
 
63
- provider = ZitadelTokenProvider(
64
- "./service-account.json", # path to JSON Key file
65
- "https://auth.quantumbpm.com", # issuer URL
66
- "your-zitadel-project-id", # adds the audience scope
67
- ssl_ca_cert="/path/to/ca.crt", # optional, for self-signed CAs
63
+ ```python
64
+ import os
65
+ from quantumbpm import ClientCredentialsTokenProvider
66
+
67
+ provider = ClientCredentialsTokenProvider(
68
+ token_url="https://idp.example.com/realms/acme/protocol/openid-connect/token",
69
+ client_id="billing-svc",
70
+ client_secret=os.environ["QUANTUMBPM_CLIENT_SECRET"],
71
+ scopes=["openid"], # optional
72
+ audience="quantumbpm", # optional, some providers such as Auth0 require it
73
+ ssl_ca_cert="/path/to/ca.crt", # optional, for an identity provider behind a private CA
68
74
  )
69
75
  ```
70
76
 
71
- The provider caches the token in memory and fetches a new one once the cached token is within 60 seconds of expiry, so the lookup before each call is cheap.
77
+ The exact token endpoint depends on the identity provider. The provider's OIDC discovery document (`/.well-known/openid-configuration`) lists it as `token_endpoint`.
78
+
79
+ `scopes` are sent space-joined as the `scope` parameter and `audience` as the `audience` parameter. Each is left out of the request when empty. The client must be set up at the identity provider so its tokens carry the audience and roles your QuantumBPM deployment expects.
80
+
81
+ The provider caches the token in memory and fetches a new one once less than 60 seconds of its lifetime remain, so the lookup before each call is cheap. Concurrent callers wait for one shared request. A non-2xx response from the token endpoint raises `quantumbpm.exceptions.ApiException` with the HTTP status and response body.
72
82
 
73
83
  ### Static bearer token
74
84
 
75
- For Enterprise deployments that issue long-lived API keys, or in tests where a token is acquired out of band:
85
+ For a token acquired out of band, for example by another library or in tests:
76
86
 
77
87
  ```python
78
88
  from quantumbpm import StaticTokenProvider
@@ -122,14 +132,6 @@ result = await client.dmn.evaluate(
122
132
  )
123
133
  ```
124
134
 
125
- ### Evaluate by platform UUID
126
-
127
- When you already hold a database-version pointer:
128
-
129
- ```python
130
- result = await client.dmn.evaluate_by_id(definition_uuid, vars)
131
- ```
132
-
133
135
  ### Ad-hoc XML evaluation
134
136
 
135
137
  For "evaluate while editing" flows that don't store the XML:
@@ -164,12 +166,13 @@ batch = await client.dmn.evaluate_design_batch(dmn_xml, rows)
164
166
  draft = await client.bpmn.create_resource("loan-process", bpmn_xml)
165
167
  await client.bpmn.deploy_resource(draft.id)
166
168
 
167
- # Re-fetch to get the populated process-definition list.
169
+ # Re-fetch to get the process versions the deploy created.
168
170
  deployed = await client.bpmn.get_resource(draft.id)
169
171
  process_def = deployed.processes[0]
170
172
 
171
- workflow_id = await client.bpmn.start_instance(
172
- process_def.id,
173
+ # Starts the latest version. Pass version=N to pick one.
174
+ instance_id = await client.bpmn.start_instance(
175
+ process_def.process_id,
173
176
  Vars().set("applicantID", "u-123").set("requestedAmt", 25000),
174
177
  )
175
178
  ```
@@ -177,12 +180,19 @@ workflow_id = await client.bpmn.start_instance(
177
180
  ### Inspect runtime state
178
181
 
179
182
  ```python
180
- state = await client.bpmn.get_instance(workflow_id)
183
+ state = await client.bpmn.get_instance(instance_id)
181
184
  print(state.status, state.active_scopes)
182
185
 
183
- vars = await client.bpmn.get_instance_variables(workflow_id)
186
+ vars = await client.bpmn.get_instance_variables(instance_id)
187
+
188
+ children = await client.bpmn.get_instance_children(instance_id)
189
+
190
+ # History pages run oldest first. Without options a page holds the newest
191
+ # entries, and an entry read by its seq carries its inputs and outputs.
192
+ page = await client.bpmn.get_instance_history(instance_id, from_seq=1, limit=100)
193
+ entry = await client.bpmn.get_instance_history_entry(instance_id, page.items[0].seq)
184
194
 
185
- children = await client.bpmn.get_instance_children(workflow_id)
195
+ version = await client.bpmn.get_process_version("loan-process", 2)
186
196
  ```
187
197
 
188
198
  ### Send messages and signals
@@ -206,6 +216,19 @@ page = await client.bpmn.list_user_tasks(
206
216
  status="CREATED",
207
217
  )
208
218
 
219
+ # Lists of instances and user tasks page by cursor: pass the page's
220
+ # next_cursor back for the next one. It is None on the last page.
221
+ if page.pagination.next_cursor:
222
+ page = await client.bpmn.list_user_tasks(
223
+ assignee="alice@example.com",
224
+ status="CREATED",
225
+ cursor=page.pagination.next_cursor,
226
+ )
227
+
228
+ # The caller's tasks soonest due first, and the project's overdue ones.
229
+ mine = await client.bpmn.list_user_tasks_for_caller(sort="dueDate")
230
+ overdue = await client.bpmn.list_user_tasks(status="CREATED", due_before=datetime.now(timezone.utc))
231
+
209
232
  await client.bpmn.complete_user_task(execution_key, Vars().set("approved", True))
210
233
 
211
234
  # Or fail with a BPMN error code (matches boundary error events):
@@ -259,11 +282,11 @@ Concurrency is per task type. Different task types run independently.
259
282
 
260
283
  `poll_timeout` and `lock_duration` take Go duration strings such as `30s`, `1m30s`, `12.5s` or `500ms`. `handler` and `handle` raise `ValueError` for a value that does not parse. One poll request waits at most 5 seconds on the server, and a larger `poll_timeout` is capped to that. When a poll returns no job, the worker polls again right away.
261
284
 
262
- The server clamps every lock to between 10 seconds and 5 minutes by default (`BPMN_WORKER_LEASE_MIN` and `BPMN_WORKER_LEASE_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
285
+ The server clamps every lock to between 10 seconds and 5 minutes by default (`ENGINE_WORKER_LOCK_MIN` and `ENGINE_WORKER_LOCK_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
263
286
 
264
287
  ### Heartbeats, lost locks, and shutdown
265
288
 
266
- A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`BPMN_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
289
+ A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`ENGINE_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
267
290
 
268
291
  When a heartbeat answers that this worker no longer holds the job (HTTP 409 or 404), the runtime cancels the handler with `asyncio.CancelledError` and reports nothing. A complete or error report rejected with 409 is discarded by the server and logged as a warning. Let `CancelledError` propagate out of handlers.
269
292
 
@@ -371,7 +394,7 @@ from quantumbpm.api.bpmn_api import BpmnApi
371
394
 
372
395
  await client.authenticate()
373
396
  api = BpmnApi(client.raw)
374
- result = api.migrate_bpmn_instance(client.project_id, workflow_id, body)
397
+ result = api.migrate_bpmn_instance(client.project_id, instance_id, body)
375
398
  ```
376
399
 
377
400
  Calls through `client.raw` send the token of the last SDK call. `await client.authenticate()` puts a current token on it first.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "quantumbpm-sdk"
3
- version = "1.3.0"
3
+ version = "2.0.0"
4
4
  description = "QuantumBPM Python SDK - DMN evaluation, BPMN orchestration, and external job workers."
5
5
  authors = [
6
6
  {name = "QuantumBPM",email = "support@quantumbpm.com"},
@@ -14,7 +14,6 @@ dependencies = [
14
14
  "python-dateutil (>=2.8.2)",
15
15
  "pydantic (>=2)",
16
16
  "typing-extensions (>=4.7.1)",
17
- "PyJWT[crypto] (>=2.8.0)",
18
17
  "simplejson (>=3.19)",
19
18
  "requests (>=2.31.0)",
20
19
  ]
@@ -9,9 +9,9 @@ endpoints not yet wrapped.
9
9
  """
10
10
 
11
11
  from quantumbpm.auth import (
12
+ ClientCredentialsTokenProvider,
12
13
  StaticTokenProvider,
13
14
  TokenProvider,
14
- ZitadelTokenProvider,
15
15
  )
16
16
  from quantumbpm.bpmn import BpmnClient
17
17
  from quantumbpm.client import QuantumBPM
@@ -19,11 +19,12 @@ from quantumbpm.dmn import DmnClient, DmnResult
19
19
  from quantumbpm.variables import Vars
20
20
  from quantumbpm.workers import BpmnError, Handler, Job, Worker
21
21
 
22
- __version__ = "1.0.0"
22
+ __version__ = "2.0.0"
23
23
 
24
24
  __all__ = [
25
25
  "BpmnClient",
26
26
  "BpmnError",
27
+ "ClientCredentialsTokenProvider",
27
28
  "DmnClient",
28
29
  "DmnResult",
29
30
  "Handler",
@@ -33,5 +34,4 @@ __all__ = [
33
34
  "TokenProvider",
34
35
  "Vars",
35
36
  "Worker",
36
- "ZitadelTokenProvider",
37
37
  ]