systemlink-cli 2.5.2__py3-none-any.whl → 2.5.3__py3-none-any.whl

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.
slcli/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Version information for slcli."""
2
2
 
3
3
  # This file is auto-generated. Do not edit manually.
4
- __version__ = "2.5.2"
4
+ __version__ = "2.5.3"
slcli/function_click.py CHANGED
@@ -1245,6 +1245,8 @@ def register_function_commands(cli: Any) -> None:
1245
1245
  """Execute a function synchronously and return the result.
1246
1246
 
1247
1247
  This sends a single request and waits for completion (no async polling).
1248
+ The HTTP read timeout allows 60 seconds beyond the execution timeout,
1249
+ or waits indefinitely when the execution timeout is zero.
1248
1250
  """
1249
1251
  format_output = validate_output_format(format)
1250
1252
  url = f"{get_unified_v2_base()}/functions/{function_id}/execute"
@@ -1319,7 +1321,12 @@ def register_function_commands(cli: Any) -> None:
1319
1321
  }
1320
1322
  if client_request_id:
1321
1323
  execute_request["clientRequestId"] = client_request_id
1322
- response_data = make_api_request("POST", url, execute_request).json()
1324
+ response_data = make_api_request(
1325
+ "POST",
1326
+ url,
1327
+ execute_request,
1328
+ timeout=(10.0, float(timeout + 60) if timeout else None),
1329
+ ).json()
1323
1330
  if format_output == "json":
1324
1331
  click.echo(json.dumps(response_data, indent=2))
1325
1332
  return
slcli/utils.py CHANGED
@@ -5,7 +5,7 @@ import json
5
5
  import os
6
6
  import sys
7
7
  from dataclasses import dataclass
8
- from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union
8
+ from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Union
9
9
  from urllib.parse import quote, unquote, urlparse
10
10
 
11
11
  import click
@@ -154,20 +154,22 @@ def handle_api_error(exc: Exception) -> None:
154
154
  status_code = _extract_response_status_code(exc)
155
155
 
156
156
  error_msg = display_msg.lower()
157
- if status_code == 404 or "not found" in error_msg:
158
- click.echo(f"✗ Resource not found: {display_msg}", err=True)
159
- sys.exit(ExitCodes.NOT_FOUND)
160
- elif status_code in (401, 403) or (
161
- "permission" in error_msg or "unauthorized" in error_msg or "forbidden" in error_msg
162
- ):
163
- click.echo(f"✗ Permission denied: {display_msg}", err=True)
164
- sys.exit(ExitCodes.PERMISSION_DENIED)
157
+ if status_code == 404:
158
+ label, code = "Resource not found", ExitCodes.NOT_FOUND
159
+ elif status_code in (401, 403):
160
+ label, code = "Permission denied", ExitCodes.PERMISSION_DENIED
161
+ elif isinstance(exc, (requests.Timeout, requests.ConnectionError)):
162
+ label, code = "Network error", ExitCodes.NETWORK_ERROR
163
+ elif "not found" in error_msg:
164
+ label, code = "Resource not found", ExitCodes.NOT_FOUND
165
+ elif any(word in error_msg for word in ("permission", "unauthorized", "forbidden")):
166
+ label, code = "Permission denied", ExitCodes.PERMISSION_DENIED
165
167
  elif "network" in error_msg or "connection" in error_msg:
166
- click.echo(f"✗ Network error: {display_msg}", err=True)
167
- sys.exit(ExitCodes.NETWORK_ERROR)
168
+ label, code = "Network error", ExitCodes.NETWORK_ERROR
168
169
  else:
169
- click.echo(f"✗ Error: {display_msg}", err=True)
170
- sys.exit(ExitCodes.GENERAL_ERROR)
170
+ label, code = "Error", ExitCodes.GENERAL_ERROR
171
+ click.echo(f"✗ {label}: {display_msg}", err=True)
172
+ sys.exit(code)
171
173
 
172
174
 
173
175
  def format_success(message: str, data: Optional[Any] = None) -> None:
@@ -870,7 +872,7 @@ def make_api_request(
870
872
  stream: bool = False,
871
873
  credential: Optional[str] = None,
872
874
  auth_scheme: Optional[str] = None,
873
- timeout: Optional[float] = None,
875
+ timeout: Optional[Union[float, Tuple[float, Optional[float]]]] = (10.0, 60.0),
874
876
  ) -> requests.Response:
875
877
  """Make API request with consistent error handling and configuration.
876
878
 
