Skip to content

Commit d3ddf8a

Browse files
stainless-app[bot]batuhan
authored andcommitted
feat(api): api update
1 parent cd34f8e commit d3ddf8a

47 files changed

Lines changed: 2361 additions & 318 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 24
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper/beeper-desktop-api-8b89ffbfeb39b4186328fefd81f7dab1d28c786012201feb8035c7f920c4fbae.yml
3-
openapi_spec_hash: de40e013fcc83fa44d5c51ddecb543c0
4-
config_hash: 08b781db5f1857ed601d1b2f4b6b45d9
1+
configured_endpoints: 30
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper/beeper-desktop-api-c08c14bb754b4cb0e02b21fabb680469368286be339dec0aaa8c69d04a1f021a.yml
3+
openapi_spec_hash: a10246aaf7cdc33b682fc245bd5f893b
4+
config_hash: 72f9d43b9b51a5da912e9f3730e53ae2

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ client = BeeperDesktop(
4343
)
4444

4545
page = client.chats.search(
46+
account_ids=["matrix", "discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
4647
include_muted=True,
4748
limit=3,
4849
type="single",
@@ -71,6 +72,7 @@ client = AsyncBeeperDesktop(
7172

7273
async def main() -> None:
7374
page = await client.chats.search(
75+
account_ids=["matrix", "discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
7476
include_muted=True,
7577
limit=3,
7678
type="single",
@@ -111,6 +113,7 @@ async def main() -> None:
111113
http_client=DefaultAioHttpClient(),
112114
) as client:
113115
page = await client.chats.search(
116+
account_ids=["matrix", "discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
114117
include_muted=True,
115118
limit=3,
116119
type="single",
@@ -144,9 +147,9 @@ client = BeeperDesktop()
144147
all_messages = []
145148
# Automatically fetches more pages as needed.
146149
for message in client.messages.search(
147-
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
150+
account_ids=["discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
148151
limit=10,
149-
query="deployment",
152+
query="oauth",
150153
):
151154
# Do something with message here
152155
all_messages.append(message)
@@ -166,9 +169,9 @@ async def main() -> None:
166169
all_messages = []
167170
# Iterate through items across all pages, issuing requests as needed.
168171
async for message in client.messages.search(
169-
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
172+
account_ids=["discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
170173
limit=10,
171-
query="deployment",
174+
query="oauth",
172175
):
173176
all_messages.append(message)
174177
print(all_messages)
@@ -181,9 +184,9 @@ Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get
181184

182185
```python
183186
first_page = await client.messages.search(
184-
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
187+
account_ids=["discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
185188
limit=10,
186-
query="deployment",
189+
query="oauth",
187190
)
188191
if first_page.has_next_page():
189192
print(f"will fetch next page using these details: {first_page.next_page_info()}")
@@ -197,9 +200,9 @@ Or just work directly with the returned data:
197200

198201
```python
199202
first_page = await client.messages.search(
200-
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
203+
account_ids=["discordgo", "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc"],
201204
limit=10,
202-
query="deployment",
205+
query="oauth",
203206
)
204207

205208
print(f"next page cursor: {first_page.oldest_cursor}") # => "next page cursor: ..."
@@ -218,11 +221,11 @@ from beeper_desktop_api import BeeperDesktop
218221

219222
client = BeeperDesktop()
220223

221-
response = client.chats.start(
222-
account_id="accountID",
223-
user={},
224+
chat = client.chats.update(
225+
chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",
226+
draft={"text": "text"},
224227
)
225-
print(response.user)
228+
print(chat.draft)
226229
```
227230

228231
## File uploads

api.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ Methods:
5454

5555
- <code title="post /v1/chats">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">create</a>(\*\*<a href="src/beeper_desktop_api/types/chat_create_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat_create_response.py">ChatCreateResponse</a></code>
5656
- <code title="get /v1/chats/{chatID}">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">retrieve</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/chat_retrieve_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat.py">Chat</a></code>
57+
- <code title="patch /v1/chats/{chatID}">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">update</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/chat_update_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat.py">Chat</a></code>
5758
- <code title="get /v1/chats">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">list</a>(\*\*<a href="src/beeper_desktop_api/types/chat_list_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat_list_response.py">SyncCursorNoLimit[ChatListResponse]</a></code>
5859
- <code title="post /v1/chats/{chatID}/archive">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">archive</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/chat_archive_params.py">params</a>) -> None</code>
60+
- <code title="post /v1/chats/{chatID}/read">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">mark_read</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/chat_mark_read_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat.py">Chat</a></code>
61+
- <code title="post /v1/chats/{chatID}/unread">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">mark_unread</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/chat_mark_unread_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat.py">Chat</a></code>
62+
- <code title="post /v1/chats/{chatID}/notify-anyway">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">notify_anyway</a>(chat_id) -> <a href="./src/beeper_desktop_api/types/chat.py">Chat</a></code>
5963
- <code title="get /v1/chats/search">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">search</a>(\*\*<a href="src/beeper_desktop_api/types/chat_search_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat.py">SyncCursorSearch[Chat]</a></code>
60-
- <code title="post /v1/chats.start">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">start</a>(\*\*<a href="src/beeper_desktop_api/types/chat_start_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat_start_response.py">ChatStartResponse</a></code>
64+
- <code title="post /v1/chats/start">client.chats.<a href="./src/beeper_desktop_api/resources/chats/chats.py">start</a>(\*\*<a href="src/beeper_desktop_api/types/chat_start_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chat_start_response.py">ChatStartResponse</a></code>
6165

6266
## Reminders
6367

@@ -78,7 +82,7 @@ from beeper_desktop_api.types.chats.messages import ReactionDeleteResponse, Reac
7882

7983
Methods:
8084

81-
- <code title="delete /v1/chats/{chatID}/messages/{messageID}/reactions">client.chats.messages.reactions.<a href="./src/beeper_desktop_api/resources/chats/messages/reactions.py">delete</a>(message_id, \*, chat_id, \*\*<a href="src/beeper_desktop_api/types/chats/messages/reaction_delete_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chats/messages/reaction_delete_response.py">ReactionDeleteResponse</a></code>
85+
- <code title="delete /v1/chats/{chatID}/messages/{messageID}/reactions/{reactionKey}">client.chats.messages.reactions.<a href="./src/beeper_desktop_api/resources/chats/messages/reactions.py">delete</a>(reaction_key, \*, chat_id, message_id) -> <a href="./src/beeper_desktop_api/types/chats/messages/reaction_delete_response.py">ReactionDeleteResponse</a></code>
8286
- <code title="post /v1/chats/{chatID}/messages/{messageID}/reactions">client.chats.messages.reactions.<a href="./src/beeper_desktop_api/resources/chats/messages/reactions.py">add</a>(message_id, \*, chat_id, \*\*<a href="src/beeper_desktop_api/types/chats/messages/reaction_add_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/chats/messages/reaction_add_response.py">ReactionAddResponse</a></code>
8387

8488
# Messages
@@ -91,8 +95,10 @@ from beeper_desktop_api.types import MessageUpdateResponse, MessageSendResponse
9195

9296
Methods:
9397

98+
- <code title="get /v1/chats/{chatID}/messages/{messageID}">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">retrieve</a>(message_id, \*, chat_id) -> <a href="./src/beeper_desktop_api/types/shared/message.py">Message</a></code>
9499
- <code title="put /v1/chats/{chatID}/messages/{messageID}">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">update</a>(message_id, \*, chat_id, \*\*<a href="src/beeper_desktop_api/types/message_update_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/message_update_response.py">MessageUpdateResponse</a></code>
95100
- <code title="get /v1/chats/{chatID}/messages">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">list</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/message_list_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/shared/message.py">SyncCursorNoLimit[Message]</a></code>
101+
- <code title="delete /v1/chats/{chatID}/messages/{messageID}">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">delete</a>(message_id, \*, chat_id, \*\*<a href="src/beeper_desktop_api/types/message_delete_params.py">params</a>) -> None</code>
96102
- <code title="get /v1/messages/search">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">search</a>(\*\*<a href="src/beeper_desktop_api/types/message_search_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/shared/message.py">SyncCursorSearch[Message]</a></code>
97103
- <code title="post /v1/chats/{chatID}/messages">client.messages.<a href="./src/beeper_desktop_api/resources/messages.py">send</a>(chat_id, \*\*<a href="src/beeper_desktop_api/types/message_send_params.py">params</a>) -> <a href="./src/beeper_desktop_api/types/message_send_response.py">MessageSendResponse</a></code>
98104

src/beeper_desktop_api/_client.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ def assets(self) -> AssetsResource:
165165

166166
@cached_property
167167
def info(self) -> InfoResource:
168-
"""Control the Beeper Desktop application"""
168+
"""Server discovery and capability metadata.
169+
170+
Use /v1/info before authentication setup.
171+
"""
169172
from .resources.info import InfoResource
170173

171174
return InfoResource(self)
@@ -270,15 +273,15 @@ def focus(
270273
) -> FocusResponse:
271274
"""
272275
Focus Beeper Desktop and optionally navigate to a specific chat, message, or
273-
pre-fill draft text and attachment.
276+
pre-fill plain text and an image path.
274277
275278
Args:
276279
chat_id: Optional Beeper chat ID (or local chat ID) to focus after opening the app. If
277280
omitted, only opens/focuses the app.
278281
279-
draft_attachment_path: Optional draft attachment path to populate in the message input field.
282+
draft_attachment_path: Optional image path to populate in the message input field.
280283
281-
draft_text: Optional draft text to populate in the message input field.
284+
draft_text: Optional plain text to populate in the message input field.
282285
283286
message_id: Optional message ID. Jumps to that message in the chat when opening.
284287
@@ -474,7 +477,10 @@ def assets(self) -> AsyncAssetsResource:
474477

475478
@cached_property
476479
def info(self) -> AsyncInfoResource:
477-
"""Control the Beeper Desktop application"""
480+
"""Server discovery and capability metadata.
481+
482+
Use /v1/info before authentication setup.
483+
"""
478484
from .resources.info import AsyncInfoResource
479485

480486
return AsyncInfoResource(self)
@@ -579,15 +585,15 @@ async def focus(
579585
) -> FocusResponse:
580586
"""
581587
Focus Beeper Desktop and optionally navigate to a specific chat, message, or
582-
pre-fill draft text and attachment.
588+
pre-fill plain text and an image path.
583589
584590
Args:
585591
chat_id: Optional Beeper chat ID (or local chat ID) to focus after opening the app. If
586592
omitted, only opens/focuses the app.
587593
588-
draft_attachment_path: Optional draft attachment path to populate in the message input field.
594+
draft_attachment_path: Optional image path to populate in the message input field.
589595
590-
draft_text: Optional draft text to populate in the message input field.
596+
draft_text: Optional plain text to populate in the message input field.
591597
592598
message_id: Optional message ID. Jumps to that message in the chat when opening.
593599
@@ -732,7 +738,10 @@ def assets(self) -> assets.AssetsResourceWithRawResponse:
732738

733739
@cached_property
734740
def info(self) -> info.InfoResourceWithRawResponse:
735-
"""Control the Beeper Desktop application"""
741+
"""Server discovery and capability metadata.
742+
743+
Use /v1/info before authentication setup.
744+
"""
736745
from .resources.info import InfoResourceWithRawResponse
737746

738747
return InfoResourceWithRawResponse(self._client.info)
@@ -781,7 +790,10 @@ def assets(self) -> assets.AsyncAssetsResourceWithRawResponse:
781790

782791
@cached_property
783792
def info(self) -> info.AsyncInfoResourceWithRawResponse:
784-
"""Control the Beeper Desktop application"""
793+
"""Server discovery and capability metadata.
794+
795+
Use /v1/info before authentication setup.
796+
"""
785797
from .resources.info import AsyncInfoResourceWithRawResponse
786798

787799
return AsyncInfoResourceWithRawResponse(self._client.info)
@@ -830,7 +842,10 @@ def assets(self) -> assets.AssetsResourceWithStreamingResponse:
830842

831843
@cached_property
832844
def info(self) -> info.InfoResourceWithStreamingResponse:
833-
"""Control the Beeper Desktop application"""
845+
"""Server discovery and capability metadata.
846+
847+
Use /v1/info before authentication setup.
848+
"""
834849
from .resources.info import InfoResourceWithStreamingResponse
835850

836851
return InfoResourceWithStreamingResponse(self._client.info)
@@ -879,7 +894,10 @@ def assets(self) -> assets.AsyncAssetsResourceWithStreamingResponse:
879894

880895
@cached_property
881896
def info(self) -> info.AsyncInfoResourceWithStreamingResponse:
882-
"""Control the Beeper Desktop application"""
897+
"""Server discovery and capability metadata.
898+
899+
Use /v1/info before authentication setup.
900+
"""
883901
from .resources.info import AsyncInfoResourceWithStreamingResponse
884902

885903
return AsyncInfoResourceWithStreamingResponse(self._client.info)

src/beeper_desktop_api/resources/accounts/accounts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def list(
6565
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6666
) -> AccountListResponse:
6767
"""
68-
Lists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.)
69-
actively connected to this Beeper Desktop instance
68+
List Chat Accounts connected to this Beeper Desktop instance, including bridge
69+
metadata and network identity.
7070
"""
7171
return self._get(
7272
"/v1/accounts",
@@ -115,8 +115,8 @@ async def list(
115115
timeout: float | httpx.Timeout | None | NotGiven = not_given,
116116
) -> AccountListResponse:
117117
"""
118-
Lists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.)
119-
actively connected to this Beeper Desktop instance
118+
List Chat Accounts connected to this Beeper Desktop instance, including bridge
119+
metadata and network identity.
120120
"""
121121
return await self._get(
122122
"/v1/accounts",

src/beeper_desktop_api/resources/assets.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def download(
6868
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6969
) -> AssetDownloadResponse:
7070
"""
71-
Download a Matrix asset using its mxc:// or localmxc:// URL to the device
72-
running Beeper Desktop and return the local file URL.
71+
Download a Matrix file using its mxc:// or localmxc:// URL to the device running
72+
Beeper Desktop and return the local file URL.
7373
7474
Args:
75-
url: Matrix content URL (mxc:// or localmxc://) for the asset to download.
75+
url: Matrix content URL (mxc:// or localmxc://) for the file to download.
7676
7777
extra_headers: Send extra headers
7878
@@ -108,7 +108,7 @@ def serve(
108108
not cached. Supports Range requests for seeking in large files.
109109
110110
Args:
111-
url: Asset URL to serve. Accepts mxc://, localmxc://, or file:// URLs.
111+
url: File URL to serve. Accepts mxc://, localmxc://, or file:// URLs.
112112
113113
extra_headers: Send extra headers
114114
@@ -147,7 +147,8 @@ def upload(
147147
"""Upload a file to a temporary location using multipart/form-data.
148148
149149
Returns an
150-
uploadID that can be referenced when sending messages with attachments.
150+
uploadID that can be referenced when sending a message or materializing a draft
151+
attachment.
151152
152153
Args:
153154
file: The file to upload (max 500 MB).
@@ -203,8 +204,8 @@ def upload_base64(
203204
"""Upload a file using a JSON body with base64-encoded content.
204205
205206
Returns an uploadID
206-
that can be referenced when sending messages with attachments. Alternative to
207-
the multipart upload endpoint.
207+
that can be referenced when sending a message or materializing a draft
208+
attachment. Alternative to the multipart upload endpoint.
208209
209210
Args:
210211
content: Base64-encoded file content (max ~500MB decoded)
@@ -272,11 +273,11 @@ async def download(
272273
timeout: float | httpx.Timeout | None | NotGiven = not_given,
273274
) -> AssetDownloadResponse:
274275
"""
275-
Download a Matrix asset using its mxc:// or localmxc:// URL to the device
276-
running Beeper Desktop and return the local file URL.
276+
Download a Matrix file using its mxc:// or localmxc:// URL to the device running
277+
Beeper Desktop and return the local file URL.
277278
278279
Args:
279-
url: Matrix content URL (mxc:// or localmxc://) for the asset to download.
280+
url: Matrix content URL (mxc:// or localmxc://) for the file to download.
280281
281282
extra_headers: Send extra headers
282283
@@ -312,7 +313,7 @@ async def serve(
312313
not cached. Supports Range requests for seeking in large files.
313314
314315
Args:
315-
url: Asset URL to serve. Accepts mxc://, localmxc://, or file:// URLs.
316+
url: File URL to serve. Accepts mxc://, localmxc://, or file:// URLs.
316317
317318
extra_headers: Send extra headers
318319
@@ -351,7 +352,8 @@ async def upload(
351352
"""Upload a file to a temporary location using multipart/form-data.
352353
353354
Returns an
354-
uploadID that can be referenced when sending messages with attachments.
355+
uploadID that can be referenced when sending a message or materializing a draft
356+
attachment.
355357
356358
Args:
357359
file: The file to upload (max 500 MB).
@@ -407,8 +409,8 @@ async def upload_base64(
407409
"""Upload a file using a JSON body with base64-encoded content.
408410
409411
Returns an uploadID
410-
that can be referenced when sending messages with attachments. Alternative to
411-
the multipart upload endpoint.
412+
that can be referenced when sending a message or materializing a draft
413+
attachment. Alternative to the multipart upload endpoint.
412414
413415
Args:
414416
content: Base64-encoded file content (max ~500MB decoded)

0 commit comments

Comments
 (0)