chill-sharp-py-client 1.2.0__tar.gz → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chill-sharp-py-client
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Python client for generic ChillSharp services
5
5
  Author: Andrea Piovesan
6
6
  License: AGPL-3.0-or-later
@@ -99,6 +99,20 @@ If the service supports ChillSharp auth endpoints, the client can log in and ref
99
99
  Query payloads can include an `Ordering` object with `PropertyName` and `Direction`.
100
100
  If you omit `Ordering`, the backend defaults to `Position`. Entity payloads also include `Position`, with default value `0`.
101
101
 
102
+ ### Command
103
+
104
+ Use `command()` to execute a registered custom command. The response includes the command's updated parameters.
105
+
106
+ ```python
107
+ result = client.command({
108
+ "ChillType": "Commands.SendNotification",
109
+ "Parameters": {
110
+ "Recipient": "ada@example.com",
111
+ "Message": "Your report is ready",
112
+ },
113
+ })
114
+ ```
115
+
102
116
  ### Query
103
117
 
104
118
  Use `query()` when `ChillType` points to a concrete query type such as `Query.PostQuery`.
@@ -404,11 +418,10 @@ token = client.register_auth_account({
404
418
  "Password": "Pass123$",
405
419
  "DisplayName": "Root",
406
420
  "DisplayCultureName": "it-IT",
407
- "CreateChillAuthUser": True,
408
421
  })
409
422
  ```
410
423
 
411
- If `DisplayCultureName` is provided and `CreateChillAuthUser` is `True`, the server presets the linked `AuthUser` with culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
424
+ The server always creates the linked `AuthUser`. If `DisplayCultureName` is provided, it presets culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
412
425
 
413
426
  ### Login
414
427
 
@@ -84,6 +84,20 @@ If the service supports ChillSharp auth endpoints, the client can log in and ref
84
84
  Query payloads can include an `Ordering` object with `PropertyName` and `Direction`.
85
85
  If you omit `Ordering`, the backend defaults to `Position`. Entity payloads also include `Position`, with default value `0`.
86
86
 
87
+ ### Command
88
+
89
+ Use `command()` to execute a registered custom command. The response includes the command's updated parameters.
90
+
91
+ ```python
92
+ result = client.command({
93
+ "ChillType": "Commands.SendNotification",
94
+ "Parameters": {
95
+ "Recipient": "ada@example.com",
96
+ "Message": "Your report is ready",
97
+ },
98
+ })
99
+ ```
100
+
87
101
  ### Query
88
102
 
89
103
  Use `query()` when `ChillType` points to a concrete query type such as `Query.PostQuery`.
@@ -389,11 +403,10 @@ token = client.register_auth_account({
389
403
  "Password": "Pass123$",
390
404
  "DisplayName": "Root",
391
405
  "DisplayCultureName": "it-IT",
392
- "CreateChillAuthUser": True,
393
406
  })
394
407
  ```
395
408
 
396
- If `DisplayCultureName` is provided and `CreateChillAuthUser` is `True`, the server presets the linked `AuthUser` with culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
409
+ The server always creates the linked `AuthUser`. If `DisplayCultureName` is provided, it presets culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
397
410
 
398
411
  ### Login
399
412
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chill-sharp-py-client
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Python client for generic ChillSharp services
5
5
  Author: Andrea Piovesan
6
6
  License: AGPL-3.0-or-later
@@ -99,6 +99,20 @@ If the service supports ChillSharp auth endpoints, the client can log in and ref
99
99
  Query payloads can include an `Ordering` object with `PropertyName` and `Direction`.
100
100
  If you omit `Ordering`, the backend defaults to `Position`. Entity payloads also include `Position`, with default value `0`.
101
101
 
102
+ ### Command
103
+
104
+ Use `command()` to execute a registered custom command. The response includes the command's updated parameters.
105
+
106
+ ```python
107
+ result = client.command({
108
+ "ChillType": "Commands.SendNotification",
109
+ "Parameters": {
110
+ "Recipient": "ada@example.com",
111
+ "Message": "Your report is ready",
112
+ },
113
+ })
114
+ ```
115
+
102
116
  ### Query
103
117
 
104
118
  Use `query()` when `ChillType` points to a concrete query type such as `Query.PostQuery`.
@@ -404,11 +418,10 @@ token = client.register_auth_account({
404
418
  "Password": "Pass123$",
405
419
  "DisplayName": "Root",
406
420
  "DisplayCultureName": "it-IT",
407
- "CreateChillAuthUser": True,
408
421
  })