@@ -886,7 +888,9 @@ def make_api_request(
886
888
  credential: Optional explicit credential for this request. When omitted, the active
887
889
  credential is resolved from configuration.
888
890
  auth_scheme: Authentication scheme for an explicit credential.
889
- timeout: Optional request timeout in seconds.
891
+ timeout: Socket timeout in seconds, or a (connect, read) pair. Defaults to
892
+ 10 seconds to connect and 60 seconds between reads. A None read timeout
893
+ waits indefinitely for response data; None disables both timeouts.
890
894
 
891
895
  Returns:
892
896
  Response object
@@ -979,6 +983,7 @@ def make_web_request(
979
983
  stream: bool = False,
980
984
  credential: Optional[str] = None,
981
985
  auth_scheme: Optional[str] = None,
986
+ timeout: Optional[Union[float, Tuple[float, Optional[float]]]] = (10.0, 60.0),
982
987
  ) -> requests.Response:
983
988
  """Make a request to a Web Server route using the configured Web URL.
984
989
 
@@ -993,6 +998,7 @@ def make_web_request(
993
998
  stream: Whether to stream the response (for large file downloads)
994
999
  credential: Optional explicit credential for this request.
995
1000
  auth_scheme: Authentication scheme for an explicit credential.
1001
+ timeout: Socket timeout or (connect, read) pair, as in make_api_request.
996
1002
 
997
1003
  Returns:
998
1004
  Response object.
@@ -1008,6 +1014,7 @@ def make_web_request(
1008
1014
  stream=stream,
1009
1015
  credential=credential,
1010
1016
  auth_scheme=auth_scheme,
1017
+ timeout=timeout,
1011
1018
  )
1012
1019
 
1013
1020
 
slcli/workspace_click.py CHANGED
@@ -3,6 +3,7 @@
3
3
  import json
4
4
  import sys
5
5
  from typing import Any, Dict, Optional, Tuple
6
+ from urllib.parse import urlencode
6
7
 
7
8
  import click
8
9
 
@@ -36,12 +37,12 @@ def _fetch_workspaces_page(
36
37
  url = f"{get_base_url()}/niuser/v1/workspaces"
37
38
  page_size = min(take, 100) # API max take is 100
38
39
 
39
- query_params = [f"take={page_size}", f"skip={skip}"]
40
+ query_params = {"take": str(page_size), "skip": str(skip)}
40
41
  if name_filter:
41
42
  # Use *TEXT* pattern for case-insensitive substring matching
42
- query_params.append(f"name=*{name_filter}*")
43
+ query_params["name"] = f"*{name_filter}*"
43
44
 
44
- paginated_url = url + "?" + "&".join(query_params)
45
+ paginated_url = url + "?" + urlencode(query_params, safe="*")
45
46
 
46
47
  resp = make_api_request("GET", paginated_url, payload=None)
47
48
  data = resp.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: systemlink-cli
3
- Version: 2.5.2
3
+ Version: 2.5.3
4
4
  Summary: SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates.
5
5
  License-File: LICENSE
6
6
  Author: Fred Visser
@@ -2,7 +2,7 @@ dff-editor/editor.js,sha256=VQJNqtkFSeXec_hidYdbsvhcKo8-dcdMoU5qvGVn3YQ,97488
2
2
  dff-editor/index.html,sha256=Bbicid_Fx66W7ypHgSGJrUtkAEFcLP3HkRoxiGKZjCs,11657
3
3
  slcli/__init__.py,sha256=ZRF050VsFgb4zeyyQzQINQ4eHFwEBBoUq-CPyziIB6g,66
4
4
  slcli/__main__.py,sha256=wUlBlvYS3Tn4ipw9_7zMr2d1houRpNnALG0TxHg6xZg,829
5
- slcli/_version.py,sha256=u_W1e25kc4jTLZe3vdh3zcmwJ1YQaacPiv7fpLQuwoc,113
5
+ slcli/_version.py,sha256=h0i4q_CPcaOKGcq4PrXFHUJJx6VLd_-e0f6wCfxgUuA,113
6
6
  slcli/alarm_click.py,sha256=0z0SOO_LJQR9dYqLdOTfZgA4Ogl8d1fsJ7TrJHukDsU,32053
7
7
  slcli/asset_click.py,sha256=rBA52bBjn5Kmv0kHv4ft1vBMXFvMGmR292AbX3s_zvY,44544
8
8
  slcli/cli_formatters.py,sha256=ShrU2RbnQUEKhJ6ahWuv8c3zw7C-yg0o20i1opq9gZk,7275
@@ -42,7 +42,7 @@ slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestio
42
42
  slcli/examples/spec-compliance-notebooks/spec_template.xlsx,sha256=fLMzo1oTLVFZ1HM5hqoCPhs_BIxppYM5ETVCgPZLGWg,15675
43
43
  slcli/feed_click.py,sha256=IzE_VwQ8IXmEgqe04afd-wE91JcV7pT3mZ5eYIT4MF4,30437
44
44
  slcli/file_click.py,sha256=5dpUgUc9ZuxG4cWO3pFjnoTyN8wB8RkndE7c5t5_x50,45841
45
- slcli/function_click.py,sha256=0apyt1HtFkqy069aiHtLgICLl1u7XuuKlPC4cQashlA,54311
45
+ slcli/function_click.py,sha256=yU6oy76VV3zSSLkyjht_2VPD2GsSczPrCSO5tLOZsyY,54592
46
46
  slcli/function_templates.py,sha256=GfmsBF0KrsIp2rBiO9ha5UAHv0O9g7yr7xcA4l8vbi8,3371
47
47
  slcli/main.py,sha256=L7ZVgDxE6J5VnQxlGhRZItGAjUIER2Y_0dSA1vHuo6w,29481
48
48
  slcli/managed_client/__init__.py,sha256=OBOqV5QisENmueusHloKye9CWldM1QvLBOTDSDiETVQ,1564
@@ -128,7 +128,7 @@ slcli/templates_click.py,sha256=6c-PcmZG1CLPin77Nj7SjW11W2chyi67LOjmasz37Ck,2348
128
128
  slcli/testmonitor_click.py,sha256=AUVMvnHu8xUTpzZP39YcPDlmDUQ7ESNOCZDxuV5Xbbg,62219
129
129
  slcli/universal_handlers.py,sha256=bcmuDXWJP55urRxGB6xv8rQBzVaJLeQx5bSgZ_JlzJw,11670
130
130
  slcli/user_click.py,sha256=W6moazYg4c1YoM17wE6RD4Aj4410wg7hjpp4BPurwmM,48657
131
- slcli/utils.py,sha256=yc9V9O9vifN1MPcB0llKFBFWKC2iSmEbYYGIXu6DTYk,40189
131
+ slcli/utils.py,sha256=_x_-BlW6mEpZ6sGfCR2aM7mKAMXIq8Sz8NAp1ud3cC8,40780
132
132
  slcli/version_click.py,sha256=qo2VHOlvsEUiw2-Sw1L50pCo-tLBPCJvfTte02oXajY,6998
133
133
  slcli/web_editor.py,sha256=zypvcDmV7c4sikbZlw0_NFNfJo1QeQ5jihwlkzySNIc,17312
134
134
  slcli/webapp_bootstrap.py,sha256=EAf38OeRnGpF3YY6fCRqgFtFalva6eTw8JI5fRMQszU,56881
@@ -196,10 +196,10 @@ slcli/webapp_templates/angular/blank/tsconfig.json,sha256=ihGZtwMzkCDNAWIGID5Mdi
196
196
  slcli/workflow_preview.py,sha256=yXvIC5HtpCC23AxeK8O3-gvZSrAT66qQegBuq95uJjs,12453
197
197
  slcli/workflows_click.py,sha256=Ymb69WCzxhAQZ5bv0jTcXWlXy1yskXhIuv7FbgRBSWk,40658
198
198
  slcli/workitem_click.py,sha256=hmWijNzAvzvNBN0Y1wXoZZbUStRyrVIqg7J2xfJBFxw,88444
199
- slcli/workspace_click.py,sha256=BBiaOmAe_EzkpCG6TlR8aCrwOI81xrMOzMObAfuM_5w,20932
199
+ slcli/workspace_click.py,sha256=T5ZfIHh_AxgGYQshJFxY2bJpCG5LkewRE3ny-pdeFDw,20981
200
200
  slcli/workspace_utils.py,sha256=7QOtotmv3ghJs6a0fDQVojKxrBKPeq_GtE4F1SmZKnM,6872
201
- systemlink_cli-2.5.2.dist-info/METADATA,sha256=THBbaMWHWszPYmA8YsZQrsEw8O2uLXFJpym_Rd0VFwY,1546
202
- systemlink_cli-2.5.2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
203
- systemlink_cli-2.5.2.dist-info/entry_points.txt,sha256=V8IyRF-NYesTOTA_yB4-lVK1EsKZsSY5zOjzGbh5zdA,288
204
- systemlink_cli-2.5.2.dist-info/licenses/LICENSE,sha256=ioLAEBMHywwQkOr14pBIc7nenmWrc-bgcMrqsB_Uvq8,1077
205
- systemlink_cli-2.5.2.dist-info/RECORD,,
201
+ systemlink_cli-2.5.3.dist-info/METADATA,sha256=OnN_9AmDZlN1ec7bNYWWGD-xCCwVZD0u69XzHsFFB9Y,1546
202
+ systemlink_cli-2.5.3.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
203
+ systemlink_cli-2.5.3.dist-info/entry_points.txt,sha256=V8IyRF-NYesTOTA_yB4-lVK1EsKZsSY5zOjzGbh5zdA,288
204
+ systemlink_cli-2.5.3.dist-info/licenses/LICENSE,sha256=ioLAEBMHywwQkOr14pBIc7nenmWrc-bgcMrqsB_Uvq8,1077
205
+ systemlink_cli-2.5.3.dist-info/RECORD,,