wbapi-async 0.6.2__tar.gz → 0.7.1__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.
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/PKG-INFO +1 -1
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/pyproject.toml +1 -1
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/method.py +30 -2
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/.gitignore +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/LICENSE +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/README.md +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/__init__.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/api.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/client/__init__.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/client/session/__init__.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/client/session/base.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/client/session/headers.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/exceptions.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/py.typed +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/type.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/utils/__init__.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/utils/paginate.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/utils/token.py +0 -0
- {wbapi_async-0.6.2 → wbapi_async-0.7.1}/src/wbapi_async/utils/unofficial.py +0 -0
|
@@ -575,9 +575,9 @@ class MethodDispatcher:
|
|
|
575
575
|
body = kwargs.pop("body", None)
|
|
576
576
|
http_method = "POST" if body is not None else "GET"
|
|
577
577
|
|
|
578
|
-
def _do_request(extra: dict[str, Any] | None = None) -> Any:
|
|
578
|
+
def _do_request(extra: dict[str, Any] | None = None, extra_body: dict[str, Any] | None = None) -> Any:
|
|
579
579
|
if body is not None:
|
|
580
|
-
json = {**body, **(extra or {})}
|
|
580
|
+
json = {**body, **(extra or {}), **(extra_body or {})}
|
|
581
581
|
return self.dispatch(http_method, path, params=kwargs or None, json=json)
|
|
582
582
|
params = {**kwargs, **(extra or {})} or None
|
|
583
583
|
return self.dispatch(http_method, path, params=params)
|
|
@@ -601,6 +601,34 @@ class MethodDispatcher:
|
|
|
601
601
|
|
|
602
602
|
result: list[Any] = list(page)
|
|
603
603
|
|
|
604
|
+
# rrd_id cursor — detected by presence of rrd_id in last item
|
|
605
|
+
if page and isinstance(page[-1], dict) and "rrd_id" in page[-1]:
|
|
606
|
+
while page:
|
|
607
|
+
rrd_id = page[-1]["rrd_id"]
|
|
608
|
+
page = _extract_list(await _do_request({"rrdid": rrd_id})) or []
|
|
609
|
+
result.extend(page)
|
|
610
|
+
return result
|
|
611
|
+
|
|
612
|
+
# lastChangeDate cursor — detected by presence of lastChangeDate in last item
|
|
613
|
+
if page and isinstance(page[-1], dict) and "lastChangeDate" in page[-1]:
|
|
614
|
+
while page:
|
|
615
|
+
date_from = page[-1]["lastChangeDate"]
|
|
616
|
+
page = _extract_list(await _do_request({"dateFrom": date_from})) or []
|
|
617
|
+
result.extend(page)
|
|
618
|
+
return result
|
|
619
|
+
|
|
620
|
+
# cursor in response body — for POST endpoints like /content/v2/get/cards/list
|
|
621
|
+
if body is not None and isinstance(raw, dict) and "cursor" in raw:
|
|
622
|
+
cursor_val = raw["cursor"]
|
|
623
|
+
while cursor_val:
|
|
624
|
+
raw = await _do_request(extra_body={"cursor": cursor_val})
|
|
625
|
+
page = _extract_list(raw)
|
|
626
|
+
if not page:
|
|
627
|
+
break
|
|
628
|
+
result.extend(page)
|
|
629
|
+
cursor_val = raw.get("cursor") if isinstance(raw, dict) else None
|
|
630
|
+
return result
|
|
631
|
+
|
|
604
632
|
# Cursor pagination
|
|
605
633
|
if isinstance(raw, dict) and "next" in raw:
|
|
606
634
|
cursor = raw["next"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|