From e2cad268927404ec3ccb41829d986c15d4af6830 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Sat, 31 Oct 2026 00:29:06 +0000 Subject: [PATCH] chore: regenerate SDK from v5 OpenAPI spec (5.0.2) --- fern/openapi.json | 91 +++++++++++++++++-- pyproject.toml | 2 +- reference.md | 8 ++ src/supermemory/__init__.py | 12 +++ src/supermemory/client.py | 10 ++ src/supermemory/core/client_wrapper.py | 2 +- src/supermemory/raw_client.py | 10 ++ src/supermemory/requests/__init__.py | 6 ++ src/supermemory/requests/connector_list.py | 4 +- .../requests/connector_list_pagination.py | 28 ++++++ src/supermemory/requests/namespace_list.py | 4 +- .../requests/namespace_list_pagination.py | 28 ++++++ src/supermemory/requests/pagination.py | 12 +++ src/supermemory/types/__init__.py | 6 ++ src/supermemory/types/connector_list.py | 4 +- .../types/connector_list_pagination.py | 55 +++++++++++ src/supermemory/types/namespace_list.py | 4 +- .../types/namespace_list_pagination.py | 55 +++++++++++ src/supermemory/types/pagination.py | 21 +++++ uv.lock | 2 +- 20 files changed, 345 insertions(+), 19 deletions(-) create mode 100644 src/supermemory/requests/connector_list_pagination.py create mode 100644 src/supermemory/requests/namespace_list_pagination.py create mode 100644 src/supermemory/types/connector_list_pagination.py create mode 100644 src/supermemory/types/namespace_list_pagination.py diff --git a/fern/openapi.json b/fern/openapi.json index ae1780a..8c047c7 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -4041,6 +4041,16 @@ "required": true, "description": "Resource collection to list: source documents, extracted chunks, or learned memories" }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + }, + "description": "Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor." + }, { "in": "query", "name": "page", @@ -4419,12 +4429,25 @@ "totalPages": { "type": "number", "description": "Total pages available at the selected limit" + }, + "hasMore": { + "type": "boolean", + "description": "Whether more items exist after this page" + }, + "nextCursor": { + "description": "Opaque cursor for the next page. Pass it back as `cursor` with the same filters, sort, order and limit. Null when there are no more items. Cursor requests skip the per-page count and avoid deep offsets.", + "type": [ + "string", + "null" + ] } }, "required": [ "currentPage", "totalItems", - "totalPages" + "totalPages", + "hasMore", + "nextCursor" ], "description": "Page metadata for the selected resource collection" } @@ -4497,17 +4520,17 @@ { "lang": "typescript", "label": "TypeScript SDK", - "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst page = await client.list(\"user_123\", \"documents\", {\n page: 1,\n limit: 20,\n sort: \"createdAt\",\n order: \"desc\",\n filter: { field: \"type\", operator: \"eq\", value: \"conversation\" },\n});\nconsole.log(page.documents.length, page.pagination.totalPages);" + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\n// Follow pagination.nextCursor instead of page numbers to avoid deep offsets.\nlet cursor: string | undefined;\ndo {\n const page = await client.list(\"user_123\", \"documents\", {\n limit: 100,\n cursor,\n filter: { field: \"type\", operator: \"eq\", value: \"conversation\" },\n });\n console.log(page.documents.length, page.pagination.totalItems);\n cursor = page.pagination.nextCursor ?? undefined;\n} while (cursor);" }, { "lang": "python", "label": "Python SDK", - "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.list(\n \"user_123\",\n \"documents\",\n page=1,\n limit=20,\n sort=\"createdAt\",\n order=\"desc\",\n filter={\"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\"},\n)\nprint(len(page.documents), page.pagination.total_pages)" + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\ncursor = None\nwhile True:\n page = client.list(\n \"user_123\",\n \"documents\",\n limit=100,\n cursor=cursor,\n filter={\"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\"},\n )\n print(len(page.documents), page.pagination.total_items)\n cursor = page.pagination.next_cursor\n if not cursor:\n break" }, { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/list/documents?page=1&limit=20&sort=createdAt&order=desc\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"filter\": { \"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\" } }'" + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/list/documents?limit=100\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"filter\": { \"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\" } }'\n# then repeat with &cursor= until hasMore is false" } ] } @@ -5013,6 +5036,17 @@ }, "totalPages": { "type": "number" + }, + "hasMore": { + "description": "Whether more items exist after this page", + "type": "boolean" + }, + "nextCursor": { + "description": "Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + "type": [ + "string", + "null" + ] } }, "required": [ @@ -5025,7 +5059,9 @@ "currentPage": 1, "limit": 10, "totalItems": 100, - "totalPages": 10 + "totalPages": 10, + "hasMore": true, + "nextCursor": "" } } }, @@ -6075,6 +6111,17 @@ }, "totalPages": { "type": "number" + }, + "hasMore": { + "description": "Whether more items exist after this page", + "type": "boolean" + }, + "nextCursor": { + "description": "Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + "type": [ + "string", + "null" + ] } }, "required": [ @@ -6087,7 +6134,9 @@ "currentPage": 1, "limit": 10, "totalItems": 100, - "totalPages": 10 + "totalPages": 10, + "hasMore": true, + "nextCursor": "" } } }, @@ -7757,6 +7806,17 @@ }, "totalPages": { "type": "number" + }, + "hasMore": { + "description": "Whether more items exist after this page", + "type": "boolean" + }, + "nextCursor": { + "description": "Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + "type": [ + "string", + "null" + ] } }, "required": [ @@ -7769,7 +7829,9 @@ "currentPage": 1, "limit": 10, "totalItems": 100, - "totalPages": 10 + "totalPages": 10, + "hasMore": true, + "nextCursor": "" } } }, @@ -7977,6 +8039,17 @@ }, "totalPages": { "type": "number" + }, + "hasMore": { + "description": "Whether more items exist after this page", + "type": "boolean" + }, + "nextCursor": { + "description": "Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + "type": [ + "string", + "null" + ] } }, "required": [ @@ -7989,7 +8062,9 @@ "currentPage": 1, "limit": 10, "totalItems": 100, - "totalPages": 10 + "totalPages": 10, + "hasMore": true, + "nextCursor": "" } } }, diff --git a/pyproject.toml b/pyproject.toml index 81e1341..ab18ae2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "5.0.1" +version = "5.0.2" description = "The official Python library for the Supermemory API" readme = "README.md" license = "Apache-2.0" diff --git a/reference.md b/reference.md index ae23187..0ce3142 100644 --- a/reference.md +++ b/reference.md @@ -436,6 +436,14 @@ client.list(
+**cursor:** `typing.Optional[str]` — Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor. + +
+
+ +
+
+ **page:** `typing.Optional[int]` — One-based page number
diff --git a/src/supermemory/__init__.py b/src/supermemory/__init__.py index 92bd55c..e1e7e43 100644 --- a/src/supermemory/__init__.py +++ b/src/supermemory/__init__.py @@ -22,6 +22,7 @@ ConnectorInclude, ConnectorLink, ConnectorList, + ConnectorListPagination, ConnectorProvider, ConnectorRun, ConnectorRunStatus, @@ -124,6 +125,7 @@ NamespaceDeleted_Queued, NamespaceDetails, NamespaceList, + NamespaceListPagination, NamespaceSystem, Organization, Pagination, @@ -180,6 +182,7 @@ ConnectorConfigValueParams, ConnectorDeletedParams, ConnectorLinkParams, + ConnectorListPaginationParams, ConnectorListParams, ConnectorParams, ConnectorRunParams, @@ -261,6 +264,7 @@ NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams, NamespaceDetailsParams, + NamespaceListPaginationParams, NamespaceListParams, NamespaceParams, NamespaceSystemParams, @@ -313,6 +317,8 @@ "ConnectorLink": ".types", "ConnectorLinkParams": ".requests", "ConnectorList": ".types", + "ConnectorListPagination": ".types", + "ConnectorListPaginationParams": ".requests", "ConnectorListParams": ".requests", "ConnectorParams": ".requests", "ConnectorProvider": ".types", @@ -499,6 +505,8 @@ "NamespaceDetails": ".types", "NamespaceDetailsParams": ".requests", "NamespaceList": ".types", + "NamespaceListPagination": ".types", + "NamespaceListPaginationParams": ".requests", "NamespaceListParams": ".requests", "NamespaceParams": ".requests", "NamespaceSystem": ".types", @@ -623,6 +631,8 @@ def __dir__(): "ConnectorLink", "ConnectorLinkParams", "ConnectorList", + "ConnectorListPagination", + "ConnectorListPaginationParams", "ConnectorListParams", "ConnectorParams", "ConnectorProvider", @@ -810,6 +820,8 @@ def __dir__(): "NamespaceDetails", "NamespaceDetailsParams", "NamespaceList", + "NamespaceListPagination", + "NamespaceListPaginationParams", "NamespaceListParams", "NamespaceParams", "NamespaceSystem", diff --git a/src/supermemory/client.py b/src/supermemory/client.py index 4a198ac..65b6f2d 100644 --- a/src/supermemory/client.py +++ b/src/supermemory/client.py @@ -373,6 +373,7 @@ def list( namespace: str, type: ListType, *, + cursor: typing.Optional[str] = None, page: typing.Optional[int] = None, limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, @@ -396,6 +397,9 @@ def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories + cursor : typing.Optional[str] + Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor. + page : typing.Optional[int] One-based page number @@ -439,6 +443,7 @@ def list( _response = self._raw_client.list( namespace, type, + cursor=cursor, page=page, limit=limit, sort=sort, @@ -891,6 +896,7 @@ async def list( namespace: str, type: ListType, *, + cursor: typing.Optional[str] = None, page: typing.Optional[int] = None, limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, @@ -914,6 +920,9 @@ async def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories + cursor : typing.Optional[str] + Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor. + page : typing.Optional[int] One-based page number @@ -965,6 +974,7 @@ async def main() -> None: _response = await self._raw_client.list( namespace, type, + cursor=cursor, page=page, limit=limit, sort=sort, diff --git a/src/supermemory/core/client_wrapper.py b/src/supermemory/core/client_wrapper.py index ce88bff..b765c4c 100644 --- a/src/supermemory/core/client_wrapper.py +++ b/src/supermemory/core/client_wrapper.py @@ -33,7 +33,7 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "supermemory/5.0.1", + "User-Agent": "supermemory/5.0.2", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", diff --git a/src/supermemory/raw_client.py b/src/supermemory/raw_client.py index 8eb271e..3910648 100644 --- a/src/supermemory/raw_client.py +++ b/src/supermemory/raw_client.py @@ -486,6 +486,7 @@ def list( namespace: str, type: ListType, *, + cursor: typing.Optional[str] = None, page: typing.Optional[int] = None, limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, @@ -509,6 +510,9 @@ def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories + cursor : typing.Optional[str] + Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor. + page : typing.Optional[int] One-based page number @@ -539,6 +543,7 @@ def list( f"ns/{encode_path_param(namespace)}/list/{encode_path_param(type)}", method="POST", params={ + "cursor": cursor, "page": page, "limit": limit, "sort": sort, @@ -1064,6 +1069,7 @@ async def list( namespace: str, type: ListType, *, + cursor: typing.Optional[str] = None, page: typing.Optional[int] = None, limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, @@ -1087,6 +1093,9 @@ async def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories + cursor : typing.Optional[str] + Opaque cursor from a previous response's `pagination.nextCursor`. When present, `page` is ignored and results continue after the last item of the previous page. Filters, sort, order and limit must match the request that produced the cursor. + page : typing.Optional[int] One-based page number @@ -1117,6 +1126,7 @@ async def list( f"ns/{encode_path_param(namespace)}/list/{encode_path_param(type)}", method="POST", params={ + "cursor": cursor, "page": page, "limit": limit, "sort": sort, diff --git a/src/supermemory/requests/__init__.py b/src/supermemory/requests/__init__.py index f994ada..c3cca8c 100644 --- a/src/supermemory/requests/__init__.py +++ b/src/supermemory/requests/__init__.py @@ -18,6 +18,7 @@ from .connector_deleted import ConnectorDeletedParams from .connector_link import ConnectorLinkParams from .connector_list import ConnectorListParams + from .connector_list_pagination import ConnectorListPaginationParams from .connector_run import ConnectorRunParams from .connector_run_system import ConnectorRunSystemParams from .connector_selection import ConnectorSelectionParams @@ -105,6 +106,7 @@ from .namespace_deleted_queued import NamespaceDeletedQueuedParams from .namespace_details import NamespaceDetailsParams from .namespace_list import NamespaceListParams + from .namespace_list_pagination import NamespaceListPaginationParams from .namespace_system import NamespaceSystemParams from .organization import OrganizationParams from .pagination import PaginationParams @@ -138,6 +140,7 @@ "ConnectorConfigValueParams": ".connector_config_value", "ConnectorDeletedParams": ".connector_deleted", "ConnectorLinkParams": ".connector_link", + "ConnectorListPaginationParams": ".connector_list_pagination", "ConnectorListParams": ".connector_list", "ConnectorParams": ".connector", "ConnectorRunParams": ".connector_run", @@ -219,6 +222,7 @@ "NamespaceDeleted_DeletedParams": ".namespace_deleted", "NamespaceDeleted_QueuedParams": ".namespace_deleted", "NamespaceDetailsParams": ".namespace_details", + "NamespaceListPaginationParams": ".namespace_list_pagination", "NamespaceListParams": ".namespace_list", "NamespaceParams": ".namespace", "NamespaceSystemParams": ".namespace_system", @@ -278,6 +282,7 @@ def __dir__(): "ConnectorConfigValueParams", "ConnectorDeletedParams", "ConnectorLinkParams", + "ConnectorListPaginationParams", "ConnectorListParams", "ConnectorParams", "ConnectorRunParams", @@ -359,6 +364,7 @@ def __dir__(): "NamespaceDeleted_DeletedParams", "NamespaceDeleted_QueuedParams", "NamespaceDetailsParams", + "NamespaceListPaginationParams", "NamespaceListParams", "NamespaceParams", "NamespaceSystemParams", diff --git a/src/supermemory/requests/connector_list.py b/src/supermemory/requests/connector_list.py index 01451df..6fa9f75 100644 --- a/src/supermemory/requests/connector_list.py +++ b/src/supermemory/requests/connector_list.py @@ -4,12 +4,12 @@ import typing_extensions from .connector import ConnectorParams -from .pagination import PaginationParams +from .connector_list_pagination import ConnectorListPaginationParams class ConnectorListParams(typing_extensions.TypedDict): connectors: typing.Sequence[ConnectorParams] - pagination: PaginationParams + pagination: ConnectorListPaginationParams """ Pagination metadata """ diff --git a/src/supermemory/requests/connector_list_pagination.py b/src/supermemory/requests/connector_list_pagination.py new file mode 100644 index 0000000..8e22121 --- /dev/null +++ b/src/supermemory/requests/connector_list_pagination.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class ConnectorListPaginationParams(typing_extensions.TypedDict): + """ + Pagination metadata + """ + + current_page: typing_extensions.Annotated[float, FieldMetadata(alias="currentPage")] + limit: typing_extensions.NotRequired[float] + total_items: typing_extensions.Annotated[float, FieldMetadata(alias="totalItems")] + total_pages: typing_extensions.Annotated[float, FieldMetadata(alias="totalPages")] + has_more: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="hasMore")]] + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextCursor")] + ] + """ + Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items. + """ diff --git a/src/supermemory/requests/namespace_list.py b/src/supermemory/requests/namespace_list.py index f9ce174..7ba5104 100644 --- a/src/supermemory/requests/namespace_list.py +++ b/src/supermemory/requests/namespace_list.py @@ -4,7 +4,7 @@ import typing_extensions from .namespace import NamespaceParams -from .pagination import PaginationParams +from .namespace_list_pagination import NamespaceListPaginationParams class NamespaceListParams(typing_extensions.TypedDict): @@ -13,7 +13,7 @@ class NamespaceListParams(typing_extensions.TypedDict): Namespaces on this page, newest first """ - pagination: PaginationParams + pagination: NamespaceListPaginationParams """ Pagination metadata """ diff --git a/src/supermemory/requests/namespace_list_pagination.py b/src/supermemory/requests/namespace_list_pagination.py new file mode 100644 index 0000000..bf10ad1 --- /dev/null +++ b/src/supermemory/requests/namespace_list_pagination.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class NamespaceListPaginationParams(typing_extensions.TypedDict): + """ + Pagination metadata + """ + + current_page: typing_extensions.Annotated[float, FieldMetadata(alias="currentPage")] + limit: typing_extensions.NotRequired[float] + total_items: typing_extensions.Annotated[float, FieldMetadata(alias="totalItems")] + total_pages: typing_extensions.Annotated[float, FieldMetadata(alias="totalPages")] + has_more: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="hasMore")]] + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextCursor")] + ] + """ + Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items. + """ diff --git a/src/supermemory/requests/pagination.py b/src/supermemory/requests/pagination.py index 4707336..7b9b9a7 100644 --- a/src/supermemory/requests/pagination.py +++ b/src/supermemory/requests/pagination.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +import typing + import typing_extensions from ..core.serialization import FieldMetadata @@ -28,3 +30,13 @@ class PaginationParams(typing_extensions.TypedDict): """ Total pages available at the selected limit """ + + has_more: typing_extensions.Annotated[bool, FieldMetadata(alias="hasMore")] + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextCursor")] + """ + Opaque cursor for the next page. Pass it back as `cursor` with the same filters, sort, order and limit. Null when there are no more items. Cursor requests skip the per-page count and avoid deep offsets. + """ diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index fbcd8ce..5522880 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -21,6 +21,7 @@ from .connector_include import ConnectorInclude from .connector_link import ConnectorLink from .connector_list import ConnectorList + from .connector_list_pagination import ConnectorListPagination from .connector_provider import ConnectorProvider from .connector_run import ConnectorRun from .connector_run_status import ConnectorRunStatus @@ -123,6 +124,7 @@ from .namespace_deleted_queued import NamespaceDeletedQueued from .namespace_details import NamespaceDetails from .namespace_list import NamespaceList + from .namespace_list_pagination import NamespaceListPagination from .namespace_system import NamespaceSystem from .organization import Organization from .pagination import Pagination @@ -165,6 +167,7 @@ "ConnectorInclude": ".connector_include", "ConnectorLink": ".connector_link", "ConnectorList": ".connector_list", + "ConnectorListPagination": ".connector_list_pagination", "ConnectorProvider": ".connector_provider", "ConnectorRun": ".connector_run", "ConnectorRunStatus": ".connector_run_status", @@ -267,6 +270,7 @@ "NamespaceDeleted_Queued": ".namespace_deleted", "NamespaceDetails": ".namespace_details", "NamespaceList": ".namespace_list", + "NamespaceListPagination": ".namespace_list_pagination", "NamespaceSystem": ".namespace_system", "Organization": ".organization", "Pagination": ".pagination", @@ -333,6 +337,7 @@ def __dir__(): "ConnectorInclude", "ConnectorLink", "ConnectorList", + "ConnectorListPagination", "ConnectorProvider", "ConnectorRun", "ConnectorRunStatus", @@ -435,6 +440,7 @@ def __dir__(): "NamespaceDeleted_Queued", "NamespaceDetails", "NamespaceList", + "NamespaceListPagination", "NamespaceSystem", "Organization", "Pagination", diff --git a/src/supermemory/types/connector_list.py b/src/supermemory/types/connector_list.py index 3e8a6b2..7d3b6c3 100644 --- a/src/supermemory/types/connector_list.py +++ b/src/supermemory/types/connector_list.py @@ -6,12 +6,12 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .connector import Connector -from .pagination import Pagination +from .connector_list_pagination import ConnectorListPagination class ConnectorList(UncheckedBaseModel): connectors: typing.List[Connector] - pagination: Pagination = pydantic.Field() + pagination: ConnectorListPagination = pydantic.Field() """ Pagination metadata """ diff --git a/src/supermemory/types/connector_list_pagination.py b/src/supermemory/types/connector_list_pagination.py new file mode 100644 index 0000000..e44899f --- /dev/null +++ b/src/supermemory/types/connector_list_pagination.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ConnectorListPagination(UncheckedBaseModel): + """ + Pagination metadata + """ + + current_page: typing_extensions.Annotated[ + float, FieldMetadata(alias="currentPage"), pydantic.Field(alias="currentPage") + ] + limit: typing.Optional[float] = None + total_items: typing_extensions.Annotated[ + float, FieldMetadata(alias="totalItems"), pydantic.Field(alias="totalItems") + ] + total_pages: typing_extensions.Annotated[ + float, FieldMetadata(alias="totalPages"), pydantic.Field(alias="totalPages") + ] + has_more: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="hasMore"), + pydantic.Field(alias="hasMore", description="Whether more items exist after this page"), + ] = None + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.Annotated[ + typing.Optional[str], + FieldMetadata(alias="nextCursor"), + pydantic.Field( + alias="nextCursor", + description="Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + ), + ] = None + """ + Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/supermemory/types/namespace_list.py b/src/supermemory/types/namespace_list.py index f37cc80..c609fa3 100644 --- a/src/supermemory/types/namespace_list.py +++ b/src/supermemory/types/namespace_list.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .namespace import Namespace -from .pagination import Pagination +from .namespace_list_pagination import NamespaceListPagination class NamespaceList(UncheckedBaseModel): @@ -15,7 +15,7 @@ class NamespaceList(UncheckedBaseModel): Namespaces on this page, newest first """ - pagination: Pagination = pydantic.Field() + pagination: NamespaceListPagination = pydantic.Field() """ Pagination metadata """ diff --git a/src/supermemory/types/namespace_list_pagination.py b/src/supermemory/types/namespace_list_pagination.py new file mode 100644 index 0000000..59bf18a --- /dev/null +++ b/src/supermemory/types/namespace_list_pagination.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class NamespaceListPagination(UncheckedBaseModel): + """ + Pagination metadata + """ + + current_page: typing_extensions.Annotated[ + float, FieldMetadata(alias="currentPage"), pydantic.Field(alias="currentPage") + ] + limit: typing.Optional[float] = None + total_items: typing_extensions.Annotated[ + float, FieldMetadata(alias="totalItems"), pydantic.Field(alias="totalItems") + ] + total_pages: typing_extensions.Annotated[ + float, FieldMetadata(alias="totalPages"), pydantic.Field(alias="totalPages") + ] + has_more: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="hasMore"), + pydantic.Field(alias="hasMore", description="Whether more items exist after this page"), + ] = None + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.Annotated[ + typing.Optional[str], + FieldMetadata(alias="nextCursor"), + pydantic.Field( + alias="nextCursor", + description="Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items.", + ), + ] = None + """ + Opaque cursor for the next page. Pass it back as `cursor`. Null when there are no more items. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/supermemory/types/pagination.py b/src/supermemory/types/pagination.py index 974992f..1635c80 100644 --- a/src/supermemory/types/pagination.py +++ b/src/supermemory/types/pagination.py @@ -46,6 +46,27 @@ class Pagination(UncheckedBaseModel): Total pages available at the selected limit """ + has_more: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="hasMore"), + pydantic.Field(alias="hasMore", description="Whether more items exist after this page"), + ] + """ + Whether more items exist after this page + """ + + next_cursor: typing_extensions.Annotated[ + typing.Optional[str], + FieldMetadata(alias="nextCursor"), + pydantic.Field( + alias="nextCursor", + description="Opaque cursor for the next page. Pass it back as `cursor` with the same filters, sort, order and limit. Null when there are no more items. Cursor requests skip the per-page count and avoid deep offsets.", + ), + ] = None + """ + Opaque cursor for the next page. Pass it back as `cursor` with the same filters, sort, order and limit. Null when there are no more items. Cursor requests skip the per-page count and avoid deep offsets. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/uv.lock b/uv.lock index 92fb6dd..07925dd 100644 --- a/uv.lock +++ b/uv.lock @@ -1256,7 +1256,7 @@ wheels = [ [[package]] name = "supermemory" -version = "5.0.1" +version = "5.0.2" source = { editable = "." } dependencies = [ { name = "httpx" },