409
422
  ```
410
423
 
411
- If `DisplayCultureName` is provided and `CreateChillAuthUser` is `True`, the server presets the linked `AuthUser` with culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
424
+ The server always creates the linked `AuthUser`. If `DisplayCultureName` is provided, it presets culture-based defaults for `DisplayTimeZone`, `DisplayDateFormat`, and `DisplayNumberFormat`.
412
425
 
413
426
  ### Login
414
427
 
@@ -17,8 +17,8 @@ You should have received a copy of the GNU Affero General Public License
17
17
  along with this program. If not, see <https://www.gnu.org/licenses/>.
18
18
  """
19
19
 
20
- from .client import API_BASE_PATH, CHILL_SHARP_PY_CLIENT_VERSION, AutomaticQuery, AutomaticQueryFilter, AutomaticQueryGroup, AutomaticQueryLogicalOperator, AutomaticQueryOperator, ChillDtoQuery, ChillSharpClient, ChillUserPreferences, PermissionAction, PermissionEffect, PermissionScope
20
+ from .client import API_BASE_PATH, CHILL_SHARP_PY_CLIENT_VERSION, AutomaticQuery, AutomaticQueryFilter, AutomaticQueryGroup, AutomaticQueryLogicalOperator, AutomaticQueryOperator, ChillDtoCommand, ChillDtoQuery, ChillSharpClient, ChillUserPreferences, PermissionAction, PermissionEffect, PermissionScope
21
21
  from .exceptions import ChillSharpClientError
22
22
 
23
- __all__ = ["API_BASE_PATH", "CHILL_SHARP_PY_CLIENT_VERSION", "AutomaticQuery", "AutomaticQueryFilter", "AutomaticQueryGroup", "AutomaticQueryLogicalOperator", "AutomaticQueryOperator", "ChillDtoQuery", "ChillSharpClient", "ChillSharpClientError", "ChillUserPreferences", "PermissionAction", "PermissionEffect", "PermissionScope"]
23
+ __all__ = ["API_BASE_PATH", "CHILL_SHARP_PY_CLIENT_VERSION", "AutomaticQuery", "AutomaticQueryFilter", "AutomaticQueryGroup", "AutomaticQueryLogicalOperator", "AutomaticQueryOperator", "ChillDtoCommand", "ChillDtoQuery", "ChillSharpClient", "ChillSharpClientError", "ChillUserPreferences", "PermissionAction", "PermissionEffect", "PermissionScope"]
24
24
  __version__ = CHILL_SHARP_PY_CLIENT_VERSION
@@ -107,6 +107,13 @@ class ChillDtoQuery(TypedDict, total=False):
107
107
  results: list[JsonDict]
108
108
 
109
109
 
110
+ class ChillDtoCommand(TypedDict, total=False):
111
+ """Command endpoint payload containing a type and its named parameters."""
112
+
113
+ chillType: str
114
+ parameters: JsonDict
115
+
116
+
110
117
  class PermissionEffect(IntEnum):
111
118
  """Effect applied by a permission rule."""
112
119
 
@@ -118,6 +125,7 @@ class PermissionAction(IntEnum):
118
125
  """Action controlled by a permission rule."""
119
126
 
120
127
  FULL_CONTROL = 0
128
+ COMMAND = 7
121
129
  QUERY = 1
122
130
  CREATE = 2
123
131
  UPDATE = 3
@@ -170,6 +178,10 @@ class ChillSharpClient:
170
178
  """Send a query request to the Chill endpoint."""
171
179
  return self._send_json("POST", self._build_chill_url("query"), dto_query)
172
180
 
181
+ def command(self, dto_command: ChillDtoCommand) -> ChillDtoCommand:
182
+ """Execute a custom command using its named parameters."""
183
+ return self._send_json("POST", self._build_chill_url("command"), dto_command)
184
+
173
185
  def lookup(self, dto_query: JsonDict) -> JsonDict:
174
186
  """Send a generic full-text lookup request to the Chill endpoint."""
175
187
  return self._send_json("POST", self._build_chill_url("lookup"), dto_query)
@@ -479,6 +491,13 @@ class ChillSharpClient:
479
491
  response = self._send_auth_json("GET", f"get-entity-list{suffix}")
480
492
  return response if isinstance(response, list) else []
481
493
 
494
+ def get_auth_command_list(self, module: str | None = None) -> list[str]:
495
+ """Return the distinct command list for an optional auth module."""
496
+ normalized_module = self._normalize_optional_value(module)
497
+ suffix = f"?module={quote(normalized_module)}" if normalized_module is not None else ""
498
+ response = self._send_auth_json("GET", f"get-command-list{suffix}")
499
+ return response if isinstance(response, list) else []
500
+
482
501
  def get_auth_query_list(self, module: str | None = None) -> list[str]:
483
502
  """Return the distinct query list for an optional auth module."""
484
503
  normalized_module = self._normalize_optional_value(module)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "chill-sharp-py-client"
7
- version = "1.2.0"
7
+ version = "1.3.0"
8
8
  description = "Python client for generic ChillSharp services"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"